1111
1212from .controllers .base import Controller
1313from .delay import Delay
14- from .dynamics .base import Dynamic
14+ from .clamping .base import Clamping
1515
1616
1717# TODO: replace with a Transmission class that applies gear ratios / linkage
@@ -33,7 +33,7 @@ class ActuatorState:
3333 """Composed state for an Actuator.
3434
3535 Holds the controller state and, if a delay is present, the delay
36- state. Dynamics are stateless.
36+ state. Clamping objects are stateless.
3737 """
3838
3939 controller_state : Any = None
@@ -47,15 +47,15 @@ def reset(self) -> None:
4747
4848
4949class Actuator :
50- """Composed actuator: controller + optional delay + dynamics .
50+ """Composed actuator: controller + optional delay + clamping .
5151
5252 An actuator reads from simulation state/control arrays, computes
53- forces via a controller, applies dynamics (clamping , saturation, etc.),
53+ forces via a controller, applies clamping (force limits , saturation, etc.),
5454 and writes the result to the output array.
5555
56- Delay is handled separately from dynamics because it is the only
56+ Delay is handled separately from clamping because it is the only
5757 pre-controller modifier (it replaces targets with delayed versions).
58- All dynamics are post-controller (they modify forces).
58+ All clamping is post-controller (it bounds forces).
5959
6060 Usage::
6161
@@ -64,7 +64,7 @@ class Actuator:
6464 output_indices=indices,
6565 controller=PDController(kp=kp, kd=kd),
6666 delay=Delay(delay=5),
67- dynamics =[Clamp(max_force=max_f)],
67+ clamping =[Clamp(max_force=max_f)],
6868 )
6969
7070 # Simulation loop
@@ -77,7 +77,7 @@ class Actuator:
7777 for single-output or (N, M) for multi-output actuators.
7878 controller: Controller that computes raw forces.
7979 delay: Optional Delay instance for input delay.
80- dynamics : List of Dynamic objects (post-controller force modifiers ).
80+ clamping : List of Clamping objects (post-controller force bounds ).
8181 state_pos_attr: Attribute on sim_state for positions.
8282 state_vel_attr: Attribute on sim_state for velocities.
8383 control_target_pos_attr: Attribute on sim_control for target positions.
@@ -92,7 +92,7 @@ def __init__(
9292 output_indices : wp .array ,
9393 controller : Controller ,
9494 delay : Delay | None = None ,
95- dynamics : list [Dynamic ] | None = None ,
95+ clamping : list [Clamping ] | None = None ,
9696 state_pos_attr : str = "joint_q" ,
9797 state_vel_attr : str = "joint_qd" ,
9898 control_target_pos_attr : str = "joint_target_pos" ,
@@ -104,7 +104,7 @@ def __init__(
104104 self .output_indices = output_indices
105105 self .controller = controller
106106 self .delay = delay
107- self .dynamics = dynamics or []
107+ self .clamping = clamping or []
108108 self .num_actuators = len (input_indices )
109109
110110 if len (output_indices ) != self .num_actuators :
@@ -128,8 +128,8 @@ def __init__(
128128
129129 controller .set_device (device )
130130 controller .set_indices (input_indices , self ._sequential_indices )
131- for dyn in self .dynamics :
132- dyn .set_device (device )
131+ for clamp in self .clamping :
132+ clamp .set_device (device )
133133 if self .delay is not None :
134134 self .delay .set_indices (self .num_actuators , self ._sequential_indices )
135135
@@ -139,8 +139,8 @@ def SHARED_PARAMS(self) -> set[str]:
139139 params |= self .controller .SHARED_PARAMS
140140 if self .delay is not None :
141141 params |= self .delay .SHARED_PARAMS
142- for d in self .dynamics :
143- params |= d .SHARED_PARAMS
142+ for c in self .clamping :
143+ params |= c .SHARED_PARAMS
144144 return params
145145
146146 def is_stateful (self ) -> bool :
@@ -149,7 +149,7 @@ def is_stateful(self) -> bool:
149149
150150 def is_graphable (self ) -> bool :
151151 """Return True if all components can be captured in a CUDA graph."""
152- return self .controller .is_graphable () and all (d .is_graphable () for d in self .dynamics )
152+ return self .controller .is_graphable () and all (c .is_graphable () for c in self .clamping )
153153
154154 def has_transmission (self ) -> bool :
155155 """Return True if this actuator applies a transmission transform."""
@@ -185,7 +185,7 @@ def step(
185185
186186 1. **Delay** — read delayed targets from buffer.
187187 2. **Controller** — compute raw forces.
188- 3. **Dynamics ** — modify forces and scatter-add to output.
188+ 3. **Clamping ** — bound forces and scatter-add to output.
189189 4. **State updates** — update delay buffer and controller state.
190190
191191 If the delay buffer is still filling, steps 2-3 are skipped
@@ -244,9 +244,9 @@ def step(
244244 dt ,
245245 )
246246
247- # --- 3. Dynamics: modify forces + write output ---
248- for dyn in self .dynamics :
249- dyn .modify_forces (
247+ # --- 3. Clamping: bound forces + write output ---
248+ for clamp in self .clamping :
249+ clamp .modify_forces (
250250 self ._forces , positions , velocities ,
251251 self .input_indices , self .num_actuators ,
252252 )
0 commit comments