trusty.rods¶
Discrete elastic rods.
RodDiscretization
¶
Bases: Enum
RodMaterial
¶
add_rod
¶
add_rod(
world: World,
X: ndarray[float64, (N, M)],
material: RodMaterial,
*,
friction_mu: float = 0.0,
) -> int
Add a polyline rod body (X is (num_verts, 3) in order). Multiple add_rod calls create multiple rods in one simulation. friction_mu is the body's surface Coulomb coefficient (>= 0); 0 is frictionless.
add_rod_muscle
¶
add_rod_muscle(
world: World,
body: int,
path_vertices: Sequence[int],
f_max: float,
l_opt: float,
l_tendon_slack: float,
pennation: float = 0.0,
activation: float = 0.0,
) -> int
Add a Hill-type muscle on the arc length of a rod's path_vertices (ordered local indices). Returns the muscle entity for rods.set_muscle_activation / rods.muscle_{length,force}.
set_muscle_activation
¶
Set a rod muscle's activation in [0, 1]. Held until changed; takes effect on the next step.
muscle_activation
¶
Current activation of a rod muscle.
muscle_length
¶
Muscle path length (m) from the accepted state; its rest path length before the first step.
muscle_force
¶
Hill tension (N) along the muscle at its published length; zero before the first step.