Signature
Usage
Return Value
| Field | Type | Description |
|---|---|---|
position | RefObject<number | Float64Array> | Joint position(s) from data.qpos. Scalar for hinge/slide, Float64Array for ball/free. |
velocity | RefObject<number | Float64Array> | Joint velocity/velocities from data.qvel. Scalar for hinge/slide, Float64Array for ball/free. |
Array Size by Joint Type
| Joint Type | Position Size | Velocity Size |
|---|---|---|
hinge | 1 (scalar) | 1 (scalar) |
slide | 1 (scalar) | 1 (scalar) |
ball | 4 (quaternion) | 3 (angular vel) |
free | 7 (pos + quat) | 6 (lin vel + ang vel) |
Notes
- Returns refs for zero-overhead per-frame reads
- For hinge/slide joints, values are scalars (not arrays)
- For ball/free joints, typed arrays are preallocated once and reused via
.set()each physics frame — no per-frame allocation - For free joints, position is
[x, y, z, qw, qx, qy, qz]