Universal Robots ROS 2 Description
repository·rolling·Indexed 43 days ago
https://github.com/universalrobots/universal_robots_ros2_descriptionOfficial ROS 2 description files (URDF/Xacro) and 3D meshes for Universal Robots manipulators. Provides kinematic and visual representations for simulation and visualization tools like RViz, supporting Humble, Jazzy, and Rolling distributions. Includes Xacro macros for robot parameterization, integration with ros2_control, and detailed specifications for robot base frames, flange, and tool0.
What's inside Universal Robots ROS 2 Description
- This repository provides the URDF description files and 3D meshes required to model and visualize Universal Robots manipulators within ROS 2. It is used to provide the kinematic and visual representations of the robots for simulation and visualization tools like RViz.
Understand changes to ros2_control tag in URDF
rollingThe
ur_descriptionpackage no longer automatically adds theros2_controltag to the robot's URDF. This responsibility has moved to the driver or simulation repositories.While the
ros2_controltag is removed from the description package,ur_descriptionstill provides:- Macros for system-independent parts (e.g., joint configurations).
- Examples using
mock_hardwarewith the robot.
Understand the robot base frames (base_link, base, and base_link_inertia)
rollingThe URDF model utilizes three distinct frames at the robot's base to satisfy ROS standards, controller compatibility, and kinematic library requirements. Understanding which one to use is critical for accurate coordinate transformations.
base_link: The root link of the kinematic chain. It followsREP-103, where the forward direction is defined as the direction the arm points in an all-zero joint configuration.base: The frame used by the robot controller (Polyscope 5/X) to represent the Base feature. It shares the same position asbase_linkbut is rotated by 180 degrees around the Z-axis (followingREP-199).- Usage Tip: When performing TF lookups to match the values shown on the teach pendant, use
baseas your reference frame, notbase_link.
- Usage Tip: When performing TF lookups to match the values shown on the teach pendant, use
base_link_inertia: A frame used to hold meshes and inertia data. Because some libraries (like KDL) do not support inertia on the root link, thebase_linkis kept empty, and all mass/geometry properties are attached tobase_link_inertia. This frame has the same rotation asbase.
Kinematic Chain Structure:
base_link ├ base └ base_link_inertia └ shoulder_link └ upper_arm_link └ forearm_link └ wrist_1_link └ wrist_2_link └ wrist_3_link ├ flange └ tool0How to use the ur_macro.xacro for robot descriptions
rollingThe
ur_descriptionpackage uses Xacro macros to provide kinematic and visual descriptions of Universal Robots manipulators. Instead of defining each robot model from scratch, you should include theurdf/ur_macro.xacromacro in your own project. This macro allows you to parameterize the robot using specific configuration files for kinematics, joint limits, physical parameters, and visual meshes.To properly configure a robot, you must pass the paths to four specific configuration files as arguments to the macro:
- Kinematics:
kinematics_params(points to adefault_kinematics.yamlor equivalent). - Joint Limits:
joint_limit_params(points to ajoint_limits.yaml). - Physical Parameters:
physical_params(points to aphysical_parameters.yamlfor simulation tuning like inertia). - Visual Parameters:
visual_params(points to avisual_params.yamlfor mesh selection).
An example of a standalone robot scene can be found in
urdf/ur.urdf.xacro.<!-- Example of how the macro is typically used in an external project --> <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro" /> <xacro:ur_robot kinematics_params="$(find ur_description)/config/ur5e/default_kinematics.yaml" joint_limit_params="$(find ur_description)/config/ur5e/joint_limits.yaml" physical_params="$(find ur_description)/config/ur5e/physical_parameters.yaml" visual_params="$(find ur_description)/config/ur5e/visual_params.yaml" />- Kinematics:
Integrate ur_description with ros2_control
rollingThe package provides macros to help integrate Universal Robots with
ros2_control. While the specific control method (Driver, Gazebo, or Mock) is defined in the respective control repository,ur_descriptionprovides the necessary building blocks:urdf/inc/ur_joint_control.xacro: Macro for describing the joints' control structure (interfaces).urdf/inc/ur_sensors.xacro: Macro for describing the robot's sensors forros2_control.urdf/ros2_control_mock_hardware.xacro: A complete Xacro providing the control description specifically formock_hardware.urdf/ur_mocked.urdf.xacro: An example file combining the kinematic description with the control description for a controlled robot.
Use flange and tool0 for end-effector attachment
rollingWhen attaching custom tools or end-effectors to the robot, choose between the
flangeandtool0frames based on your requirements:flange: The intended frame for attaching custom tool frames or end-effectors. If you are using a gripper'sxacro:macro, you should typically specifyflangeas theparent_frame.tool0: The tool frame as calculated via forward kinematics. In an all-zero tool configuration, this frame is equivalent to the tool frame shown on the control box/teach pendant.
Update visual_parameters.yaml to include 6 DOF mesh offsets
rollingThe URDF now expects mesh offsets to be defined with all 6 degrees of freedom (DOF). The
visual_parameters.yamlfiles must contain the fullmesh_offsetentries for all 6 dimensions.Old
visual_parameters.yamlfiles that do not contain the complete 6-DOF structure will not be accepted by the URDF parser and must be updated.Migrate mesh offsets from physical_parameters to visual_parameters
rollingMesh offsets for the shoulder and elbow, which were previously located in
physical_parameters.yaml, have been moved to thevisual_parameters.yamlfiles.When updating your configuration, ensure that mesh offsets are now defined within the
visual_parameters.yamlcontext.Use launch/view_ur.launch.xml to visualize a robot
rollingThe launch filelaunch/view_ur.launch.xmlprovides an abstraction for quickly visualizing a robot. Instead of manually passing four different configuration file paths, you can use a singleur_typeargument. The launch file uses this argument to automatically resolve the paths to the correcturXXconfiguration directories.Visualize a Universal Robots manipulator
rollingTo visualize a robot model, install this repository into your ROS 2 workspace and use the
ur_descriptionlaunch file. You can specify which robot model to display by passing theur_typeargument to the launch command.Example for a UR5e robot:
ros2 launch ur_description view_ur.launch.xml ur_type:=ur5eTo visualize a different model, replace
ur5ewith the desiredur_type(e.g.,ur3e,ur5,ur10e, etc.).Update physical_parameters.yaml after radius definition removal
rollingIn recent versions of
ur_description, theshoulder_radius: ...and similar joint radius definitions have been removed from thephysical_parameters.yamlfiles. Consequently, the parsing logic for these parameters has also been removed fromurdf/inc/ur_common.xacro.If you are maintaining a modified version of the package, ensure you are not attempting to use old
physical_parameters.yamlfiles with the new parser, as this will cause failures.Check ROS 2 distribution compatibility
rollingThe repository supports multiple ROS 2 distributions. Ensure you are using the correct branch for your installed distribution:
- Humble: Use the
humblebranch. - Jazzy: Use the
jazzybranch. - Rolling: Use the
rollingbranch.
Released packages for these distributions can be found on the ROS index.
- Humble: Use the