WPILibC++ 2023.4.3
frc::DifferentialDriveFeedforward Class Reference

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

#include <frc/controller/DifferentialDriveFeedforward.h>

Public Member Functions

 DifferentialDriveFeedforward (decltype(1_V/1_mps) kVLinear, decltype(1_V/1_mps_sq) kALinear, decltype(1_V/1_rad_per_s) kVAngular, decltype(1_V/1_rad_per_s_sq) kAAngular, units::meter_t trackwidth)
 Creates a new DifferentialDriveFeedforward with the specified parameters. More...
 
 DifferentialDriveFeedforward (decltype(1_V/1_mps) kVLinear, decltype(1_V/1_mps_sq) kALinear, decltype(1_V/1_mps) kVAngular, decltype(1_V/1_mps_sq) kAAngular)
 Creates a new DifferentialDriveFeedforward with the specified parameters. More...
 
DifferentialDriveWheelVoltages Calculate (units::meters_per_second_t currentLeftVelocity, units::meters_per_second_t nextLeftVelocity, units::meters_per_second_t currentRightVelocity, units::meters_per_second_t nextRightVelocity, units::second_t dt)
 Calculates the differential drive feedforward inputs given velocity setpoints. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ DifferentialDriveFeedforward() [1/2]

frc::DifferentialDriveFeedforward::DifferentialDriveFeedforward ( decltype(1_V/1_mps)  kVLinear,
decltype(1_V/1_mps_sq)  kALinear,
decltype(1_V/1_rad_per_s)  kVAngular,
decltype(1_V/1_rad_per_s_sq)  kAAngular,
units::meter_t  trackwidth 
)

Creates a new DifferentialDriveFeedforward with the specified parameters.

Parameters
kVLinearThe linear velocity gain in volts per (meters per second).
kALinearThe linear acceleration gain in volts per (meters per second squared).
kVAngularThe angular velocity gain in volts per (radians per second).
kAAngularThe angular acceleration gain in volts per (radians per second squared).
trackwidthThe distance between the differential drive's left and right wheels, in meters.

◆ DifferentialDriveFeedforward() [2/2]

frc::DifferentialDriveFeedforward::DifferentialDriveFeedforward ( decltype(1_V/1_mps)  kVLinear,
decltype(1_V/1_mps_sq)  kALinear,
decltype(1_V/1_mps)  kVAngular,
decltype(1_V/1_mps_sq)  kAAngular 
)

Creates a new DifferentialDriveFeedforward with the specified parameters.

Parameters
kVLinearThe linear velocity gain in volts per (meters per second).
kALinearThe linear acceleration gain in volts per (meters per second squared).
kVAngularThe angular velocity gain in volts per (meters per second).
kAAngularThe angular acceleration gain in volts per (meters per second squared).

Member Function Documentation

◆ Calculate()

DifferentialDriveWheelVoltages frc::DifferentialDriveFeedforward::Calculate ( units::meters_per_second_t  currentLeftVelocity,
units::meters_per_second_t  nextLeftVelocity,
units::meters_per_second_t  currentRightVelocity,
units::meters_per_second_t  nextRightVelocity,
units::second_t  dt 
)

Calculates the differential drive feedforward inputs given velocity setpoints.

Parameters
currentLeftVelocityThe current left velocity of the differential drive in meters/second.
nextLeftVelocityThe next left velocity of the differential drive in meters/second.
currentRightVelocityThe current right velocity of the differential drive in meters/second.
nextRightVelocityThe next right velocity of the differential drive in meters/second.
dtDiscretization timestep.

The documentation for this class was generated from the following file: