DifferentialDriveFeedforward

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

Bases: pybind11_object

A helper class which computes the feedforward outputs for a differential drive drivetrain.

Overloaded function.

  1. __init__(self: wpimath._wpimath.DifferentialDriveFeedforward, v_linear: wpimath.units.volt_seconds_per_meter, a_linear: wpimath.units.volt_seconds_squared_per_meter, v_angular: wpimath.units.volt_seconds_per_radian, a_angular: wpimath.units.volt_seconds_squared_per_radian, trackwidth: wpimath.units.meters) -> None

Creates a new DifferentialDriveFeedforward with the specified parameters.

Parameters:
  • v_linear – The linear velocity gain in volts per (meters per second).

  • a_linear – The linear acceleration gain in volts per (meters per second squared).

  • v_angular – The angular velocity gain in volts per (radians per second).

  • a_angular – The angular acceleration gain in volts per (radians per second squared).

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

  1. __init__(self: wpimath._wpimath.DifferentialDriveFeedforward, v_linear: wpimath.units.volt_seconds_per_meter, a_linear: wpimath.units.volt_seconds_squared_per_meter, v_angular: wpimath.units.volt_seconds_per_meter, a_angular: wpimath.units.volt_seconds_squared_per_meter) -> None

Creates a new DifferentialDriveFeedforward with the specified parameters.

Parameters:
  • v_linear – The linear velocity gain in volts per (meters per second).

  • a_linear – The linear acceleration gain in volts per (meters per second squared).

  • v_angular – The angular velocity gain in volts per (meters per second).

  • a_angular – The angular acceleration gain in volts per (meters per second squared).

WPIStruct = <capsule object "WPyStruct">
calculate(current_left_velocity: wpimath.units.meters_per_second, next_left_velocity: wpimath.units.meters_per_second, current_right_velocity: wpimath.units.meters_per_second, next_right_velocity: wpimath.units.meters_per_second, dt: wpimath.units.seconds) wpimath._wpimath.DifferentialDriveWheelVoltages

Calculates the differential drive feedforward inputs given velocity setpoints.

Parameters:
  • current_left_velocity – The current left velocity of the differential drive in meters/second.

  • next_left_velocity – The next left velocity of the differential drive in meters/second.

  • current_right_velocity – The current right velocity of the differential drive in meters/second.

  • next_right_velocity – The next right velocity of the differential drive in meters/second.

  • dt – Discretization timestep.