Skip to content

Commit

Permalink
Add ability to describe multiple arms using xs_launch (#65)
Browse files Browse the repository at this point in the history
* [xs_modules] Add ability to describe multiple arms

* Fix arg ordering

* Add missing typing to args
  • Loading branch information
lukeschmitt-tr committed Feb 26, 2024
1 parent cecec09 commit 0b66896
Showing 1 changed file with 42 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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,
),
]


Expand Down

0 comments on commit 0b66896

Please sign in to comment.