WPILibC++ 2023.4.3-108-ge5452e3
frc::DifferentialDriveWheelSpeeds Struct Reference

Represents the wheel speeds for a differential drive drivetrain. More...

#include <frc/kinematics/DifferentialDriveWheelSpeeds.h>

Public Member Functions

void Desaturate (units::meters_per_second_t attainableMaxSpeed)
 Renormalizes the wheel speeds if either side is above the specified maximum. More...
 

Public Attributes

units::meters_per_second_t left = 0_mps
 Speed of the left side of the robot. More...
 
units::meters_per_second_t right = 0_mps
 Speed of the right side of the robot. More...
 

Detailed Description

Represents the wheel speeds for a differential drive drivetrain.

Member Function Documentation

◆ Desaturate()

void frc::DifferentialDriveWheelSpeeds::Desaturate ( units::meters_per_second_t  attainableMaxSpeed)

Renormalizes the wheel speeds if either side is above the specified maximum.

Sometimes, after inverse kinematics, the requested speed from one or more wheels may be above the max attainable speed for the driving motor on that wheel. To fix this issue, one can reduce all the wheel speeds to make sure that all requested module speeds are at-or-below the absolute threshold, while maintaining the ratio of speeds between wheels.

Parameters
attainableMaxSpeedThe absolute max speed that a wheel can reach.

Member Data Documentation

◆ left

units::meters_per_second_t frc::DifferentialDriveWheelSpeeds::left = 0_mps

Speed of the left side of the robot.

◆ right

units::meters_per_second_t frc::DifferentialDriveWheelSpeeds::right = 0_mps

Speed of the right side of the robot.


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