diff --git a/README.md b/README.md index ba0cf9b..3f916fa 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ sudo apt install -y ros-${ROS_DISTRO}-webots-ros2 \ ros-${ROS_DISTRO}-ros2-controllers \ ros-${ROS_DISTRO}-moveit \ ros-${ROS_DISTRO}-moveit-py \ - ros-${ROS_DISTRO}-ament-cmake-clang-format + ros-${ROS_DISTRO}-ament-cmake-clang-format \ + sudo apt install ros-$ROS_DISTRO-rosbag2-storage-mcap ``` @@ -59,4 +60,38 @@ sudo pip3 install transforms3d --break-system-packages ```bash rosdep install --from-paths src --ignore-src -r -y --os=ubuntu:jammy +``` + +Запись данных в rosbag: + +```bash +# Record all topics +ros2 bag record -a --storage mcap -o my_session + +# Record specific topics +ros2 bag record \ + /camera/image_raw \ + /lidar/points \ + /imu/data \ + --storage mcap \ + -o robot_drive_session + + +# LZ4 = faster write, moderate compression (good for real-time recording) +ros2 bag record -a --storage mcap \ + --compression-mode file \ + --compression-format lz4 \ + -o compressed_session + +# Zstandard = slower write, better compression (good for post-processing) +ros2 bag record -a --storage mcap \ + --compression-mode file \ + --compression-format zstd \ + -o compressed_zstd_session + +# convert existing rosbag2 to mcap format +ros2 bag convert \ + -i robot_drive_old/ \ + -o robot_drive_mcap/ \ + --output-options '{"storage_id": "mcap"}' ``` \ No newline at end of file diff --git a/src/iiwa_bringup/launch/iiwa.launch.py b/src/iiwa_bringup/launch/iiwa.launch.py index e263828..a64b9d7 100644 --- a/src/iiwa_bringup/launch/iiwa.launch.py +++ b/src/iiwa_bringup/launch/iiwa.launch.py @@ -103,7 +103,7 @@ def _runtime_setup(context, *args, **kwargs): setup += [webots_launch] - # Controller launch) + # Controller launch if simulate: controller_args = { "robot_name": settings.robot.name, @@ -122,6 +122,7 @@ def _runtime_setup(context, *args, **kwargs): "initial_positions_file": settings.controller.moveit.initial_positions, "controller_path": settings.controller.controller_path, "simulate": "false", + "command_mode": settings.robot.command_mode, } controllers_launch = IncludeLaunchDescription( diff --git a/src/iiwa_bringup/launch/supported/controllers.launch.py b/src/iiwa_bringup/launch/supported/controllers.launch.py index 295873c..44746f1 100644 --- a/src/iiwa_bringup/launch/supported/controllers.launch.py +++ b/src/iiwa_bringup/launch/supported/controllers.launch.py @@ -1,5 +1,5 @@ from launch import LaunchDescription -from launch.actions import OpaqueFunction +from launch.actions import DeclareLaunchArgument, OpaqueFunction from launch.substitutions import LaunchConfiguration from launch.event_handlers import OnProcessExit from launch.actions import RegisterEventHandler @@ -19,8 +19,10 @@ def _setup_controllers(context, *args, **kwargs): controller_timer = LaunchConfiguration("controller_timer").perform(context) controller_path = LaunchConfiguration("controller_path").perform(context) simulate = LaunchConfiguration("simulate").perform(context).lower() in ("true", "1", "yes") + command_mode = LaunchConfiguration("command_mode").perform(context) xacro_args = {"initial_positions_file": initial_positions_file} + if simulate: xacro_args["simulate"] = "true" @@ -54,8 +56,7 @@ def _setup_controllers(context, *args, **kwargs): package="controller_manager", executable="spawner", output="screen", - arguments=["forward_torque_controller", - "--inactive"] + tmo, + arguments=["iiwa_arm_torque_controller", "--inactive"] + tmo, parameters=[{"use_sim_time": True}] ) @@ -90,25 +91,26 @@ def _setup_controllers(context, *args, **kwargs): ], ) + jtc_args = ["iiwa_arm_controller", "--controller-manager", "/controller_manager"] + torque_args = ["iiwa_arm_torque_controller", "--controller-manager", "/controller_manager"] + + if command_mode == "torque": + jtc_args += ["--inactive"] + else: + torque_args += ["--inactive"] + jtc = Node( package="controller_manager", executable="spawner", output="screen", - arguments=[ - "iiwa_arm_controller", - "--controller-manager", "/controller_manager", - ], + arguments=jtc_args, ) torque_controller = Node( package="controller_manager", executable="spawner", output="screen", - arguments=[ - "forward_torque_controller", - "--controller-manager", "/controller_manager", - "--inactive", - ], + arguments=torque_args, ) jtc_after_jsb = RegisterEventHandler( @@ -126,4 +128,7 @@ def _setup_controllers(context, *args, **kwargs): def generate_launch_description(): - return LaunchDescription([OpaqueFunction(function=_setup_controllers)]) + return LaunchDescription([ + DeclareLaunchArgument("command_mode", default_value="position"), + OpaqueFunction(function=_setup_controllers), + ]) diff --git a/src/iiwa_config/config/moveit/iiwa_controller.yaml b/src/iiwa_config/config/moveit/iiwa_controller.yaml index f1e737e..a3c508f 100644 --- a/src/iiwa_config/config/moveit/iiwa_controller.yaml +++ b/src/iiwa_config/config/moveit/iiwa_controller.yaml @@ -8,7 +8,7 @@ controller_manager: iiwa_arm_controller: type: "joint_trajectory_controller/JointTrajectoryController" - forward_torque_controller: + iiwa_arm_torque_controller: type: "forward_command_controller/ForwardCommandController" # Основной контроллер - плавное движение по траектории @@ -58,7 +58,7 @@ iiwa_arm_controller: # Torque контроллер - прямое управление моментом # Активировать только при command_mode:=torque в launch файле -forward_torque_controller: +iiwa_arm_torque_controller: ros__parameters: joints: - joint1 diff --git a/src/iiwa_description/resource/freecad_models/camera_spacer.20260409-160823.FCBak b/src/iiwa_description/resource/freecad_models/camera_spacer.20260409-160823.FCBak new file mode 100644 index 0000000..9733b11 Binary files /dev/null and b/src/iiwa_description/resource/freecad_models/camera_spacer.20260409-160823.FCBak differ diff --git a/src/iiwa_description/resource/freecad_models/camera_spacer.FCStd b/src/iiwa_description/resource/freecad_models/camera_spacer.FCStd new file mode 100644 index 0000000..2fb5366 Binary files /dev/null and b/src/iiwa_description/resource/freecad_models/camera_spacer.FCStd differ diff --git a/src/iiwa_description/resource/freecad_models/metal_spacer.FCStd b/src/iiwa_description/resource/freecad_models/metal_spacer.FCStd new file mode 100644 index 0000000..341fc11 Binary files /dev/null and b/src/iiwa_description/resource/freecad_models/metal_spacer.FCStd differ diff --git a/src/iiwa_description/resource/freecad_models/patron.20260409-100611.FCBak b/src/iiwa_description/resource/freecad_models/patron.20260409-100611.FCBak deleted file mode 100644 index b7fe0ed..0000000 Binary files a/src/iiwa_description/resource/freecad_models/patron.20260409-100611.FCBak and /dev/null differ diff --git a/src/iiwa_description/resource/freecad_models/patron.FCStd b/src/iiwa_description/resource/freecad_models/patron.FCStd deleted file mode 100644 index 0fe29ea..0000000 Binary files a/src/iiwa_description/resource/freecad_models/patron.FCStd and /dev/null differ diff --git a/src/iiwa_description/urdf/gripper/gripper_macros.xacro b/src/iiwa_description/urdf/gripper/gripper_macros.xacro index 1aed3bd..920aeb0 100644 --- a/src/iiwa_description/urdf/gripper/gripper_macros.xacro +++ b/src/iiwa_description/urdf/gripper/gripper_macros.xacro @@ -29,26 +29,6 @@ - - - - - ${r} ${g} ${b} ${a} - ${r} ${g} ${b} ${a} - 0.3 0.3 0.3 1.0 - - - - - - 1.01.0 - - - 1000000.0100.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - webots_ros2_control::Ros2ControlSystem - - - - - -2.97 - 2.97 - - - ${initial_positions['joint1']} - - - - - - - - -2.09 - 2.09 - - - ${initial_positions['joint2']} - - - - - - - - -2.97 - 2.97 - - - ${initial_positions['joint3']} - - - - - - - - -2.09 - 2.09 - - - ${initial_positions['joint4']} - - - - - - - - -2.97 - 2.97 - - - ${initial_positions['joint5']} - - - - - - - - -2.09 - 2.09 - - - ${initial_positions['joint6']} - - - - - - - - -3.05 - 3.05 - - - ${initial_positions['joint7']} - - - - - - - - \ No newline at end of file diff --git a/src/iiwa_description/urdf/iiwa7_gazebo.urdf b/src/iiwa_description/urdf/iiwa7_gazebo.urdf deleted file mode 100644 index 94f14de..0000000 --- a/src/iiwa_description/urdf/iiwa7_gazebo.urdf +++ /dev/null @@ -1,446 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4529411764705884 0.4337254901960785 0.41176470588235287 1 - 0.647058823529412 0.619607843137255 0.588235294117647 1 - 0.3 0.3 0.3 1.0 - 0 0 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4529411764705884 0.4337254901960785 0.41176470588235287 1 - 0.647058823529412 0.619607843137255 0.588235294117647 1 - 0.3 0.3 0.3 1.0 - 0 0 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4529411764705884 0.4337254901960785 0.41176470588235287 1 - 0.647058823529412 0.619607843137255 0.588235294117647 1 - 0.3 0.3 0.3 1.0 - 0 0 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4529411764705884 0.4337254901960785 0.41176470588235287 1 - 0.647058823529412 0.619607843137255 0.588235294117647 1 - 0.3 0.3 0.3 1.0 - 0 0 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4529411764705884 0.4337254901960785 0.41176470588235287 1 - 0.647058823529412 0.619607843137255 0.588235294117647 1 - 0.3 0.3 0.3 1.0 - 0 0 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4529411764705884 0.4337254901960785 0.41176470588235287 1 - 0.647058823529412 0.619607843137255 0.588235294117647 1 - 0.3 0.3 0.3 1.0 - 0 0 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4529411764705884 0.4337254901960785 0.41176470588235287 1 - 0.647058823529412 0.619607843137255 0.588235294117647 1 - 0.3 0.3 0.3 1.0 - 0 0 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4529411764705884 0.4337254901960785 0.41176470588235287 1 - 0.647058823529412 0.619607843137255 0.588235294117647 1 - 0.3 0.3 0.3 1.0 - 0 0 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /home/daniel/dev/kuka_iiwa7_ros2/install/iiwa_config/share/iiwa_config/config/moveit/iiwa_controller.yaml - - ~/robot_description:=/robot_description - - - - - - gz_ros2_control/GazeboSimSystem - - - - -2.97 - 2.97 - - - 0 - - - - - - - -2.09 - 2.09 - - - 0 - - - - - - - -2.97 - 2.97 - - - 0 - - - - - - - -2.09 - 2.09 - - - 0 - - - - - - - -2.97 - 2.97 - - - 0 - - - - - - - -2.09 - 2.09 - - - 0 - - - - - - - -3.05 - 3.05 - - - 0 - - - - - - diff --git a/src/iiwa_description/urdf/macros.xacro b/src/iiwa_description/urdf/macros.xacro index 6f560f5..6b7cbb6 100644 --- a/src/iiwa_description/urdf/macros.xacro +++ b/src/iiwa_description/urdf/macros.xacro @@ -28,16 +28,6 @@ - - - - ${color_r * 0.7} ${color_g * 0.7} ${color_b * 0.7} ${color_a} - ${color_r} ${color_g} ${color_b} ${color_a} - 0.3 0.3 0.3 1.0 - 0 0 0 1 - - - diff --git a/src/iiwa_description/urdf/table/table.urdf b/src/iiwa_description/urdf/table/table.urdf index e392d62..a4f57a8 100644 --- a/src/iiwa_description/urdf/table/table.urdf +++ b/src/iiwa_description/urdf/table/table.urdf @@ -27,17 +27,6 @@ - - - - 0.55 0.55 0.58 1 - 0.65 0.65 0.68 1 - 0.3 0.3 0.3 1 - 0.60.4 - - - - @@ -84,33 +73,6 @@ - - - - 0.92 0.92 0.92 1 - 0.95 0.95 0.95 1 - 0.1 0.1 0.1 1 - - - - 1.0 0.38 0.0 11.0 0.38 0.0 10.3 0.15 0.0 1 - - - 1.0 0.38 0.0 11.0 0.38 0.0 10.3 0.15 0.0 1 - - - 1.0 0.38 0.0 11.0 0.38 0.0 10.3 0.15 0.0 1 - - - 1.0 0.38 0.0 11.0 0.38 0.0 10.3 0.15 0.0 1 - - - - 0.30.3 - - - - @@ -131,17 +93,6 @@ - - - - 0.55 0.55 0.58 1 - 0.65 0.65 0.68 1 - 0.3 0.3 0.3 1 - 0.60.4 - - - - @@ -158,17 +109,6 @@ - - - - 0.55 0.55 0.58 1 - 0.65 0.65 0.68 1 - 0.3 0.3 0.3 1 - 0.60.4 - - - - @@ -189,17 +129,6 @@ - - - - 0.18 0.18 0.20 1 - 0.22 0.22 0.24 1 - 0.5 0.5 0.5 1 - 0.30.7 - - - -