Skip to content

Commit ae52e9f

Browse files
committed
Merge branch 'main' into dual_arm_tutorials
2 parents b9434f7 + fc5f0f6 commit ae52e9f

File tree

6 files changed

+55
-6
lines changed

6 files changed

+55
-6
lines changed

my_robot_cell/doc/assemble_urdf.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:github_url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Tutorials/blob/main/my_robot_cell/doc/assemble_urdf.rst
2+
13
Assembling the URDF
24
===================
35

@@ -57,7 +59,7 @@ The workcell macro is defined in the following manner:
5759
.. literalinclude:: ../my_robot_cell_description/urdf/my_robot_cell_macro.xacro
5860
:language: xml
5961
:linenos:
60-
:caption: my_robot_cell_description/urdf/my_robot_cell_macro.urdf.xacro
62+
:caption: my_robot_cell_description/urdf/my_robot_cell_macro.xacro
6163

6264
This macro provides an example of what a custom workcell could resemble. Your workspace will likely
6365
vary from this one. Please feel free to modify this portion of the URDF to match your own setup. In
@@ -72,7 +74,7 @@ macro. In this example, we chose to create a link named **robot_mount**.
7274
:start-at: <link name="robot_mount"/>
7375
:end-at: </joint>
7476
:linenos:
75-
:caption: my_robot_cell_description/urdf/my_robot_cell.urdf.xacro
77+
:caption: my_robot_cell_description/urdf/my_robot_cell_macro.xacro
7678

7779
After that we are finally able to actually **create the robot arm** by calling the macro.
7880

@@ -81,7 +83,7 @@ After that we are finally able to actually **create the robot arm** by calling t
8183
:start-at: <xacro:ur_robot
8284
:end-at: </xacro:ur_robot>
8385
:linenos:
84-
:caption: my_robot_cell_description/urdf/my_robot_cell.urdf.xacro
86+
:caption: my_robot_cell_description/urdf/my_robot_cell_macro.xacro
8587

8688
Note that the **origin** argument is transmitted in a different manner than the other arguments.
8789

my_robot_cell/doc/build_moveit_config.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
:github_url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Tutorials/blob/main/my_robot_cell/doc/build_moveit_config.rst
2+
3+
14
========================
25
Build the MoveIt! config
36
========================

my_robot_cell/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:github_url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Tutorials/blob/main/my_robot_cell/doc/index.rst
2+
13
.. _custom_workcell_tutorial:
24

35
================

my_robot_cell/doc/start_ur_driver.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:github_url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Tutorials/blob/main/my_robot_cell/doc/start_ur_driver.rst
2+
13
=========================
24
Start the ur_robot_driver
35
=========================
@@ -129,3 +131,15 @@ Or to use it with a real robot:
129131
130132
#start the driver with real hardware
131133
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
)

tutorial_index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:github_url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Tutorials/blob/main/tutorial_index.rst
2+
13
##############################
24
Universal Robots ROS tutorials
35
##############################

0 commit comments

Comments
 (0)