upkie  13.2.0
Open-source wheeled biped robots

◆ compute_crouching_posture()

Dict[str, float] compute_crouching_posture (   self,
float   crouching_height 
)

Compute hip and knee angles to crouch by a given height.

The legs follow the inverse kinematics of a symmetric leg with segment length \(\ell\) (leg_segment_length): crouching by \(c\) brings the hip-to-axle distance from \(2 \ell\) down to \(h = 2 \ell - c\), with hip angle \(q_1 = \arccos(h / 2 \ell)\) and knee angle \(q_2 = -2 q_1\) for the left leg. The wheel axles stay right below the hips while the knees, hence the center of mass, move forward.

Parameters
crouching_heightCrouching height \(c\), in meters.
Returns
Angles of the hip and knee joints, in radians, by joint name. The right leg mirrors the left leg.
Exceptions
ModelErrorIf the crouching height is negative or not below \(2 \ell\).