Skip to content

Mechanics¤

feedbax.mechanics.MechanicsState (Module) ¤

Type of state PyTree operated on by Mechanics instances.

Attributes:

Name Type Description
plant PlantState

The state of the plant.

effector CartesianState

The state of the end effector.

solver PyTree

The state of the Diffrax solver.

feedbax.mechanics.Mechanics (AbstractStagedModel[MechanicsState]) ¤

Discretizes the dynamics of a plant, and iterates along with the plant statics.

Attributes:

Name Type Description
plant AbstractPlant

The plant model.

dt float

The time step duration.

solver AbstractSolver

The Diffrax solver.

intervenors ModelIntervenors[MechanicsState]

The intervenors associated with each stage of the model.

model_spec: OrderedDict[str, ModelStage[Self, MechanicsState]] property ¤

Specifies the stages of the model.

__init__ (plant: AbstractPlant,dt: float,solver_type: Type[dfx.AbstractSolver] = dfx.Euler,intervenors: Optional[ArgIntervenors] = None,*,key: Optional[PRNGKeyArray] = None)
¤

Parameters:

Name Type Description Default
plant AbstractPlant

The plant model.

required
dt float

The time step duration.

required
solver_type Type[AbstractSolver]

The type of Diffrax solver to use.

Euler
intervenors Optional[ArgIntervenors]

The intervenors associated with each stage of the model.

None
init (*,key: PRNGKeyArray)
¤

Returns an initial state for use with the Mechanics module.

dynamics_step (input: PyTree[Array],state: MechanicsState,*,key: Optional[PRNGKeyArray] = None) -> MechanicsState
¤

Return an updated state after a single step of plant dynamics.