Articulated Bodies¶
Overview¶
NovaPhy implements the Featherstone articulated body algorithms for efficient simulation of jointed rigid body systems (robots, pendulums, chains, etc.).
Joint Types¶
| Type | DOF | Description |
|---|---|---|
Revolute |
1 | Rotation about a single axis |
Prismatic / Slide |
1 | Translation along a single axis |
Ball |
3 | Spherical joint (3 rotational DOF) |
Fixed |
0 | Rigid attachment |
Free |
6 | Unconstrained (floating base) |
Featherstone Algorithms¶
Forward Kinematics (FK)¶
Computes body transforms from joint coordinates q:
Inverse Dynamics (RNEA)¶
Computes joint torques required for a given motion:
Mass Matrix (CRBA)¶
Computes the joint-space mass matrix:
Forward Dynamics¶
Computes joint accelerations from applied torques:
Creating Articulated Bodies¶
import numpy as np
import novaphy
art = novaphy.Articulation()
# Define a revolute joint
joint = novaphy.Joint()
joint.type = novaphy.JointType.Revolute
joint.axis = np.array([0, 0, 1])
# Define the link body
body = novaphy.RigidBody.from_box(1.0, np.array([0.1, 0.5, 0.1]))
art.joints = [joint]
art.bodies = [body]
art.build_spatial_inertias()
Using with World (SolverFeatherstone)¶
For full simulation with collision detection, pass multibody_settings to enable the Featherstone pipeline:
builder = novaphy.ModelBuilder()
builder.add_ground_plane(y=0.0)
builder.add_articulation(art)
world = novaphy.World(
builder.build(),
multibody_settings=novaphy.SolverFeatherstoneSettings(),
)
for _ in range(1000):
world.step(1.0 / 120.0)
Spatial Algebra Convention¶
NovaPhy follows the Featherstone convention for 6D spatial vectors:
- Spatial velocity:
[angular_x, angular_y, angular_z, linear_x, linear_y, linear_z] - Spatial force:
[torque_x, torque_y, torque_z, force_x, force_y, force_z]
Free joint generalized coordinates:
- q =
[px, py, pz, qx, qy, qz, qw](7 DOF: position + quaternion) - qd =
[wx, wy, wz, vx, vy, vz](6 DOF: angular + linear velocity)
Demos¶
| Demo | Description |
|---|---|
demo_newtons_cradle_pendulum.py |
Newton's cradle with hinge suspension |
demo_rope.py |
15-link chain released from horizontal |
demo_wrecking_ball.py |
Chain pendulum smashing a box tower |
demo_seesaw.py |
Box dropped onto revolute seesaw |
demo_motor_arm.py |
Motor-driven arm sweeping boxes |
demo_100_robots_multibody.py |
Quadruped grid via Featherstone |
demoSim_ppo_inverted_pendulum.py |
PPO RL control of a pendulum |