A single differential drive robot sample in a Trajectory.
More...
#include <choreo/trajectory/DifferentialSample.h>
|
|
constexpr | DifferentialSample ()=default |
| | Constructs a DifferentialSample that is defaulted.
|
| |
| constexpr | DifferentialSample (units::second_t timestamp, units::meter_t x, units::meter_t y, units::radian_t heading, units::meters_per_second_t vl, units::meters_per_second_t vr, units::radians_per_second_t omega, units::meters_per_second_squared_t al, units::meters_per_second_squared_t ar, units::radians_per_second_squared_t alpha, units::newton_t fl, units::newton_t fr) |
| |
| units::second_t | GetTimestamp () const |
| |
| constexpr frc::Pose2d | GetPose () const |
| |
| constexpr frc::ChassisSpeeds | GetChassisSpeeds () const |
| |
| constexpr DifferentialSample | OffsetBy (units::second_t timeStampOffset) const |
| |
| DifferentialSample | Interpolate (const DifferentialSample &endValue, units::second_t t) const |
| |
| template<int Year = util::kDefaultYear> |
| constexpr DifferentialSample | Flipped () const |
| |
| constexpr bool | operator== (const DifferentialSample &other) const |
| |
|
|
units::second_t | timestamp = 0_s |
| | The timestamp of this sample relative to the beginning of the trajectory.
|
| |
|
units::meter_t | x = 0_m |
| | The X position of the sample relative to the blue alliance wall origin.
|
| |
|
units::meter_t | y = 0_m |
| | The Y position of the sample relative to the blue alliance wall origin.
|
| |
|
units::radian_t | heading = 0_rad |
| | The heading of the sample, with 0 being in the +X direction.
|
| |
|
units::meters_per_second_t | vl = 0_mps |
| | The velocity of the left wheels.
|
| |
|
units::meters_per_second_t | vr = 0_mps |
| | The velocity of the right wheels.
|
| |
|
units::radians_per_second_t | omega = 0_rad_per_s |
| | The chassis angular velocity.
|
| |
|
units::meters_per_second_squared_t | al = 0_mps_sq |
| | The acceleration of the left wheels.
|
| |
|
units::meters_per_second_squared_t | ar = 0_mps_sq |
| | The acceleration of the right wheels.
|
| |
|
units::radians_per_second_squared_t | alpha = 0_rad_per_s_sq |
| | The chassis angular acceleration.
|
| |
|
units::newton_t | fl = 0_N |
| | The force of the left wheels.
|
| |
|
units::newton_t | fr = 0_N |
| | The force of the right wheels.
|
| |
A single differential drive robot sample in a Trajectory.
◆ DifferentialSample()
| constexpr choreo::DifferentialSample::DifferentialSample |
( |
units::second_t |
timestamp, |
|
|
units::meter_t |
x, |
|
|
units::meter_t |
y, |
|
|
units::radian_t |
heading, |
|
|
units::meters_per_second_t |
vl, |
|
|
units::meters_per_second_t |
vr, |
|
|
units::radians_per_second_t |
omega, |
|
|
units::meters_per_second_squared_t |
al, |
|
|
units::meters_per_second_squared_t |
ar, |
|
|
units::radians_per_second_squared_t |
alpha, |
|
|
units::newton_t |
fl, |
|
|
units::newton_t |
fr |
|
) |
| |
|
inlineconstexpr |
Constructs a DifferentialSample with the specified parameters.
- Parameters
-
| timestamp | The timestamp of this sample, relative to the beginning of the trajectory. |
| x | The X position of the sample |
| y | The Y position of the sample |
| heading | The heading of the sample, with 0 being in the +X direction. |
| vl | The velocity of the left wheels |
| vr | The velocity of the right wheels |
| omega | The chassis angular velocity |
| al | The acceleration of the left wheels |
| ar | The acceleration of the left wheels |
| alpha | The chassis angular acceleration |
| fl | The force of the left wheels |
| fr | The force of the right wheels |
◆ Flipped()
template<int Year = util::kDefaultYear>
Returns the current sample flipped based on the field year.
- Template Parameters
-
- Returns
- DifferentialSample that is flipped based on the field layout.
◆ GetChassisSpeeds()
| constexpr frc::ChassisSpeeds choreo::DifferentialSample::GetChassisSpeeds |
( |
| ) |
const |
|
inlineconstexpr |
Gets the field-relative chassis speeds of the DifferentialSample.
- Returns
- The field-relative chassis speeds.
◆ GetPose()
| constexpr frc::Pose2d choreo::DifferentialSample::GetPose |
( |
| ) |
const |
|
inlineconstexpr |
◆ GetTimestamp()
| units::second_t choreo::DifferentialSample::GetTimestamp |
( |
| ) |
const |
|
inline |
◆ Interpolate()
Interpolates between endValue and this by t
- Parameters
-
| endValue | the end interpolated value |
| t | time to move sample by |
- Returns
- the interpolated sample
◆ OffsetBy()
| constexpr DifferentialSample choreo::DifferentialSample::OffsetBy |
( |
units::second_t |
timeStampOffset | ) |
const |
|
inlineconstexpr |
Returns the current sample offset by a the time offset passed in.
- Parameters
-
| timeStampOffset | time to move sample by |
- Returns
- DifferentialSample that is moved forward by the offset
◆ operator==()
| constexpr bool choreo::DifferentialSample::operator== |
( |
const DifferentialSample & |
other | ) |
const |
|
inlineconstexpr |
The documentation for this class was generated from the following file: