2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
|
#include <drive_by_time_command.h>
Public Member Functions | |
DriveByTimeCommand (SwerveDriveSubsystem &swerveDrive, units::degree_t robotYaw, double percentSpeed, units::millisecond_t driveTime) | |
Constructs DriveByTimeCommand that drives by a vector with angle robotYaw and power percentSpeed for driveTime milliseconds. | |
void | Initialize () override |
void | Execute () override |
void | End (bool interrupted) override |
bool | IsFinished () override |
Private Attributes | |
SwerveDriveSubsystem & | m_swerveDrive |
units::degree_t | m_robotYaw |
double | m_percentSpeed |
units::millisecond_t | m_driveTime |
std::chrono::time_point< std::chrono::high_resolution_clock > | m_startTime |
Note that this extends CommandHelper, rather extending CommandBase directly; this is crucially important, or else the decorator functions in Command will not work!
DriveByTimeCommand::DriveByTimeCommand | ( | SwerveDriveSubsystem & | swerveDrive, |
units::degree_t | robotYaw, | ||
double | percentSpeed, | ||
units::millisecond_t | driveTime | ||
) |
Constructs DriveByTimeCommand that drives by a vector with angle robotYaw and power percentSpeed for driveTime milliseconds.
swerveDrive | swerve drive subsystem |
robotYaw | Desired heading relative to field |
percentSpeed | Desired percent speed of drivetrain |
driveTime | Time to drive along vector |
|
override |
|
override |
|
override |
|
override |
|
private |
|
private |
|
private |
|
private |
|
private |