WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
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

constexpr 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.
 
constexpr 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.
 
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.
 

Public Attributes

decltype(1_V/1_mps) m_kVLinear
 
decltype(1_V/1_mps_sq) m_kALinear
 
decltype(1_V/1_mps) m_kVAngular
 
decltype(1_V/1_mps_sq) m_kAAngular
 

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 )
inlineconstexpr

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 )
inlineconstexpr

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.

Member Data Documentation

◆ m_kAAngular

decltype(1_V / 1_mps_sq) frc::DifferentialDriveFeedforward::m_kAAngular

◆ m_kALinear

decltype(1_V / 1_mps_sq) frc::DifferentialDriveFeedforward::m_kALinear

◆ m_kVAngular

decltype(1_V / 1_mps) frc::DifferentialDriveFeedforward::m_kVAngular

◆ m_kVLinear

decltype(1_V / 1_mps) frc::DifferentialDriveFeedforward::m_kVLinear

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