@prototwin/urdf-exporter

1.0.1•Public•Published about 16 hours ago

Tool for exporting robots as ROS 2 description packages containing a URDF file and meshes.

Latest Version: 1.0.1

Size: 10 KB

Publisher: ProtoTwin (contact@prototwin.com)

README.md

URDF Exporter

Exports a robot as a ROS 2 description package, containing a URDF file with its visual and collision meshes.

Exporting a Robot

Right-click the root entity of the robot and select Tools > Export URDF. Choose the file format for the visual meshes, then save the zip file.

  • STL: Supported by all ROS tools. The base color of each material is written to the URDF.
  • GLB: Keeps materials and textures. Supported by RViz 2 and Gazebo.

The robot is exported in its current pose. Exporting while the simulation is stopped uses the initial position of every joint. Exporting while the simulation is paused uses the current joint positions, which are converted so that the URDF is still correct at a joint position of zero.

Package Contents

The package is named after the robot, for example epson_ls10_b803s_description.

  • urdf/<package>.urdf: The robot description.
  • meshes/visual: One mesh for each visible graphics component.
  • meshes/collision: One STL mesh for each convex, mesh or custom collider.
  • launch/display.launch.py: Displays the robot in RViz 2 with robot_state_publisher and joint_state_publisher_gui.
  • package.xml and CMakeLists.txt: Build files for colcon.

Build and display the package:

colcon build --packages-select epson_ls10_b803s_description
source install/setup.bash
ros2 launch epson_ls10_b803s_description display.launch.py

Links and Joints

Every entity of the robot becomes a link with the same name as the entity, connected to the link of its parent entity. The link frames match the entity frames and use the axes of ProtoTwin.

  • Revolute joints: Exported as revolute joints, or as continuous joints when the lower and upper limits are not both enabled. When the joint anchor is not at the origin of the entity, an additional link named <entity> pivot is placed at the anchor.
  • Prismatic joints: Exported as prismatic joints.
  • Fixed joints and entities without a rigid body: Exported as fixed joints.
  • Spherical and path joints: Exported as fixed joints, since URDF does not support them.
  • Transmissions: The output joint of a TransmissionComponent is exported as a mimic joint.
  • Coupled joints: Exported as independent joints measured physically. The limits of a coupled joint apply to its motor position, so they are only approximate in the URDF.

The effort and velocity limits are taken from the motor of each joint. Joints without a name are given one, such as Link_1_joint, which is also written back to the joint, so that the joint states published by JointStatePublisher match the URDF.

Physics

  • Mass: The mass and mass distribution of every dynamic rigid body are exported. When a body has no mass distribution, it is calculated from its collision geometry.
  • Collision: Box and sphere colliders are exported as URDF boxes and spheres. Convex, mesh and custom colliders are exported as STL meshes. Plane colliders are not exported, since URDF does not support infinite planes.

Requirements

The hierarchy of the robot must match its joints:

  • The joint of every rigid body must connect it to the rigid body of its parent entity. A joint to the world is accepted for children of the root entity.
  • Every entity of the robot must have a unique name.

The export stops with an error that describes how to fix the robot when these requirements are not met. Problems that do not prevent the export, such as a rigid body without collision geometry, are reported as warnings in the console.

Changelog

1.0.0

Initial release.

1.0.1

Updated icon.