2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
drive_by_time_command.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <frc2/command/CommandBase.h>
8#include <frc2/command/CommandHelper.h>
9
10#include <chrono>
11
13
21class DriveByTimeCommand : public frc2::CommandHelper<frc2::CommandBase, DriveByTimeCommand> {
22 public:
29 units::degree_t robotYaw,
30 double percentSpeed,
31 units::millisecond_t driveTime);
32
33 void Initialize() override;
34
35 void Execute() override;
36
37 void End(bool interrupted) override;
38
39 bool IsFinished() override;
40
41 private:
43 units::degree_t m_robotYaw;
45 units::millisecond_t m_driveTime;
46 std::chrono::time_point<std::chrono::high_resolution_clock> m_startTime;
47};
Definition drive_by_time_command.h:21
void Execute() override
Definition drive_by_time_command.cpp:27
units::millisecond_t m_driveTime
Definition drive_by_time_command.h:45
double m_percentSpeed
Definition drive_by_time_command.h:44
void Initialize() override
Definition drive_by_time_command.cpp:22
std::chrono::time_point< std::chrono::high_resolution_clock > m_startTime
Definition drive_by_time_command.h:46
bool IsFinished() override
Definition drive_by_time_command.cpp:37
units::degree_t m_robotYaw
Definition drive_by_time_command.h:43
SwerveDriveSubsystem & m_swerveDrive
Definition drive_by_time_command.h:42
void End(bool interrupted) override
Definition drive_by_time_command.cpp:32
Subsystem for controlling the swerve drivetrain of the robot.
Definition swerve_drive_subsystem.h:56