7#include <frc/filter/SlewRateLimiter.h>
8#include <frc2/command/CommandBase.h>
9#include <frc2/command/CommandHelper.h>
10#include <units/angle.h>
11#include <units/angular_velocity.h>
12#include <units/time.h>
22 units::degree_t velAngle,
25 units::degrees_per_second_t pitchRateGoal,
27 units::time::second_t timeout);
33 void End(
bool interrupted)
override;
42 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_rate.h:19
void Execute() override
Definition drive_until_pitch_rate.cpp:35
frc::SlewRateLimiter< units::scalar > m_velocityRamper
Limit acceleration.
Definition drive_until_pitch_rate.h:46
SwerveDriveSubsystem * m_pDrive
Raw pointer to swerve drive subsystem object.
Definition drive_until_pitch_rate.h:38
const double m_initialPower
Power prior to command start [-1,1].
Definition drive_until_pitch_rate.h:41
const units::time::second_t m_timeout
The amount of time allowed to pass before the command times out.
Definition drive_until_pitch_rate.h:45
const units::degrees_per_second_t m_pitchRateGoal
The pitch rate the robot has to be at to complete the command.
Definition drive_until_pitch_rate.h:43
const double m_power
Power to apply in m_velAngle direction as percent output ([0, 1])
Definition drive_until_pitch_rate.h:40
void Initialize() override
Definition drive_until_pitch_rate.cpp:28
std::chrono::time_point< std::chrono::high_resolution_clock > m_startTime
Start time as a time point.
Definition drive_until_pitch_rate.h:42
const units::degree_t m_velAngle
Angle of drive direction relative to field-centric.
Definition drive_until_pitch_rate.h:39
bool IsFinished() override
Definition drive_until_pitch_rate.cpp:60
const ApproachDirection m_approachDirection
Threshold approach direction for pitch goal.
Definition drive_until_pitch_rate.h:44
void End(bool interrupted) override
Definition drive_until_pitch_rate.cpp:53
Subsystem for controlling the swerve drivetrain of the robot.
Definition swerve_drive_subsystem.h:56