From d6ba4d93086f59b71cca6789f23c402891bf5ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Mon, 2 Dec 2024 09:51:16 +0100 Subject: [PATCH] Fixed merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- .../launch/cart_example_position.launch.py | 117 ---------------- .../launch/cart_example_velocity.launch.py | 126 ------------------ .../launch/diff_drive_example.launch.py | 116 ---------------- ...ipper_mimic_joint_example_effort.launch.py | 119 ----------------- .../launch/ackermann_drive_example.launch.py | 8 -- .../launch/cart_example_position.launch.py | 9 ++ .../launch/cart_example_velocity.launch.py | 9 ++ .../launch/diff_drive_example.launch.py | 14 -- .../gripper_mimic_joint_example.launch.py | 9 ++ 9 files changed, 27 insertions(+), 500 deletions(-) delete mode 100644 gz_ros2_control_demos/launch/cart_example_position.launch.py delete mode 100644 gz_ros2_control_demos/launch/cart_example_velocity.launch.py delete mode 100644 gz_ros2_control_demos/launch/diff_drive_example.launch.py delete mode 100644 gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py diff --git a/gz_ros2_control_demos/launch/cart_example_position.launch.py b/gz_ros2_control_demos/launch/cart_example_position.launch.py deleted file mode 100644 index c4a78b35..00000000 --- a/gz_ros2_control_demos/launch/cart_example_position.launch.py +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright 2021 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription -from launch.actions import RegisterEventHandler -from launch.event_handlers import OnProcessExit -from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution - -from launch_ros.actions import Node -from launch_ros.substitutions import FindPackageShare - - -def generate_launch_description(): - # Launch Arguments - use_sim_time = LaunchConfiguration('use_sim_time', default=True) - - # Get URDF via xacro - robot_description_content = Command( - [ - PathJoinSubstitution([FindExecutable(name='xacro')]), - ' ', - PathJoinSubstitution( - [FindPackageShare('gz_ros2_control_demos'), - 'urdf', 'test_cart_position.xacro.urdf'] - ), - ] - ) - robot_description = {'robot_description': robot_description_content} - robot_controllers = PathJoinSubstitution( - [ - FindPackageShare('gz_ros2_control_demos'), - 'config', - 'cart_controller_position.yaml', - ] - ) - - node_robot_state_publisher = Node( - package='robot_state_publisher', - executable='robot_state_publisher', - output='screen', - parameters=[robot_description] - ) - - gz_spawn_entity = Node( - package='ros_gz_sim', - executable='create', - output='screen', - arguments=['-topic', 'robot_description', - '-name', 'cart', '-allow_renaming', 'true'], - ) - - joint_state_broadcaster_spawner = Node( - package='controller_manager', - executable='spawner', - arguments=['joint_state_broadcaster', - ], - ) - joint_trajectory_controller_spawner = Node( - package='controller_manager', - executable='spawner', - arguments=[ - 'joint_trajectory_controller', - '--param-file', - robot_controllers, - ], - ) - - # 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( - PythonLaunchDescriptionSource( - [PathJoinSubstitution([FindPackageShare('ros_gz_sim'), - 'launch', - 'gz_sim.launch.py'])]), - launch_arguments=[('gz_args', [' -r -v 4 empty.sdf'])]), - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=gz_spawn_entity, - on_exit=[joint_state_broadcaster_spawner], - ) - ), - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=joint_state_broadcaster_spawner, - on_exit=[joint_trajectory_controller_spawner], - ) - ), - bridge, - node_robot_state_publisher, - gz_spawn_entity, - # Launch Arguments - DeclareLaunchArgument( - 'use_sim_time', - default_value=use_sim_time, - description='If true, use simulated clock'), - ]) diff --git a/gz_ros2_control_demos/launch/cart_example_velocity.launch.py b/gz_ros2_control_demos/launch/cart_example_velocity.launch.py deleted file mode 100644 index 4f0a0405..00000000 --- a/gz_ros2_control_demos/launch/cart_example_velocity.launch.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright 2021 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription -from launch.actions import RegisterEventHandler -from launch.event_handlers import OnProcessExit -from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution - -from launch_ros.actions import Node -from launch_ros.substitutions import FindPackageShare - - -def generate_launch_description(): - # Launch Arguments - use_sim_time = LaunchConfiguration('use_sim_time', default=True) - - # Get URDF via xacro - robot_description_content = Command( - [ - PathJoinSubstitution([FindExecutable(name='xacro')]), - ' ', - PathJoinSubstitution( - [FindPackageShare('gz_ros2_control_demos'), - 'urdf', 'test_cart_velocity.xacro.urdf'] - ), - ] - ) - robot_description = {'robot_description': robot_description_content} - robot_controllers = PathJoinSubstitution( - [ - FindPackageShare('gz_ros2_control_demos'), - 'config', - 'cart_controller_velocity.yaml', - ] - ) - - node_robot_state_publisher = Node( - package='robot_state_publisher', - executable='robot_state_publisher', - output='screen', - parameters=[robot_description] - ) - - gz_spawn_entity = Node( - package='ros_gz_sim', - executable='create', - output='screen', - arguments=['-topic', 'robot_description', - '-name', 'cart', '-allow_renaming', 'true'], - ) - - joint_state_broadcaster_spawner = Node( - package='controller_manager', - executable='spawner', - arguments=['joint_state_broadcaster'], - ) - velocity_controller_spawner = Node( - package='controller_manager', - executable='spawner', - arguments=[ - 'velocity_controller', - '--param-file', - robot_controllers, - ], - ) - imu_sensor_broadcaster_spawner = Node( - package='controller_manager', - executable='spawner', - arguments=[ - 'imu_sensor_broadcaster', - '--param-file', - robot_controllers, - ], - ) - - # 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( - PythonLaunchDescriptionSource( - [PathJoinSubstitution([FindPackageShare('ros_gz_sim'), - 'launch', - 'gz_sim.launch.py'])]), - launch_arguments=[('gz_args', [' -r -v 3 empty.sdf'])]), - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=gz_spawn_entity, - on_exit=[joint_state_broadcaster_spawner], - ) - ), - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=joint_state_broadcaster_spawner, - on_exit=[velocity_controller_spawner, - imu_sensor_broadcaster_spawner], - ) - ), - bridge, - node_robot_state_publisher, - gz_spawn_entity, - # Launch Arguments - DeclareLaunchArgument( - 'use_sim_time', - default_value=use_sim_time, - description='If true, use simulated clock'), - ]) diff --git a/gz_ros2_control_demos/launch/diff_drive_example.launch.py b/gz_ros2_control_demos/launch/diff_drive_example.launch.py deleted file mode 100644 index 21c5afb7..00000000 --- a/gz_ros2_control_demos/launch/diff_drive_example.launch.py +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright 2022 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription -from launch.actions import RegisterEventHandler -from launch.event_handlers import OnProcessExit -from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution - -from launch_ros.actions import Node -from launch_ros.substitutions import FindPackageShare - - -def generate_launch_description(): - # Launch Arguments - use_sim_time = LaunchConfiguration('use_sim_time', default=True) - - # Get URDF via xacro - robot_description_content = Command( - [ - PathJoinSubstitution([FindExecutable(name='xacro')]), - ' ', - PathJoinSubstitution( - [FindPackageShare('gz_ros2_control_demos'), - 'urdf', 'test_diff_drive.xacro.urdf'] - ), - ] - ) - robot_description = {'robot_description': robot_description_content} - robot_controllers = PathJoinSubstitution( - [ - FindPackageShare('gz_ros2_control_demos'), - 'config', - 'diff_drive_controller_velocity.yaml', - ] - ) - - node_robot_state_publisher = Node( - package='robot_state_publisher', - executable='robot_state_publisher', - output='screen', - parameters=[robot_description] - ) - - gz_spawn_entity = Node( - package='ros_gz_sim', - executable='create', - output='screen', - arguments=['-topic', 'robot_description', '-name', - 'diff_drive', '-allow_renaming', 'true'], - ) - - joint_state_broadcaster_spawner = Node( - package='controller_manager', - executable='spawner', - arguments=['joint_state_broadcaster'], - ) - diff_drive_base_controller_spawner = Node( - package='controller_manager', - executable='spawner', - arguments=[ - 'diff_drive_base_controller', - '--param-file', - robot_controllers, - ], - ) - - # 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( - PythonLaunchDescriptionSource( - [PathJoinSubstitution([FindPackageShare('ros_gz_sim'), - 'launch', - 'gz_sim.launch.py'])]), - launch_arguments=[('gz_args', [' -r -v 4 empty.sdf'])]), - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=gz_spawn_entity, - on_exit=[joint_state_broadcaster_spawner], - ) - ), - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=joint_state_broadcaster_spawner, - on_exit=[diff_drive_base_controller_spawner], - ) - ), - bridge, - node_robot_state_publisher, - gz_spawn_entity, - # Launch Arguments - DeclareLaunchArgument( - 'use_sim_time', - default_value=use_sim_time, - description='If true, use simulated clock'), - ]) 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 deleted file mode 100644 index e074e869..00000000 --- a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py +++ /dev/null @@ -1,119 +0,0 @@ -# Copyright 2022 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author: Denis Stogl (Stogl Robotics Consulting) -# - -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription -from launch.actions import RegisterEventHandler -from launch.event_handlers import OnProcessExit -from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution - -from launch_ros.actions import Node -from launch_ros.substitutions import FindPackageShare - - -def generate_launch_description(): - # Launch Arguments - use_sim_time = LaunchConfiguration('use_sim_time', default=True) - - # Get URDF via xacro - robot_description_content = Command( - [ - PathJoinSubstitution([FindExecutable(name='xacro')]), - ' ', - PathJoinSubstitution( - [FindPackageShare('gz_ros2_control_demos'), - 'urdf', 'test_gripper_mimic_joint_effort.xacro.urdf'] - ), - ] - ) - robot_description = {'robot_description': robot_description_content} - robot_controllers = PathJoinSubstitution( - [ - FindPackageShare('gz_ros2_control_demos'), - 'config', - 'gripper_controller_effort.yaml', - ] - ) - - node_robot_state_publisher = Node( - package='robot_state_publisher', - executable='robot_state_publisher', - output='screen', - parameters=[robot_description] - ) - - gz_spawn_entity = Node( - package='ros_gz_sim', - executable='create', - output='screen', - arguments=['-topic', 'robot_description', '-name', - 'gripper', '-allow_renaming', 'true'], - ) - - joint_state_broadcaster_spawner = Node( - package='controller_manager', - executable='spawner', - arguments=['joint_state_broadcaster'], - ) - gripper_controller_spawner = Node( - package='controller_manager', - executable='spawner', - arguments=[ - 'gripper_controller', - '--param-file', - robot_controllers, - ], - ) - - # 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( - PythonLaunchDescriptionSource( - [PathJoinSubstitution([FindPackageShare('ros_gz_sim'), - 'launch', - 'gz_sim.launch.py'])]), - launch_arguments=[('gz_args', [' -r -v 4 empty.sdf'])]), - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=gz_spawn_entity, - on_exit=[joint_state_broadcaster_spawner], - ) - ), - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=joint_state_broadcaster_spawner, - on_exit=[gripper_controller_spawner], - ) - ), - bridge, - node_robot_state_publisher, - gz_spawn_entity, - # Launch Arguments - DeclareLaunchArgument( - 'use_sim_time', - default_value=use_sim_time, - description='If true, use simulated clock'), - ]) diff --git a/ign_ros2_control_demos/launch/ackermann_drive_example.launch.py b/ign_ros2_control_demos/launch/ackermann_drive_example.launch.py index a4996042..5abdd038 100644 --- a/ign_ros2_control_demos/launch/ackermann_drive_example.launch.py +++ b/ign_ros2_control_demos/launch/ackermann_drive_example.launch.py @@ -75,14 +75,6 @@ def generate_launch_description(): output='screen' ) - # Bridge - bridge = Node( - package='ros_gz_bridge', - executable='parameter_bridge', - arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], - output='screen' - ) - return LaunchDescription([ bridge, # Launch gazebo environment diff --git a/ign_ros2_control_demos/launch/cart_example_position.launch.py b/ign_ros2_control_demos/launch/cart_example_position.launch.py index ffbeae6a..aca8fff9 100644 --- a/ign_ros2_control_demos/launch/cart_example_position.launch.py +++ b/ign_ros2_control_demos/launch/cart_example_position.launch.py @@ -72,6 +72,14 @@ def generate_launch_description(): output='screen' ) + # 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( @@ -98,4 +106,5 @@ def generate_launch_description(): 'use_sim_time', default_value=use_sim_time, description='If true, use simulated clock'), + bridge, ]) diff --git a/ign_ros2_control_demos/launch/cart_example_velocity.launch.py b/ign_ros2_control_demos/launch/cart_example_velocity.launch.py index d69b4130..f68e81fd 100644 --- a/ign_ros2_control_demos/launch/cart_example_velocity.launch.py +++ b/ign_ros2_control_demos/launch/cart_example_velocity.launch.py @@ -77,6 +77,14 @@ def generate_launch_description(): output='screen' ) + # 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( @@ -109,4 +117,5 @@ def generate_launch_description(): 'use_sim_time', default_value=use_sim_time, description='If true, use simulated clock'), + bridge, ]) diff --git a/ign_ros2_control_demos/launch/diff_drive_example.launch.py b/ign_ros2_control_demos/launch/diff_drive_example.launch.py index d0147161..7f742ac1 100644 --- a/ign_ros2_control_demos/launch/diff_drive_example.launch.py +++ b/ign_ros2_control_demos/launch/diff_drive_example.launch.py @@ -1,17 +1,3 @@ -# Copyright 2022 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - import os from ament_index_python.packages import get_package_share_directory diff --git a/ign_ros2_control_demos/launch/gripper_mimic_joint_example.launch.py b/ign_ros2_control_demos/launch/gripper_mimic_joint_example.launch.py index bf12d3d8..5c3b92b8 100644 --- a/ign_ros2_control_demos/launch/gripper_mimic_joint_example.launch.py +++ b/ign_ros2_control_demos/launch/gripper_mimic_joint_example.launch.py @@ -75,6 +75,14 @@ def generate_launch_description(): output='screen' ) + # Bridge + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock'], + output='screen' + ) + return LaunchDescription([ # Launch gazebo environment IncludeLaunchDescription( @@ -101,4 +109,5 @@ def generate_launch_description(): 'use_sim_time', default_value=use_sim_time, description='If true, use simulated clock'), + bridge, ])