Skip to content

Clarify different ur type #14

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

Merged
merged 2 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
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: 12 additions & 0 deletions my_robot_cell/doc/start_ur_driver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,15 @@ Or to use it with a real robot:

#start the driver with real hardware
ros2 launch my_robot_cell_control start_robot.launch.py

.. note::
We extracted the calibration information from the robot and saved it in the
``my_robot_cell_control`` package. If you have a different robot, you need to extract the
calibration information from that, and pass that to the launch file. Changing the ``ur_type``
parameter only will lead to a wrong model, as it will still be using the example kinematics from
a UR20. To use a UR5e, for example, you can do

.. code-block:: bash

ros2 launch my_robot_cell_control start_robot.launch.py ur_type:=ur5e use_mock_hardware:=true \
kinematics_parameters_file:=$(ros2 pkg prefix ur_description)/share/ur_description/config/ur5e/default_kinematics.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
from launch import LaunchDescription
from launch.substitutions import Command, PathJoinSubstitution
from launch.actions import DeclareLaunchArgument
from launch.substitutions import Command, PathJoinSubstitution, LaunchConfiguration

from launch_ros.actions import Node
from launch_ros.parameter_descriptions import ParameterValue
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():
ur_type = LaunchConfiguration("ur_type")
description_package = FindPackageShare("my_robot_cell_description")
description_file = PathJoinSubstitution(
[description_package, "urdf", "my_robot_cell.urdf.xacro"]
)
rvizconfig_file = PathJoinSubstitution([description_package, "rviz", "urdf.rviz"])

robot_description = ParameterValue(
Command(["xacro ", description_file, " ", "ur_type:=", "ur20"]), value_type=str
Command(["xacro ", description_file, " ", "ur_type:=", ur_type]), value_type=str
)

robot_state_publisher_node = Node(
Expand All @@ -36,6 +38,30 @@ def generate_launch_description():
arguments=["-d", rvizconfig_file],
)

declared_arguments = [
DeclareLaunchArgument(
"ur_type",
description="Typo/series of used UR robot.",
choices=[
"ur3",
"ur3e",
"ur5",
"ur5e",
"ur10",
"ur10e",
"ur16e",
"ur20",
"ur30",
],
default_value="ur20",
)
]

return LaunchDescription(
[joint_state_publisher_gui_node, robot_state_publisher_node, rviz_node]
declared_arguments
+ [
joint_state_publisher_gui_node,
robot_state_publisher_node,
rviz_node,
]
)