diff --git a/interbotix_xs_toolbox/interbotix_xs_modules/interbotix_xs_modules/xs_launch/xs_launch.py b/interbotix_xs_toolbox/interbotix_xs_modules/interbotix_xs_modules/xs_launch/xs_launch.py index 65ed2575..bf56870c 100644 --- a/interbotix_xs_toolbox/interbotix_xs_modules/interbotix_xs_modules/xs_launch/xs_launch.py +++ b/interbotix_xs_toolbox/interbotix_xs_modules/interbotix_xs_modules/xs_launch/xs_launch.py @@ -47,39 +47,53 @@ class DeclareInterbotixXSArmRobotDescriptionLaunchArgument(DeclareLaunchArgument def __init__( self, *, - default_value: Optional[SomeSubstitutionsType] = Command([ - FindExecutable(name='xacro'), ' ', - PathJoinSubstitution([ - FindPackageShare('interbotix_xsarm_descriptions'), - 'urdf', - LaunchConfiguration('robot_model') - ]), '.urdf.xacro ', - 'robot_name:=', LaunchConfiguration('robot_name'), ' ', - 'base_link_frame:=', LaunchConfiguration('base_link_frame'), ' ', - 'use_gripper:=', LaunchConfiguration('use_gripper'), ' ', - 'show_ar_tag:=', LaunchConfiguration('show_ar_tag'), ' ', - 'show_gripper_bar:=', LaunchConfiguration('show_gripper_bar'), ' ', - 'show_gripper_fingers:=', LaunchConfiguration('show_gripper_fingers'), ' ', - 'use_world_frame:=', LaunchConfiguration('use_world_frame'), ' ', - 'external_urdf_loc:=', LaunchConfiguration('external_urdf_loc'), ' ', - 'hardware_type:=', LaunchConfiguration('hardware_type'), ' ', - ]), + robot_description_launch_config_name: Text = 'robot_description', + robot_model_launch_config_name: Text = 'robot_model', + robot_name_launch_config_name: Text = 'robot_name', + default_value: Optional[SomeSubstitutionsType] = None, **kwargs ) -> None: """ Construct the modified DeclareLaunchArgument object. + :param robot_description_launch_config_name: Name of the robot description launch + configuration. This is typically only changed when multiple arms are to be launched. + Defaults to `robot_description` + :param robot_model_launch_config_name: Name of the robot model launch configuration. + This is typically only changed when multiple arms are to be launched. Defaults to + `robot_model` + :param robot_name_launch_config_name: Name of the robot name launch configuration. + This is typically only changed when multiple arms are to be launched. Defaults to + `robot_name` :param default_value: The default model given to the parent DeclareLaunchArgument; if you want to override this value, it must follow the convention in this object's source """ + if default_value is None: + default_value = Command([ + FindExecutable(name='xacro'), ' ', + PathJoinSubstitution([ + FindPackageShare('interbotix_xsarm_descriptions'), + 'urdf', + LaunchConfiguration(robot_model_launch_config_name) + ]), '.urdf.xacro ', + 'robot_name:=', LaunchConfiguration(robot_name_launch_config_name), ' ', + 'base_link_frame:=', LaunchConfiguration('base_link_frame'), ' ', + 'use_gripper:=', LaunchConfiguration('use_gripper'), ' ', + 'show_ar_tag:=', LaunchConfiguration('show_ar_tag'), ' ', + 'show_gripper_bar:=', LaunchConfiguration('show_gripper_bar'), ' ', + 'show_gripper_fingers:=', LaunchConfiguration('show_gripper_fingers'), ' ', + 'use_world_frame:=', LaunchConfiguration('use_world_frame'), ' ', + 'external_urdf_loc:=', LaunchConfiguration('external_urdf_loc'), ' ', + 'hardware_type:=', LaunchConfiguration('hardware_type'), ' ', + ]), super().__init__( - name='robot_description', + name=robot_description_launch_config_name, default_value=default_value, description=( 'URDF of the robot; this is typically generated by the xacro command.' ), choices=None, - **kwargs + **kwargs, ) @@ -242,9 +256,12 @@ def declare_interbotix_xsarm_robot_description_launch_arguments( use_world_frame: Text = 'true', external_urdf_loc: Text = '', hardware_type: Text = 'actual', + robot_description_launch_config_name: Text = 'robot_description', + robot_model_launch_config_name: Text = 'robot_model', + robot_name_launch_config_name: Text = 'robot_name', ) -> List[DeclareLaunchArgument]: """ - Return the `robot_description` DeclareLaunchArgument and its required children. + Return a robot description DeclareLaunchArgument and its required children. DeclareLaunchArgument objects: - `base_link_frame` @@ -338,7 +355,11 @@ def declare_interbotix_xsarm_robot_description_launch_arguments( 'hardware, or hardware simulated in Gazebo.' ), ), - DeclareInterbotixXSArmRobotDescriptionLaunchArgument(), + DeclareInterbotixXSArmRobotDescriptionLaunchArgument( + robot_description_launch_config_name=robot_description_launch_config_name, + robot_model_launch_config_name=robot_model_launch_config_name, + robot_name_launch_config_name=robot_name_launch_config_name, + ), ]