Skip to content

Commit

Permalink
[MAPLE-681] Add robot_description_package as parameter to driver laun…
Browse files Browse the repository at this point in the history
…ch (#531)

## Change Overview
This allows you to change the pack from where to get the robot description. This allows us to have different configurations of the robot (such as custom payloads)
Makes the (hard) assumption that whatever package you point it to has `{package}/urdf/spot.urdf.xacro` in it.

@tcappellari-bdai @khughes-bdai feel free to agree/disagree with this, but only way I could get extra collision objects in as needed on hardware
  • Loading branch information
llee-bdai authored Dec 2, 2024
1 parent 1bfb5ca commit fe6729e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spot_driver/launch/spot_driver.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def launch_setup(context: LaunchContext, ld: LaunchDescription) -> None:
spot_name = LaunchConfiguration("spot_name").perform(context)
tf_prefix = LaunchConfiguration("tf_prefix").perform(context)
mock_enable = IfCondition(LaunchConfiguration("mock_enable", default="False")).evaluate(context)
robot_description_package = LaunchConfiguration("robot_description_package").perform(context)

# if config_file has been set (and is not the default empty string) and is also not a file, do not launch anything.
config_file_path = config_file.perform(context)
Expand All @@ -35,7 +36,7 @@ def launch_setup(context: LaunchContext, ld: LaunchDescription) -> None:
else:
has_arm = spot_has_arm(config_file_path=config_file.perform(context), spot_name=spot_name)

pkg_share = FindPackageShare("spot_description").find("spot_description")
robot_description_pkg_share = FindPackageShare(robot_description_package).find(robot_description_package)

# Since spot_image_publisher_node is responsible for retrieving and publishing images, disable all image publishing
# in spot_driver.
Expand Down Expand Up @@ -85,7 +86,7 @@ def launch_setup(context: LaunchContext, ld: LaunchDescription) -> None:
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution([pkg_share, "urdf", "spot.urdf.xacro"]),
PathJoinSubstitution([robot_description_pkg_share, "urdf", "spot.urdf.xacro"]),
" ",
"arm:=",
TextSubstitution(text=str(has_arm).lower()),
Expand Down Expand Up @@ -184,6 +185,13 @@ def generate_launch_description() -> launch.LaunchDescription:
description="Choose whether to launch the image publishing nodes from Spot.",
)
)
launch_args.append(
DeclareLaunchArgument(
"robot_description_package",
default_value="spot_description",
description="Package from where the robot model description is. Must have path /urdf/spot.urdf.xacro",
)
)
launch_args += declare_image_publisher_args()
launch_args.append(DeclareLaunchArgument("spot_name", default_value="", description="Name of Spot"))

Expand Down

0 comments on commit fe6729e

Please sign in to comment.