2025-Robot
Robot code for 2025 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/Command.h>
8#include <frc2/command/CommandHelper.h>
9
10#include <chrono>
11
13
14class DriveByTimeCommand : public frc2::CommandHelper<frc2::Command, DriveByTimeCommand> {
15 public:
22 units::degree_t robotYaw,
23 double percentSpeed,
24 units::millisecond_t driveTime);
25
26 void Initialize() override;
27
28 void Execute() override;
29
30 void End(bool interrupted) override;
31
32 bool IsFinished() override;
33
34 private:
36 units::degree_t m_robotYaw;
38 units::millisecond_t m_driveTime;
39 std::chrono::time_point<std::chrono::high_resolution_clock> m_startTime;
40};
Definition drive_by_time_command.h:14
void Execute() override
Definition drive_by_time_command.cpp:27
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 ...
Definition drive_by_time_command.cpp:9
units::millisecond_t m_driveTime
Definition drive_by_time_command.h:38
double m_percentSpeed
Definition drive_by_time_command.h:37
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:39
bool IsFinished() override
Definition drive_by_time_command.cpp:37
units::degree_t m_robotYaw
Definition drive_by_time_command.h:36
SwerveDriveSubsystem & m_swerveDrive
Definition drive_by_time_command.h:35
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:75