Skip to content

Commit

Permalink
Add robot_description_package as param to driver launch
Browse files Browse the repository at this point in the history
  • Loading branch information
llee-bdai committed Nov 26, 2024
1 parent 1bfb5ca commit 6b9297a
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 6b9297a

Please sign in to comment.