Skip to content

Commit fc5f0f6

Browse files
authored
Clarify different ur type (#14)
* my_robot_cell_description: Add ur_type option to view_robot.launch.py * Add a note to the documentation that the kinematics_params_file has to be changed When changing the ur_type.
1 parent 7bbc5d2 commit fc5f0f6

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

my_robot_cell/doc/start_ur_driver.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,15 @@ Or to use it with a real robot:
131131
132132
#start the driver with real hardware
133133
ros2 launch my_robot_cell_control start_robot.launch.py
134+
135+
.. note::
136+
We extracted the calibration information from the robot and saved it in the
137+
``my_robot_cell_control`` package. If you have a different robot, you need to extract the
138+
calibration information from that, and pass that to the launch file. Changing the ``ur_type``
139+
parameter only will lead to a wrong model, as it will still be using the example kinematics from
140+
a UR20. To use a UR5e, for example, you can do
141+
142+
.. code-block:: bash
143+
144+
ros2 launch my_robot_cell_control start_robot.launch.py ur_type:=ur5e use_mock_hardware:=true \
145+
kinematics_parameters_file:=$(ros2 pkg prefix ur_description)/share/ur_description/config/ur5e/default_kinematics.yaml

my_robot_cell/my_robot_cell_description/launch/view_robot.launch.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
from launch import LaunchDescription
2-
from launch.substitutions import Command, PathJoinSubstitution
2+
from launch.actions import DeclareLaunchArgument
3+
from launch.substitutions import Command, PathJoinSubstitution, LaunchConfiguration
34

45
from launch_ros.actions import Node
56
from launch_ros.parameter_descriptions import ParameterValue
67
from launch_ros.substitutions import FindPackageShare
78

89

910
def generate_launch_description():
11+
ur_type = LaunchConfiguration("ur_type")
1012
description_package = FindPackageShare("my_robot_cell_description")
1113
description_file = PathJoinSubstitution(
1214
[description_package, "urdf", "my_robot_cell.urdf.xacro"]
1315
)
1416
rvizconfig_file = PathJoinSubstitution([description_package, "rviz", "urdf.rviz"])
1517

1618
robot_description = ParameterValue(
17-
Command(["xacro ", description_file, " ", "ur_type:=", "ur20"]), value_type=str
19+
Command(["xacro ", description_file, " ", "ur_type:=", ur_type]), value_type=str
1820
)
1921

2022
robot_state_publisher_node = Node(
@@ -36,6 +38,30 @@ def generate_launch_description():
3638
arguments=["-d", rvizconfig_file],
3739
)
3840

41+
declared_arguments = [
42+
DeclareLaunchArgument(
43+
"ur_type",
44+
description="Typo/series of used UR robot.",
45+
choices=[
46+
"ur3",
47+
"ur3e",
48+
"ur5",
49+
"ur5e",
50+
"ur10",
51+
"ur10e",
52+
"ur16e",
53+
"ur20",
54+
"ur30",
55+
],
56+
default_value="ur20",
57+
)
58+
]
59+
3960
return LaunchDescription(
40-
[joint_state_publisher_gui_node, robot_state_publisher_node, rviz_node]
61+
declared_arguments
62+
+ [
63+
joint_state_publisher_gui_node,
64+
robot_state_publisher_node,
65+
rviz_node,
66+
]
4167
)

0 commit comments

Comments
 (0)