ImplicitModelFollower_1_1

class wpimath.ImplicitModelFollower_1_1(*args, **kwargs)

Bases: pybind11_object

Contains the controller coefficients and logic for an implicit model follower.

Implicit model following lets us design a feedback controller that erases the dynamics of our system and makes it behave like some other system. This can be used to make a drivetrain more controllable during teleop driving by making it behave like a slower or more benign drivetrain.

For more on the underlying math, read appendix B.3 in https://file.tavsys.net/control/controls-engineering-in-frc.pdf.

@tparam States Number of states. @tparam Inputs Number of inputs.

Overloaded function.

  1. __init__(self: wpimath._wpimath.ImplicitModelFollower_1_1, a: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[1, 1]”], b: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[1, 1]”], aref: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[1, 1]”], bref: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[1, 1]”]) -> None

Constructs a controller with the given coefficients and plant.

Parameters:
  • a – Continuous system matrix of the plant being controlled.

  • b – Continuous input matrix of the plant being controlled.

  • aref – Continuous system matrix whose dynamics should be followed.

  • bref – Continuous input matrix whose dynamics should be followed.

  1. __init__(self: wpimath._wpimath.ImplicitModelFollower_1_1, plant: wpimath._wpimath.LinearSystem_1_1_1, plant_ref: wpimath._wpimath.LinearSystem_1_1_1) -> None

  2. __init__(self: wpimath._wpimath.ImplicitModelFollower_1_1, plant: wpimath._wpimath.LinearSystem_1_1_2, plant_ref: wpimath._wpimath.LinearSystem_1_1_2) -> None

  3. __init__(self: wpimath._wpimath.ImplicitModelFollower_1_1, plant: wpimath._wpimath.LinearSystem_1_1_3, plant_ref: wpimath._wpimath.LinearSystem_1_1_3) -> None

calculate(x: Annotated[numpy.typing.ArrayLike, numpy.float64, '[1, 1]'], u: Annotated[numpy.typing.ArrayLike, numpy.float64, '[1, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[1, 1]']

Returns the next output of the controller.

Parameters:
  • x – The current state x.

  • u – The current input for the original model.

reset() None

Resets the controller.

u(*args, **kwargs)

Overloaded function.

  1. u(self: wpimath._wpimath.ImplicitModelFollower_1_1) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[1, 1]”]

Returns the control input vector u.

Returns:

The control input.

  1. u(self: wpimath._wpimath.ImplicitModelFollower_1_1, i: typing.SupportsInt | typing.SupportsIndex) -> float

Returns an element of the control input vector u.

Parameters:

i – Row of u.

Returns:

The row of the control input vector.