2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
DriveByTimeCommand Class Reference

#include <drive_by_time_command.h>

Inheritance diagram for DriveByTimeCommand:

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

SwerveDriveSubsystemm_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
 

Detailed Description

Note that this extends CommandHelper, rather extending CommandBase directly; this is crucially important, or else the decorator functions in Command will not work!

Constructor & Destructor Documentation

◆ DriveByTimeCommand()

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.

Parameters
swerveDriveswerve drive subsystem
robotYawDesired heading relative to field
percentSpeedDesired percent speed of drivetrain
driveTimeTime to drive along vector

Member Function Documentation

◆ End()

void DriveByTimeCommand::End ( bool  interrupted)
override

◆ Execute()

void DriveByTimeCommand::Execute ( )
override

◆ Initialize()

void DriveByTimeCommand::Initialize ( )
override

◆ IsFinished()

bool DriveByTimeCommand::IsFinished ( )
override

Member Data Documentation

◆ m_driveTime

units::millisecond_t DriveByTimeCommand::m_driveTime
private

◆ m_percentSpeed

double DriveByTimeCommand::m_percentSpeed
private

◆ m_robotYaw

units::degree_t DriveByTimeCommand::m_robotYaw
private

◆ m_startTime

std::chrono::time_point<std::chrono::high_resolution_clock> DriveByTimeCommand::m_startTime
private

◆ m_swerveDrive

SwerveDriveSubsystem& DriveByTimeCommand::m_swerveDrive
private

The documentation for this class was generated from the following files: