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

Represents the accelerations of one swerve module. More...

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

Public Member Functions

constexpr bool operator== (const SwerveModuleAcceleration &other) const
 Checks equality between this SwerveModuleAccelerations and another object.
SwerveModuleAcceleration operator+ (const SwerveModuleAcceleration &other) const
 Adds two SwerveModuleAccelerations and returns the sum.
SwerveModuleAcceleration operator- (const SwerveModuleAcceleration &other) const
 Subtracts the other SwerveModuleAccelerations from the current SwerveModuleAccelerations and returns the difference.
constexpr SwerveModuleAcceleration operator- () const
 Returns the inverse of the current SwerveModuleAccelerations.
constexpr SwerveModuleAcceleration operator* (double scalar) const
 Multiplies the SwerveModuleAccelerations by a scalar and returns the new SwerveModuleAccelerations.
constexpr SwerveModuleAcceleration operator/ (double scalar) const
 Divides the SwerveModuleAccelerations by a scalar and returns the new SwerveModuleAccelerations.

Public Attributes

units::meters_per_second_squared_t acceleration = 0_mps_sq
 Acceleration of the wheel of the module.
Rotation2d angle
 Angle of the acceleration vector.

Detailed Description

Represents the accelerations of one swerve module.

Member Function Documentation

◆ operator*()

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

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

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

◆ operator+()

SwerveModuleAcceleration wpi::math::SwerveModuleAcceleration::operator+ ( const SwerveModuleAcceleration & other) const
inline

Adds two SwerveModuleAccelerations and returns the sum.

Note: This performs vector addition of the accelerations.

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

◆ operator-() [1/2]

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

Returns the inverse of the current SwerveModuleAccelerations.

This is equivalent to rotating the acceleration by pi (or 180 degrees).

Returns
The inverse of the current SwerveModuleAccelerations.

◆ operator-() [2/2]

SwerveModuleAcceleration wpi::math::SwerveModuleAcceleration::operator- ( const SwerveModuleAcceleration & other) const
inline

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

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

◆ operator/()

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

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

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

◆ operator==()

bool wpi::math::SwerveModuleAcceleration::operator== ( const SwerveModuleAcceleration & other) const
inlineconstexpr

Checks equality between this SwerveModuleAccelerations and another object.

Parameters
otherThe other object.
Returns
Whether the two objects are equal.

Member Data Documentation

◆ acceleration

units::meters_per_second_squared_t wpi::math::SwerveModuleAcceleration::acceleration = 0_mps_sq

Acceleration of the wheel of the module.

◆ angle

Rotation2d wpi::math::SwerveModuleAcceleration::angle

Angle of the acceleration vector.


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