WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::math::MecanumDriveWheelAccelerations Struct Reference

Represents the wheel accelerations for a mecanum drive drivetrain. More...

#include <wpi/math/kinematics/MecanumDriveWheelAccelerations.hpp>

Public Member Functions

constexpr MecanumDriveWheelAccelerations operator+ (const MecanumDriveWheelAccelerations &other) const
 Adds two MecanumDriveWheelAccelerations and returns the sum.
constexpr MecanumDriveWheelAccelerations operator- (const MecanumDriveWheelAccelerations &other) const
 Subtracts the other MecanumDriveWheelAccelerations from the current MecanumDriveWheelAccelerations and returns the difference.
constexpr MecanumDriveWheelAccelerations operator- () const
 Returns the inverse of the current MecanumDriveWheelAccelerations.
constexpr MecanumDriveWheelAccelerations operator* (double scalar) const
 Multiplies the MecanumDriveWheelAccelerations by a scalar and returns the new MecanumDriveWheelAccelerations.
constexpr MecanumDriveWheelAccelerations operator/ (double scalar) const
 Divides the MecanumDriveWheelAccelerations by a scalar and returns the new MecanumDriveWheelAccelerations.
constexpr bool operator== (const MecanumDriveWheelAccelerations &other) const =default
 Compares two MecanumDriveWheelAccelerations objects.

Public Attributes

units::meters_per_second_squared_t frontLeft = 0_mps_sq
 Acceleration of the front-left wheel.
units::meters_per_second_squared_t frontRight = 0_mps_sq
 Acceleration of the front-right wheel.
units::meters_per_second_squared_t rearLeft = 0_mps_sq
 Acceleration of the rear-left wheel.
units::meters_per_second_squared_t rearRight = 0_mps_sq
 Acceleration of the rear-right wheel.

Detailed Description

Represents the wheel accelerations for a mecanum drive drivetrain.

Member Function Documentation

◆ operator*()

MecanumDriveWheelAccelerations wpi::math::MecanumDriveWheelAccelerations::operator* ( double scalar) const
inlineconstexpr

Multiplies the MecanumDriveWheelAccelerations by a scalar and returns the new MecanumDriveWheelAccelerations.

For example, MecanumDriveWheelAccelerations{2.0, 2.5, 3.0, 3.5} * 2 = MecanumDriveWheelAccelerations{4.0, 5.0, 6.0, 7.0}

Parameters
scalarThe scalar to multiply by.
Returns
The scaled MecanumDriveWheelAccelerations.

◆ operator+()

MecanumDriveWheelAccelerations wpi::math::MecanumDriveWheelAccelerations::operator+ ( const MecanumDriveWheelAccelerations & other) const
inlineconstexpr

Adds two MecanumDriveWheelAccelerations and returns the sum.

For example, MecanumDriveWheelAccelerations{1.0, 0.5, 2.0, 1.5} + MecanumDriveWheelAccelerations{2.0, 1.5, 0.5, 1.0} = MecanumDriveWheelAccelerations{3.0, 2.0, 2.5, 2.5}

Parameters
otherThe MecanumDriveWheelAccelerations to add.
Returns
The sum of the MecanumDriveWheelAccelerations.

◆ operator-() [1/2]

MecanumDriveWheelAccelerations wpi::math::MecanumDriveWheelAccelerations::operator- ( ) const
inlineconstexpr

Returns the inverse of the current MecanumDriveWheelAccelerations.

This is equivalent to negating all components of the MecanumDriveWheelAccelerations.

Returns
The inverse of the current MecanumDriveWheelAccelerations.

◆ operator-() [2/2]

MecanumDriveWheelAccelerations wpi::math::MecanumDriveWheelAccelerations::operator- ( const MecanumDriveWheelAccelerations & other) const
inlineconstexpr

Subtracts the other MecanumDriveWheelAccelerations from the current MecanumDriveWheelAccelerations and returns the difference.

For example, MecanumDriveWheelAccelerations{5.0, 4.0, 6.0, 2.5} - MecanumDriveWheelAccelerations{1.0, 2.0, 3.0, 0.5} = MecanumDriveWheelAccelerations{4.0, 2.0, 3.0, 2.0}

Parameters
otherThe MecanumDriveWheelAccelerations to subtract.
Returns
The difference between the two MecanumDriveWheelAccelerations.

◆ operator/()

MecanumDriveWheelAccelerations wpi::math::MecanumDriveWheelAccelerations::operator/ ( double scalar) const
inlineconstexpr

Divides the MecanumDriveWheelAccelerations by a scalar and returns the new MecanumDriveWheelAccelerations.

For example, MecanumDriveWheelAccelerations{2.0, 2.5, 1.5, 1.0} / 2 = MecanumDriveWheelAccelerations{1.0, 1.25, 0.75, 0.5}

Parameters
scalarThe scalar to divide by.
Returns
The scaled MecanumDriveWheelAccelerations.

◆ operator==()

bool wpi::math::MecanumDriveWheelAccelerations::operator== ( const MecanumDriveWheelAccelerations & other) const
constexprdefault

Compares two MecanumDriveWheelAccelerations objects.

Parameters
otherThe other MecanumDriveWheelAccelerations.
Returns
True if the MecanumDriveWheelAccelerations are equal.

Member Data Documentation

◆ frontLeft

units::meters_per_second_squared_t wpi::math::MecanumDriveWheelAccelerations::frontLeft = 0_mps_sq

Acceleration of the front-left wheel.

◆ frontRight

units::meters_per_second_squared_t wpi::math::MecanumDriveWheelAccelerations::frontRight = 0_mps_sq

Acceleration of the front-right wheel.

◆ rearLeft

units::meters_per_second_squared_t wpi::math::MecanumDriveWheelAccelerations::rearLeft = 0_mps_sq

Acceleration of the rear-left wheel.

◆ rearRight

units::meters_per_second_squared_t wpi::math::MecanumDriveWheelAccelerations::rearRight = 0_mps_sq

Acceleration of the rear-right wheel.


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