Get Model
SUMMARY
Get Model returns the standard pinocchio.Model object built from the robot's URDF.
The Skill
python
model = robot.get_model()The Code
python
"""
Read the Pinocchio kinematic model.
Supports Universal Robots (UR), Epson, and virtual.
Usage:
python get_model.py
"""
from loguru import logger
from telekinesis.synapse.robots.manipulators import universal_robots
def main():
"""Read the Pinocchio kinematic model and log a few summary fields."""
#===================== Create Robot ==========================================
robot = universal_robots.UniversalRobotsUR10E(name='UR10e')
# ==================== Run Skill ============================================
model = robot.get_model()
logger.success(f"Model: {model}")
logger.info(f"Model name: {model.name}")
logger.info(f"nq (configuration dim): {model.nq}")
logger.info(f"nv (velocity dim): {model.nv}")
logger.info(f"Number of joints: {model.njoints}")
logger.info(f"Number of frames: {model.nframes}")
if __name__ == "__main__":
main()Parameter Configuration
This skill takes no input parameters.
Returns
| Type | Description |
|---|---|
pinocchio.Model | The Python Pinocchio kinematic model built from the URDF. Built lazily on first access and cached on the robot. |
Raises
| Exception | Condition |
|---|---|
ImportError | The optional pinocchio package is not installed, raised on the first call that needs to build the model. |
Where to Use the Skill
- Custom rigid-body algorithms - Run any algorithm in
pinocchio(RNEA, CRBA, ABA, centroidal momentum, …) directly against the robot's model. - Research / prototyping - Build new IK or planning algorithms on top of Pinocchio's data structures.
- Third-party integration - Hand the model to libraries that expect a
pinocchio.Modelinstance. - Geometry companions - Pair with Get Collision Model and Get Visual Model for the matching collision and visual
GeometryModels.
When Not to Use the Skill
- A high-level Synapse skill exists - prefer the dedicated skills (Forward Kinematics, Inverse Kinematics, …) for common operations. They wrap unit conventions and TCP frames consistently.
- Pinocchio is not installed - the first call raises
ImportErrorif thepinocchiopackage is missing.