newton.controllers.ControllerBase#
- class newton.controllers.ControllerBase[source]#
Bases:
ABC,Generic[InputT,OutputT]Abstract interface for a single Newton control law.
Every concrete control law (joint impedance, differential IK, …) subclasses
ControllerBasedirectly. There is no framework-level composition: users who want to combine multiple control laws call each one’sstep()in sequence themselves.Subclasses are responsible for:
is_graphable(): predicate the user can query to decide whether graph capture is possible.input(),output(): allocate fresh typed input/output structs. Baked-in arrays (gains passed as awp.arrayat construction) are stored on the controller and do not appear on the input struct.step(): read the input struct’s live arrays, run kernels, write the output struct’s live arrays. Writes are slot-replacing (=, not+=); composing laws is the user’s job.
- abstractmethod input()#
Allocate a fresh input struct with zero-initialised arrays.
The user typically reassigns fields to point at live data buffers. Fields for disabled features are
None.
- abstractmethod output()#
Allocate a fresh output struct.