From 301ca580d0772b9952579a783632500eeca7e53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Mon, 2 Dec 2024 09:42:02 +0100 Subject: [PATCH] Add missing bridge for simulation time (#443) --- .../launch/cart_example_effort.launch.py | 9 +++++++++ .../launch/cart_example_position.launch.py | 12 +++++++++++- .../launch/cart_example_velocity.launch.py | 9 +++++++++ .../launch/diff_drive_example.launch.py | 9 +++++++++ .../gripper_mimic_joint_example_effort.launch.py | 9 +++++++++ .../gripper_mimic_joint_example_position.launch.py | 9 +++++++++ .../launch/pendulum_example_effort.launch.py | 9 +++++++++ .../launch/pendulum_example_position.launch.py | 9 +++++++++ gz_ros2_control_tests/tests/position_test.py | 9 +++++++++ 9 files changed, 83 insertions(+), 1 deletion(-) diff --git a/gz_ros2_control_demos/launch/cart_example_effort.launch.py b/gz_ros2_control_demos/launch/cart_example_effort.launch.py index 211e1c95..dcf93fe5 100644 --- a/gz_ros2_control_demos/launch/cart_example_effort.launch.py +++ b/gz_ros2_control_demos/launch/cart_example_effort.launch.py @@ -77,6 +77,14 @@ def generate_launch_description(): ], ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], + output='screen' + ) + return LaunchDescription([ # Launch gazebo environment IncludeLaunchDescription( @@ -97,6 +105,7 @@ def generate_launch_description(): on_exit=[effort_controller_spawner], ) ), + bridge, node_robot_state_publisher, gz_spawn_entity, # Launch Arguments diff --git a/gz_ros2_control_demos/launch/cart_example_position.launch.py b/gz_ros2_control_demos/launch/cart_example_position.launch.py index 17658998..c4a78b35 100644 --- a/gz_ros2_control_demos/launch/cart_example_position.launch.py +++ b/gz_ros2_control_demos/launch/cart_example_position.launch.py @@ -65,7 +65,8 @@ def generate_launch_description(): joint_state_broadcaster_spawner = Node( package='controller_manager', executable='spawner', - arguments=['joint_state_broadcaster'], + arguments=['joint_state_broadcaster', + ], ) joint_trajectory_controller_spawner = Node( package='controller_manager', @@ -77,6 +78,14 @@ def generate_launch_description(): ], ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], + output='screen' + ) + return LaunchDescription([ # Launch gazebo environment IncludeLaunchDescription( @@ -97,6 +106,7 @@ def generate_launch_description(): on_exit=[joint_trajectory_controller_spawner], ) ), + bridge, node_robot_state_publisher, gz_spawn_entity, # Launch Arguments diff --git a/gz_ros2_control_demos/launch/cart_example_velocity.launch.py b/gz_ros2_control_demos/launch/cart_example_velocity.launch.py index ee4786ff..4f0a0405 100644 --- a/gz_ros2_control_demos/launch/cart_example_velocity.launch.py +++ b/gz_ros2_control_demos/launch/cart_example_velocity.launch.py @@ -86,6 +86,14 @@ def generate_launch_description(): ], ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], + output='screen' + ) + return LaunchDescription([ # Launch gazebo environment IncludeLaunchDescription( @@ -107,6 +115,7 @@ def generate_launch_description(): imu_sensor_broadcaster_spawner], ) ), + bridge, node_robot_state_publisher, gz_spawn_entity, # Launch Arguments diff --git a/gz_ros2_control_demos/launch/diff_drive_example.launch.py b/gz_ros2_control_demos/launch/diff_drive_example.launch.py index 44b23a78..21c5afb7 100644 --- a/gz_ros2_control_demos/launch/diff_drive_example.launch.py +++ b/gz_ros2_control_demos/launch/diff_drive_example.launch.py @@ -77,6 +77,14 @@ def generate_launch_description(): ], ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], + output='screen' + ) + return LaunchDescription([ # Launch gazebo environment IncludeLaunchDescription( @@ -97,6 +105,7 @@ def generate_launch_description(): on_exit=[diff_drive_base_controller_spawner], ) ), + bridge, node_robot_state_publisher, gz_spawn_entity, # Launch Arguments diff --git a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py index e4f39eb6..e074e869 100644 --- a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py +++ b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py @@ -80,6 +80,14 @@ def generate_launch_description(): ], ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], + output='screen' + ) + return LaunchDescription([ # Launch gazebo environment IncludeLaunchDescription( @@ -100,6 +108,7 @@ def generate_launch_description(): on_exit=[gripper_controller_spawner], ) ), + bridge, node_robot_state_publisher, gz_spawn_entity, # Launch Arguments diff --git a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_position.launch.py b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_position.launch.py index fe936755..3106d968 100644 --- a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_position.launch.py +++ b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_position.launch.py @@ -80,6 +80,14 @@ def generate_launch_description(): ], ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], + output='screen' + ) + return LaunchDescription([ # Launch gazebo environment IncludeLaunchDescription( @@ -100,6 +108,7 @@ def generate_launch_description(): on_exit=[gripper_controller_spawner], ) ), + bridge, node_robot_state_publisher, gz_spawn_entity, # Launch Arguments diff --git a/gz_ros2_control_demos/launch/pendulum_example_effort.launch.py b/gz_ros2_control_demos/launch/pendulum_example_effort.launch.py index e8b25df8..f9a94ceb 100644 --- a/gz_ros2_control_demos/launch/pendulum_example_effort.launch.py +++ b/gz_ros2_control_demos/launch/pendulum_example_effort.launch.py @@ -77,6 +77,14 @@ def generate_launch_description(): ], ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], + output='screen' + ) + return LaunchDescription([ # Launch gazebo environment IncludeLaunchDescription( @@ -97,6 +105,7 @@ def generate_launch_description(): on_exit=[effort_controller_spawner], ) ), + bridge, node_robot_state_publisher, gz_spawn_entity, # Launch Arguments diff --git a/gz_ros2_control_demos/launch/pendulum_example_position.launch.py b/gz_ros2_control_demos/launch/pendulum_example_position.launch.py index 2a920394..8815673a 100644 --- a/gz_ros2_control_demos/launch/pendulum_example_position.launch.py +++ b/gz_ros2_control_demos/launch/pendulum_example_position.launch.py @@ -77,6 +77,14 @@ def generate_launch_description(): ], ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], + output='screen' + ) + return LaunchDescription([ # Launch gazebo environment IncludeLaunchDescription( @@ -97,6 +105,7 @@ def generate_launch_description(): on_exit=[joint_trajectory_controller_spawner], ) ), + bridge, node_robot_state_publisher, gz_spawn_entity, # Launch Arguments diff --git a/gz_ros2_control_tests/tests/position_test.py b/gz_ros2_control_tests/tests/position_test.py index ddb775cc..02adf05d 100755 --- a/gz_ros2_control_tests/tests/position_test.py +++ b/gz_ros2_control_tests/tests/position_test.py @@ -101,8 +101,17 @@ def generate_test_description(): ], ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], + output='screen' + ) + ld = launch.LaunchDescription([ included_launch, + bridge, gz_spawn_entity, node_robot_state_publisher, RegisterEventHandler(