Shortcuts

pypose.module.System

class pypose.module.System[source]

The base class for a system dynamics model.

In most of the cases, users only need to subclass a specific dynamic system, such as linear time invariant system LTI(), Linear Time-Variant LTV(), and a non-linear system NLS().

forward(state, input)[source]

Defines the computation performed at every call that advances the system by one time step.

Note

The forward method implicitly increments the time step via forward_hook. state_transition and observation still accept time for the flexiblity such as time-varying system. One can directly access the current system time via the property systime or _t.

Note

To introduce noise in a model, redefine this method via subclassing. See example in examples/module/ekf/tank_robot.py.

forward_hook(module, inputs, outputs)[source]

Automatically advances the time step.

observation(state, input, t=None)[source]
Parameters:
  • state (Tensor) – The state of the dynamical system

  • input (Tensor) – The input to the dynamical system

  • t (Tensor) – The time step of the dynamical system. Default: None.

Returns:

The observation of the system at the current step

Return type:

Tensor

Note

The users need to define this method and can access the current system time via the property systime. Don’t introduce system transision noise in this function, as it will be used for linearizing the system automaticalluy.

set_refpoint(state=None, input=None, t=None)[source]

Function to set the reference point for linearization.

Parameters:
  • state (Tensor) – The reference state of the dynamical system. If None, the the most recent state is taken. Default: None.

  • input (Tensor) – The reference input to the dynamical system. If None, the the most recent input is taken. Default: None.

  • t (Tensor) – The reference time step of the dynamical system. If None, the the most recent timestamp is taken. Default: None.

Returns:

The self module.

Warning

For nonlinear systems, the users have to call this function before getting the linearized system.

state_transition(state, input, t=None)[source]
Parameters:
  • state (Tensor) – The state of the dynamical system

  • input (Tensor) – The input to the dynamical system

  • t (Tensor) – The time step of the dynamical system. Default: None.

Returns:

The state of the system at next time step

Return type:

Tensor

Note

The users need to define this method and can access the current time via the property systime. Don’t introduce system transision noise in this function, as it will be used for linearizing the system automaticalluy.

property systime

System time, automatically advanced by forward_hook.

Docs

Access documentation for PyPose

View Docs

Tutorials

Get started with tutorials and examples

View Tutorials

Get Started

Find resources and how to start using pypose

View Resources