Skip to content

Commit

Permalink
Fix launching without a tf_prefix specified (#1029)
Browse files Browse the repository at this point in the history
* Make test without a tf_prefix actually not specify the tf_prefix to the launchfile

* Revert "Remove tf_prefix from ur_control.launch.py (#1020)"

tf_prefix is used as a substitution argument inside the controllers.yaml

Therefore, it needs to be specified as an argument for the ur_conttrol.launch.py file
  • Loading branch information
fmauch committed Jun 19, 2024
1 parent 597c1c9 commit 901e3a4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
11 changes: 11 additions & 0 deletions ur_robot_driver/launch/ur_control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def launch_setup():
parameters=[
LaunchConfiguration("update_rate_config_file"),
ParameterFile(controllers_file, allow_substs=True),
# We use the tf_prefix as substitution in there, so that's why we keep it as an
# argument for this launchfile
],
output="screen",
)
Expand Down Expand Up @@ -280,6 +282,15 @@ def generate_launch_description():
"publishes the description topic.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"tf_prefix",
default_value="",
description="tf_prefix of the joint names, useful for "
"multi-robot setup. If changed, also joint names in the controllers' configuration "
"have to be updated.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"use_mock_hardware",
Expand Down
25 changes: 14 additions & 11 deletions ur_robot_driver/test/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,23 +307,26 @@ def generate_driver_test_description(
):
ur_type = LaunchConfiguration("ur_type")

launch_arguments = {
"robot_ip": "192.168.56.101",
"ur_type": ur_type,
"launch_rviz": "false",
"controller_spawner_timeout": str(controller_spawner_timeout),
"initial_joint_controller": "scaled_joint_trajectory_controller",
"headless_mode": "true",
"launch_dashboard_client": "false",
"start_joint_controller": "false",
}
if tf_prefix:
launch_arguments["tf_prefix"] = tf_prefix

robot_driver = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
[FindPackageShare("ur_robot_driver"), "launch", "ur_control.launch.py"]
)
),
launch_arguments={
"robot_ip": "192.168.56.101",
"ur_type": ur_type,
"launch_rviz": "false",
"controller_spawner_timeout": str(controller_spawner_timeout),
"initial_joint_controller": "scaled_joint_trajectory_controller",
"headless_mode": "true",
"launch_dashboard_client": "false",
"start_joint_controller": "false",
"tf_prefix": tf_prefix,
}.items(),
launch_arguments=launch_arguments.items(),
)
wait_dashboard_server = ExecuteProcess(
cmd=[
Expand Down

0 comments on commit 901e3a4

Please sign in to comment.