WPILibC++ 2023.4.3-108-ge5452e3
MecanumDriveWheelSpeeds.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <wpi/SymbolExports.h>
8
9#include "units/velocity.h"
10
11namespace frc {
12/**
13 * Represents the wheel speeds for a mecanum drive drivetrain.
14 */
16 /**
17 * Speed of the front-left wheel.
18 */
19 units::meters_per_second_t frontLeft = 0_mps;
20
21 /**
22 * Speed of the front-right wheel.
23 */
24 units::meters_per_second_t frontRight = 0_mps;
25
26 /**
27 * Speed of the rear-left wheel.
28 */
29 units::meters_per_second_t rearLeft = 0_mps;
30
31 /**
32 * Speed of the rear-right wheel.
33 */
34 units::meters_per_second_t rearRight = 0_mps;
35
36 /**
37 * Renormalizes the wheel speeds if any individual speed is above the
38 * specified maximum.
39 *
40 * Sometimes, after inverse kinematics, the requested speed from one or
41 * more wheels may be above the max attainable speed for the driving motor on
42 * that wheel. To fix this issue, one can reduce all the wheel speeds to make
43 * sure that all requested module speeds are at-or-below the absolute
44 * threshold, while maintaining the ratio of speeds between wheels.
45 *
46 * @param attainableMaxSpeed The absolute max speed that a wheel can reach.
47 */
48 void Desaturate(units::meters_per_second_t attainableMaxSpeed);
49};
50} // namespace frc
#define WPILIB_DLLEXPORT
Definition: SymbolExports.h:36
Definition: AprilTagPoseEstimator.h:15
Represents the wheel speeds for a mecanum drive drivetrain.
Definition: MecanumDriveWheelSpeeds.h:15
void Desaturate(units::meters_per_second_t attainableMaxSpeed)
Renormalizes the wheel speeds if any individual speed is above the specified maximum.