DifferentialDriveAccelerationLimiter

class wpimath.controller.DifferentialDriveAccelerationLimiter(*args, **kwargs)

Bases: pybind11_object

Filters the provided voltages to limit a differential drive’s linear and angular acceleration.

The differential drive model can be created via the functions in LinearSystemId.

Overloaded function.

  1. __init__(self: wpimath._controls._controls.controller.DifferentialDriveAccelerationLimiter, system: wpimath._controls._controls.system.LinearSystem_2_2_2, trackwidth: meters, maxLinearAccel: meters_per_second_squared, maxAngularAccel: radians_per_second_squared) -> None

Constructs a DifferentialDriveAccelerationLimiter.

Parameters:
  • system – The differential drive dynamics.

  • trackwidth – The distance between the differential drive’s left and right wheels.

  • maxLinearAccel – The maximum linear acceleration.

  • maxAngularAccel – The maximum angular acceleration.

  1. __init__(self: wpimath._controls._controls.controller.DifferentialDriveAccelerationLimiter, system: wpimath._controls._controls.system.LinearSystem_2_2_2, trackwidth: meters, minLinearAccel: meters_per_second_squared, maxLinearAccel: meters_per_second_squared, maxAngularAccel: radians_per_second_squared) -> None

Constructs a DifferentialDriveAccelerationLimiter.

Parameters:
  • system – The differential drive dynamics.

  • trackwidth – The distance between the differential drive’s left and right wheels.

  • minLinearAccel – The minimum (most negative) linear acceleration.

  • maxLinearAccel – The maximum (most positive) linear acceleration.

  • maxAngularAccel – The maximum angular acceleration. @throws std::invalid_argument if minimum linear acceleration is greater than maximum linear acceleration

calculate(leftVelocity: meters_per_second, rightVelocity: meters_per_second, leftVoltage: volts, rightVoltage: volts) wpimath._controls._controls.controller.DifferentialDriveWheelVoltages

Returns the next voltage pair subject to acceleraiton constraints.

Parameters:
  • leftVelocity – The left wheel velocity.

  • rightVelocity – The right wheel velocity.

  • leftVoltage – The unconstrained left motor voltage.

  • rightVoltage – The unconstrained right motor voltage.

Returns:

The constrained wheel voltages.