diff --git a/ur_simulation_gz/launch/ur_sim_control.launch.py b/ur_simulation_gz/launch/ur_sim_control.launch.py index ca4f5fb..533191e 100644 --- a/ur_simulation_gz/launch/ur_sim_control.launch.py +++ b/ur_simulation_gz/launch/ur_sim_control.launch.py @@ -61,24 +61,20 @@ def launch_setup(context, *args, **kwargs): prefix = LaunchConfiguration("prefix") activate_joint_controller = LaunchConfiguration("activate_joint_controller") initial_joint_controller = LaunchConfiguration("initial_joint_controller") + description_file = LaunchConfiguration("description_file") launch_rviz = LaunchConfiguration("launch_rviz") + rviz_config_file = LaunchConfiguration("rviz_config_file") gazebo_gui = LaunchConfiguration("gazebo_gui") initial_joint_controllers = PathJoinSubstitution( [FindPackageShare(runtime_config_package), "config", controllers_file] ) - rviz_config_file = PathJoinSubstitution( - [FindPackageShare("ur_description"), "rviz", "view_robot.rviz"] - ) - robot_description_content = Command( [ PathJoinSubstitution([FindExecutable(name="xacro")]), " ", - PathJoinSubstitution( - [FindPackageShare("ur_simulation_gz"), "urdf", "ur_gz.urdf.xacro"] - ), + description_file, " ", "safety_limits:=", safety_limits, @@ -259,9 +255,27 @@ def generate_launch_description(): description="Robot controller to start.", ) ) + declared_arguments.append( + DeclareLaunchArgument( + "description_file", + default_value=PathJoinSubstitution( + [FindPackageShare("ur_simulation_gz"), "urdf", "ur_gz.urdf.xacro"] + ), + description="URDF/XACRO description file (absolute path) with the robot.", + ) + ) declared_arguments.append( DeclareLaunchArgument("launch_rviz", default_value="true", description="Launch RViz?") ) + declared_arguments.append( + DeclareLaunchArgument( + "rviz_config_file", + default_value=PathJoinSubstitution( + [FindPackageShare("ur_description"), "rviz", "view_robot.rviz"] + ), + description="Rviz config file (absolute path) to use when launching rviz.", + ) + ) declared_arguments.append( DeclareLaunchArgument( "gazebo_gui", default_value="true", description="Start gazebo with GUI?" diff --git a/ur_simulation_gz/launch/ur_sim_moveit.launch.py b/ur_simulation_gz/launch/ur_sim_moveit.launch.py index d3b1685..b093e9c 100644 --- a/ur_simulation_gz/launch/ur_sim_moveit.launch.py +++ b/ur_simulation_gz/launch/ur_sim_moveit.launch.py @@ -42,7 +42,6 @@ def launch_setup(context, *args, **kwargs): # General arguments runtime_config_package = LaunchConfiguration("runtime_config_package") controllers_file = LaunchConfiguration("controllers_file") - description_package = LaunchConfiguration("description_package") description_file = LaunchConfiguration("description_file") moveit_launch_file = LaunchConfiguration("moveit_launch_file") prefix = LaunchConfiguration("prefix") @@ -58,7 +57,6 @@ def launch_setup(context, *args, **kwargs): "safety_limits": safety_limits, "runtime_config_package": runtime_config_package, "controllers_file": controllers_file, - "description_package": description_package, "description_file": description_file, "prefix": prefix, "launch_rviz": "false", @@ -116,19 +114,13 @@ def generate_launch_description(): description="YAML file with the controllers configuration.", ) ) - declared_arguments.append( - DeclareLaunchArgument( - "description_package", - default_value="ur_description", - description="Description package with robot URDF/XACRO files. Usually the argument " - "is not set, it enables use of a custom description.", - ) - ) declared_arguments.append( DeclareLaunchArgument( "description_file", - default_value="ur.urdf.xacro", - description="URDF/XACRO description file with the robot.", + default_value=PathJoinSubstitution( + [FindPackageShare("ur_simulation_gz"), "urdf", "ur_gz.urdf.xacro"] + ), + description="URDF/XACRO description file (absolute path) with the robot.", ) ) declared_arguments.append(