Planar two-segment limb model (equations of motion)
Source:R/kinetics-forward-dynamics.R
planarLimbModel.RdBuilds the analytic dynamics of a planar two-link limb with distributed
segment mass: the mass matrix M(q), the Coriolis/centrifugal matrix, the
gravity vector, and forward/inverse dynamics. Angles are joint angles
(proximal, then distal relative to the proximal segment), measured so gravity
acts in -y.
Arguments
- mass
Length-2 segment masses (kg).
- length
Length-2 segment lengths (m).
- com
Length-2 distances of each segment centre of mass from its proximal joint (m); default
length / 2.- inertia
Length-2 segment moments of inertia about the CoM (kg m^2); default the thin-rod
mass * length^2 / 12.- g
Gravitational acceleration (m/s^2, default 9.81; use 0 for a horizontal-plane / no-gravity model).
Value
a planar_limb_model: functions M(q), coriolis(q, qd) (matrix),
gravity(q), forward_accel(q, qd, tau), inverse_dynamics(q, qd, qdd),
energy(q, qd) (kinetic, potential, total), and ndof = 2.