robot_model_analyzer is a ROS 2 C++ package that performs analysis on a robot's URDF model using Pinocchio. It retrieves the robot description from the parameter server or a topic, parses the URDF, and runs key computations including:
- Forward kinematics to the end-effector
- Jacobian calculation
- Collision detection
- ✅ Subscribes to
/robot_descriptiontopic (e.g., fromrobot_state_publisher) - ✅ Optionally fetches URDF from the parameter server
- ✅ Saves URDF to disk
- ✅ Parses the URDF using Pinocchio
- ✅ Computes:
- End-effector transform
- Frame Jacobian
- Collision detection between links
- ROS 2 (tested with Humble)
- Pinocchio
- urdf_parser
- ament_index_cpp
Make sure Pinocchio is installed and visible to your C++ build system.
colcon build --packages-select robot_model_analyzer
source install/setup.bashMake sure your robot description is published by robot_state_publisher or another node. Then run:
ros2 run robot_model_analyzer robot_model_analyzerYou can specify the end-effector frame via a parameter:
ros2 run robot_model_analyzer robot_model_analyzer --ros-args -p ee_frame:=<your_ee_frame>If not specified, it defaults to ee_link.
The node logs and prints:
- The transform of the end-effector
- The Jacobian matrix at the end-effector
- Any collisions detected between model links
Example console output:
End-effector transform:
...
Jacobian at end-effector:
...
Collision detected between link1 and link2
- Subscribes to
/robot_descriptiontopic (or gets parameter) - Parses the URDF using
urdf_parser - Saves URDF as
temp.urdfin a local directory - Loads the model using Pinocchio
- Computes:
- Forward kinematics to the specified frame
- Frame Jacobian
- Collision checks between all pairs