diff --git a/ur_simulation_gazebo/launch/ur_sim_control.launch.py b/ur_simulation_gazebo/launch/ur_sim_control.launch.py index ea1dd3d..7783f12 100644 --- a/ur_simulation_gazebo/launch/ur_sim_control.launch.py +++ b/ur_simulation_gazebo/launch/ur_sim_control.launch.py @@ -53,8 +53,10 @@ def launch_setup(context, *args, **kwargs): # General arguments runtime_config_package = LaunchConfiguration("runtime_config_package") controllers_file = LaunchConfiguration("controllers_file") + initial_positions_file = LaunchConfiguration("initial_positions_file") description_package = LaunchConfiguration("description_package") description_file = LaunchConfiguration("description_file") + description_file = LaunchConfiguration("description_file") prefix = LaunchConfiguration("prefix") start_joint_controller = LaunchConfiguration("start_joint_controller") initial_joint_controller = LaunchConfiguration("initial_joint_controller") @@ -65,6 +67,10 @@ def launch_setup(context, *args, **kwargs): [FindPackageShare(runtime_config_package), "config", controllers_file] ) + initial_positions_file_abs = PathJoinSubstitution( + [FindPackageShare(runtime_config_package), "config", initial_positions_file] + ) + rviz_config_file = PathJoinSubstitution( [FindPackageShare(description_package), "rviz", "view_robot.rviz"] ) @@ -99,6 +105,9 @@ def launch_setup(context, *args, **kwargs): " ", "simulation_controllers:=", initial_joint_controllers, + " ", + "initial_positions_file:=", + initial_positions_file_abs, ] ) robot_description = {"robot_description": robot_description_content} @@ -228,6 +237,19 @@ def generate_launch_description(): description="YAML file with the controllers configuration.", ) ) + declared_arguments.append( + DeclareLaunchArgument( + "initial_positions_file", + default_value=PathJoinSubstitution( + [ + FindPackageShare("ur_description"), + "config", + "initial_positions.yaml", + ] + ), + description="YAML file (absolute path) with the robot's initial joint positions.", + ) + ) declared_arguments.append( DeclareLaunchArgument( "description_package",