Skip to main content

Module rigid

Module rigid 

Source
Expand description

Rigid bodies in a serial chain: read from a URDF file, with their dynamics by the recursive Newton-Euler algorithm (Luh, Walker and Paul 1980; Craig, “Introduction to Robotics”, chapter 6). A chain of revolute and prismatic joints on a fixed base; fixed joints are merged into the body before them.

The URDF subset read: <robot> with <link> (its <inertial>: <origin xyz rpy>, <mass value>, <inertia ixx ixy ixz iyy iyz izz>) and <joint type="revolute|continuous|prismatic|fixed"> (<parent link>, <child link>, <origin xyz rpy>, <axis xyz>, <limit lower upper>). Visuals, collisions, meshes, transmissions, Gazebo tags and comments are skipped. No xacro: run xacro first. The links must form one chain from the root (no branches).

Structs§

Body
One moving joint and the body it carries.
BodyState
A body of a chain as it moves (Chain::body_states), in the base frame: its inertial (the payload merged into the last), its frame’s rotation and origin, its joint’s axis, its centre of mass and that centre’s velocity, and its angular velocity.
Chain
A serial chain on a fixed base, z up in the base frame.
Inertial
Mass, centre of mass and inertia about it, in a body’s frame.

Functions§

about
Rotation by angle about the unit vector k (Rodrigues).
add
cross
dot
exp
The rotation of a rotation vector.
from_quaternion
The rotation vector of a unit quaternion, the angle up to pi (q and -q are the same rotation).
log
The rotation vector (axis times angle, angle up to pi) of a rotation matrix.
matmul
mul
quaternion
The unit quaternion (w, x, y, z) of a rotation vector.
rpy
URDF’s roll-pitch-yaw: R = Rz(yaw) Ry(pitch) Rx(roll).
slerp
Spherical linear interpolation of two orientations given as rotation vectors: the turn from a to b about one fixed axis, the shorter way, s of it done (Shoemake 1985). As a rotation vector.
slerp_rates
The rotation vector of slerp(a, b, s) and its first and second derivative by s, in closed form. The slerp turns at the constant angular velocity w = log(q_b q_a*) in space, so the rotation vector r has r’ = J^-1 w with the inverse left Jacobian J^-1 = I - [r]/2 + c [r]^2 (c = 1/theta^2 - cot(theta/2) / (2 theta), theta = |r|), and r’’ follows by differentiating that along r’. Valid past the slerp’s ends too, short of theta = 2 pi.
transpose

Type Aliases§

Frames
Each joint’s frame in the base frame: rotation and position.
M3
V3