9#include "wpi/units/angular_velocity.hpp"
10#include "wpi/units/velocity.hpp"
30 wpi::units::meters_per_second_t
vx = 0_mps;
35 wpi::units::meters_per_second_t
vy = 0_mps;
40 wpi::units::radians_per_second_t
omega = 0_rad_per_s;
80 auto twist = desiredTransform.
Log();
83 return {twist.dx / dt, twist.dy / dt, twist.dtheta / dt};
101 wpi::units::meter_t{
vy.value()}}
103 return {wpi::units::meters_per_second_t{rotated.X().value()},
104 wpi::units::meters_per_second_t{rotated.Y().value()},
omega};
122 wpi::units::meter_t{
vy.value()}}
124 return {wpi::units::meters_per_second_t{rotated.X().value()},
125 wpi::units::meters_per_second_t{rotated.Y().value()},
omega};
154 return *
this + -other;
177 return {scalar *
vx, scalar *
vy, scalar *
omega};
#define WPILIB_DLLEXPORT
Definition SymbolExports.hpp:36
A rotation in a 2D coordinate frame represented by a point on the unit circle (cosine and sine).
Definition Rotation2d.hpp:26
Represents a translation in 2D space.
Definition Translation2d.hpp:30
constexpr Translation2d RotateBy(const Rotation2d &other) const
Applies a rotation to the translation in 2D space.
Definition Translation2d.hpp:167
Definition LinearSystem.hpp:20
Represents robot chassis velocities.
Definition ChassisVelocities.hpp:26
constexpr ChassisVelocities Discretize(wpi::units::second_t dt) const
Discretizes continuous-time chassis velocities.
Definition ChassisVelocities.hpp:73
wpi::units::meters_per_second_t vx
Velocity along the x-axis.
Definition ChassisVelocities.hpp:30
constexpr ChassisVelocities ToRobotRelative(const Rotation2d &robotAngle) const
Converts this field-relative set of velocities into a robot-relative ChassisVelocities object.
Definition ChassisVelocities.hpp:97
constexpr ChassisVelocities operator-(const ChassisVelocities &other) const
Subtracts the other ChassisVelocities from the current ChassisVelocities and returns the difference.
Definition ChassisVelocities.hpp:153
constexpr ChassisVelocities operator-() const
Returns the inverse of the current ChassisVelocities.
Definition ChassisVelocities.hpp:163
constexpr ChassisVelocities operator*(double scalar) const
Multiplies the ChassisVelocities by a scalar and returns the new ChassisVelocities.
Definition ChassisVelocities.hpp:176
constexpr Twist2d ToTwist2d(wpi::units::second_t dt) const
Creates a Twist2d from ChassisVelocities.
Definition ChassisVelocities.hpp:49
constexpr ChassisVelocities ToFieldRelative(const Rotation2d &robotAngle) const
Converts this robot-relative set of velocities into a field-relative ChassisVelocities object.
Definition ChassisVelocities.hpp:118
wpi::units::radians_per_second_t omega
Represents the angular velocity of the robot frame.
Definition ChassisVelocities.hpp:40
constexpr ChassisVelocities operator+(const ChassisVelocities &other) const
Adds two ChassisVelocities and returns the sum.
Definition ChassisVelocities.hpp:138
wpi::units::meters_per_second_t vy
Velocity along the y-axis.
Definition ChassisVelocities.hpp:35
constexpr bool operator==(const ChassisVelocities &other) const =default
Compares the ChassisVelocities with another ChassisVelocity.
constexpr ChassisVelocities operator/(double scalar) const
Divides the ChassisVelocities by a scalar and returns the new ChassisVelocities.
Definition ChassisVelocities.hpp:191
A change in distance along a 2D arc since the last pose update.
Definition Twist2d.hpp:23