Get Visual Model
SUMMARY
Get Visual Model returns the pinocchio.GeometryModel populated from the URDF's <visual> tags.
The Skill
python
visual_model = robot.get_visual_model()The Code
python
"""
Read the Pinocchio visual geometry model.
Supports Universal Robots (UR), Epson, and virtual.
Usage:
python get_visual_model.py
"""
from loguru import logger
from telekinesis.synapse.robots.manipulators import universal_robots
def main():
"""Read the Pinocchio visual geometry model and log a summary."""
#===================== Create Robot ==========================================
robot = universal_robots.UniversalRobotsUR10E(name='UR10e')
# ==================== Run Skill ============================================
visual_model = robot.get_visual_model()
logger.info(f"Number of visual geometries: {len(visual_model.geometryObjects)}")
for geom in visual_model.geometryObjects:
logger.info(f" - {geom.name}")
if __name__ == "__main__":
main()Parameter Configuration
This skill takes no input parameters.
Returns
| Type | Description |
|---|---|
pinocchio.GeometryModel | Visual GeometryModel built from the URDF's <visual> declarations. Built lazily on first access and cached on the robot. |
Raises
| Exception | Condition |
|---|---|
ImportError | pinocchio is not installed, raised on the first call that needs to build the model |
Where to Use the Skill
- Pinocchio-native visualizers - Hand the visual model to any visualizer that expects a
GeometryModel. - Custom rendering - Drive any renderer that consumes Pinocchio geometry objects.
- Companion to Get Model and Get Collision Model when a library expects the full
(model, collision_model, visual_model)triple.
When Not to Use the Skill
- You use a raw-array visualizer - prefer Get Visual Meshes Data + Get Visual Mesh Transforms, which return NumPy arrays directly.
- You need collision geometries - call Get Collision Model instead.
- Pinocchio is not installed - the first call raises
ImportError.