PTU - 2-DOF pan-tilt unit¶
Kinematic chain¶
base_plate (box 0.14 × 0.14 × 0.025 m)
└─ pan_joint [revolute Z −π … +π]
pan_link (cylinder r=0.028, l=0.07)
└─ tilt_joint [revolute Y −π/2 … 0]
tilt_link (box 0.09 × 0.05 × 0.05 m)
└─ lens_joint [fixed]
lens (sphere r=0.022)
What this example demonstrates¶
All three geometry primitives (Box, Cylinder, Sphere) used together in one robot description
Deeply chained kinematic tree - four links in a single serial chain
JointDynamics(damping + friction) on both revolute jointsInertial.from_geometry()for every link - no manual inertia calculationrobot.print_tree()- colour-coded ASCII tree output shown below:
Robot: ptu
* link base_plate (box)
|
+-- joint pan_joint [revolute]
| \-- link pan_link (cylinder)
|
| +-- joint tilt_joint [revolute]
| | \-- link tilt_link (box)
| |
| | \-- joint lens_joint [fixed]
| | \-- link lens (sphere)
Running the example¶
python3 examples/ptu.py
Output files are written to examples/ptu/:
File |
Description |
|---|---|
|
URDF robot description |
|
Xacro equivalent |
|
Plain-text kinematic tree |
Quick visualisation: copy
ptu.urdfinto the online URDF viewer for instant validation and 3D preview without any local ROS install.