Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to describe multiple arms using xs_launch #65

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading