7#include <frc/filter/SlewRateLimiter.h>
8#include <frc2/command/CommandBase.h>
9#include <frc2/command/CommandHelper.h>
15#include "units/time.h"
17class DriveUntilPitch :
public frc2::CommandHelper<frc2::CommandBase, DriveUntilPitch> {
20 units::degree_t velAngle,
23 units::degree_t pitchGoal,
25 units::time::second_t timeout);
31 void End(
bool interrupted)
override;
40 std::chrono::time_point<std::chrono::high_resolution_clock>
m_startTime;
ApproachDirection
Designate the threshold approach direction.
Definition Constants.h:84
Definition drive_until_pitch.h:17
void Execute() override
Definition drive_until_pitch.cpp:40
const units::degree_t m_pitchGoal
The pitch the robot has to be at to complete the command.
Definition drive_until_pitch.h:41
SwerveDriveSubsystem * m_pDrive
Raw pointer to swerve drive subsystem object.
Definition drive_until_pitch.h:36
const units::degree_t m_velAngle
Angle of drive direction relative to field-centric.
Definition drive_until_pitch.h:37
void End(bool interrupted) override
Definition drive_until_pitch.cpp:58
const double m_power
Power to apply in m_velAngle direction as percent output ([0, 1])
Definition drive_until_pitch.h:38
std::chrono::time_point< std::chrono::high_resolution_clock > m_startTime
Start time as a time point.
Definition drive_until_pitch.h:40
const ApproachDirection m_approachDirection
Threshold approach direction for pitch goal.
Definition drive_until_pitch.h:42
const double m_initialPower
Power prior to command start [-1,1].
Definition drive_until_pitch.h:39
bool IsFinished() override
Definition drive_until_pitch.cpp:65
void Initialize() override
Definition drive_until_pitch.cpp:33
const units::time::second_t m_timeout
The amount of time allowed to pass before the command times out.
Definition drive_until_pitch.h:43
frc::SlewRateLimiter< units::scalar > m_velocityRamper
Limit acceleration.
Definition drive_until_pitch.h:44
Subsystem for controlling the swerve drivetrain of the robot.
Definition swerve_drive_subsystem.h:56