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

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

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

Public Member Functions

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

Public Attributes

units::meters_per_second_squared_t left = 0_mps_sq
 Acceleration of the left side of the robot.
units::meters_per_second_squared_t right = 0_mps_sq
 Acceleration of the right side of the robot.

Detailed Description

Represents the wheel accelerations for a differential drive drivetrain.

Member Function Documentation

◆ operator*()

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

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

For example, DifferentialDriveWheelAccelerations{2.0, 2.5} * 2 = DifferentialDriveWheelAccelerations{4.0, 5.0}

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

◆ operator+()

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

◆ operator-() [1/2]

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

Returns the inverse of the current DifferentialDriveWheelAccelerations.

This is equivalent to negating all components of the DifferentialDriveWheelAccelerations.

Returns
The inverse of the current DifferentialDriveWheelAccelerations.

◆ operator-() [2/2]

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

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

For example, DifferentialDriveWheelAccelerations{5.0, 4.0} - DifferentialDriveWheelAccelerations{1.0, 2.0} = DifferentialDriveWheelAccelerations{4.0, 2.0}

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

◆ operator/()

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

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

For example, DifferentialDriveWheelAccelerations{2.0, 2.5} / 2 = DifferentialDriveWheelAccelerations{1.0, 1.25}

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

◆ operator==()

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

Compares two DifferentialDriveWheelAccelerations objects.

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

Member Data Documentation

◆ left

units::meters_per_second_squared_t wpi::math::DifferentialDriveWheelAccelerations::left = 0_mps_sq

Acceleration of the left side of the robot.

◆ right

units::meters_per_second_squared_t wpi::math::DifferentialDriveWheelAccelerations::right = 0_mps_sq

Acceleration of the right side of the robot.


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