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

[MAPLE-681] Add robot_description_package as parameter to driver launch #531

Merged
merged 1 commit into from
Dec 2, 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
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
Loading