Skip to content

Commit 901e3a4

Browse files
author
Felix Exner (fexner)
authored
Fix launching without a tf_prefix specified (#1029)
* 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
1 parent 597c1c9 commit 901e3a4

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

ur_robot_driver/launch/ur_control.launch.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def launch_setup():
6868
parameters=[
6969
LaunchConfiguration("update_rate_config_file"),
7070
ParameterFile(controllers_file, allow_substs=True),
71+
# We use the tf_prefix as substitution in there, so that's why we keep it as an
72+
# argument for this launchfile
7173
],
7274
output="screen",
7375
)
@@ -280,6 +282,15 @@ def generate_launch_description():
280282
"publishes the description topic.",
281283
)
282284
)
285+
declared_arguments.append(
286+
DeclareLaunchArgument(
287+
"tf_prefix",
288+
default_value="",
289+
description="tf_prefix of the joint names, useful for "
290+
"multi-robot setup. If changed, also joint names in the controllers' configuration "
291+
"have to be updated.",
292+
)
293+
)
283294
declared_arguments.append(
284295
DeclareLaunchArgument(
285296
"use_mock_hardware",

ur_robot_driver/test/test_common.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -307,23 +307,26 @@ def generate_driver_test_description(
307307
):
308308
ur_type = LaunchConfiguration("ur_type")
309309

310+
launch_arguments = {
311+
"robot_ip": "192.168.56.101",
312+
"ur_type": ur_type,
313+
"launch_rviz": "false",
314+
"controller_spawner_timeout": str(controller_spawner_timeout),
315+
"initial_joint_controller": "scaled_joint_trajectory_controller",
316+
"headless_mode": "true",
317+
"launch_dashboard_client": "false",
318+
"start_joint_controller": "false",
319+
}
320+
if tf_prefix:
321+
launch_arguments["tf_prefix"] = tf_prefix
322+
310323
robot_driver = IncludeLaunchDescription(
311324
PythonLaunchDescriptionSource(
312325
PathJoinSubstitution(
313326
[FindPackageShare("ur_robot_driver"), "launch", "ur_control.launch.py"]
314327
)
315328
),
316-
launch_arguments={
317-
"robot_ip": "192.168.56.101",
318-
"ur_type": ur_type,
319-
"launch_rviz": "false",
320-
"controller_spawner_timeout": str(controller_spawner_timeout),
321-
"initial_joint_controller": "scaled_joint_trajectory_controller",
322-
"headless_mode": "true",
323-
"launch_dashboard_client": "false",
324-
"start_joint_controller": "false",
325-
"tf_prefix": tf_prefix,
326-
}.items(),
329+
launch_arguments=launch_arguments.items(),
327330
)
328331
wait_dashboard_server = ExecuteProcess(
329332
cmd=[

0 commit comments

Comments
 (0)