From 3b0446c0842a781ebfed52e9e8cad681d98ae931 Mon Sep 17 00:00:00 2001 From: Manuel M Date: Wed, 14 Feb 2024 11:52:05 +0100 Subject: [PATCH] showcase for transmissions in mock hw --- ...ot_transmissions_system_position_only.launch.py | 12 ++++++++++++ ...issions_system_position_only.ros2_control.xacro | 14 ++++++++++---- ...t_transmissions_system_position_only.urdf.xacro | 8 ++++++-- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/example_8/bringup/launch/rrbot_transmissions_system_position_only.launch.py b/example_8/bringup/launch/rrbot_transmissions_system_position_only.launch.py index f42999770..88cbeb9eb 100644 --- a/example_8/bringup/launch/rrbot_transmissions_system_position_only.launch.py +++ b/example_8/bringup/launch/rrbot_transmissions_system_position_only.launch.py @@ -39,6 +39,14 @@ def generate_launch_description(): "slowdown", default_value="50.0", description="Slowdown factor of the RRbot." ) ) + declared_arguments.append( + DeclareLaunchArgument( + "use_mock_hardware", + default_value="false", + description="Use mock hardware instead of real one.", + choices=["true", "false"], + ) + ) declared_arguments.append( DeclareLaunchArgument( "robot_controller", @@ -57,6 +65,7 @@ def generate_launch_description(): # Initialize Arguments prefix = LaunchConfiguration("prefix") slowdown = LaunchConfiguration("slowdown") + use_mock_hardware = LaunchConfiguration("use_mock_hardware") robot_controller = LaunchConfiguration("robot_controller") gui = LaunchConfiguration("gui") @@ -78,6 +87,9 @@ def generate_launch_description(): " ", "slowdown:=", slowdown, + " ", + "use_mock_hardware:=", + use_mock_hardware, ] ) robot_description = {"robot_description": robot_description_content} diff --git a/example_8/description/ros2_control/rrbot_transmissions_system_position_only.ros2_control.xacro b/example_8/description/ros2_control/rrbot_transmissions_system_position_only.ros2_control.xacro index f7d13edf8..4ed10e6ee 100644 --- a/example_8/description/ros2_control/rrbot_transmissions_system_position_only.ros2_control.xacro +++ b/example_8/description/ros2_control/rrbot_transmissions_system_position_only.ros2_control.xacro @@ -1,12 +1,18 @@ - + - ros2_control_demo_example_8/RRBotTransmissionsSystemPositionOnlyHardware + + mock_components/GenericSystem + ${mock_sensor_commands} + + + ros2_control_demo_example_8/RRBotTransmissionsSystemPositionOnlyHardware + ${slowdown} @@ -31,7 +37,7 @@ 2.0 - 0.0 + 0.2 @@ -40,7 +46,7 @@ 4.0 - 0.0 + -0.2 diff --git a/example_8/description/urdf/rrbot_transmissions_system_position_only.urdf.xacro b/example_8/description/urdf/rrbot_transmissions_system_position_only.urdf.xacro index 02181f552..dcc00f892 100644 --- a/example_8/description/urdf/rrbot_transmissions_system_position_only.urdf.xacro +++ b/example_8/description/urdf/rrbot_transmissions_system_position_only.urdf.xacro @@ -9,6 +9,7 @@ https://github.com/ros-simulation/gazebo_ros_demos/blob/kinetic-devel/rrbot_desc + @@ -27,7 +28,10 @@ https://github.com/ros-simulation/gazebo_ros_demos/blob/kinetic-devel/rrbot_desc + name="RRBotTransmissionsSystemPositionOnly" + prefix="$(arg prefix)" + slowdown="$(arg slowdown)" + use_mock_hardware="$(arg use_mock_hardware)" + />