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

#include <drive_until_pitch_rate.h>

Inheritance diagram for DriveUntilPitchRate:

Public Member Functions

 DriveUntilPitchRate (SwerveDriveSubsystem *swerveDrive, units::degree_t velAngle, double power, double initialPower, units::degrees_per_second_t pitchRateGoal, ApproachDirection approachDirection, units::time::second_t timeout)
 
void Initialize () override
 
void Execute () override
 
void End (bool interrupted) override
 
bool IsFinished () override
 

Private Attributes

SwerveDriveSubsystemm_pDrive
 Raw pointer to swerve drive subsystem object.
 
const units::degree_t m_velAngle
 Angle of drive direction relative to field-centric.
 
const double m_power
 Power to apply in m_velAngle direction as percent output ([0, 1])
 
const double m_initialPower
 Power prior to command start [-1,1].
 
std::chrono::time_point< std::chrono::high_resolution_clock > m_startTime
 Start time as a time point.
 
const units::degrees_per_second_t m_pitchRateGoal
 The pitch rate the robot has to be at to complete the command.
 
const ApproachDirection m_approachDirection
 Threshold approach direction for pitch goal.
 
const units::time::second_t m_timeout
 The amount of time allowed to pass before the command times out.
 
frc::SlewRateLimiter< units::scalar > m_velocityRamper
 Limit acceleration.
 

Detailed Description

Constructor & Destructor Documentation

◆ DriveUntilPitchRate()

DriveUntilPitchRate::DriveUntilPitchRate ( SwerveDriveSubsystem swerveDrive,
units::degree_t  velAngle,
double  power,
double  initialPower,
units::degrees_per_second_t  pitchRateGoal,
ApproachDirection  approachDirection,
units::time::second_t  timeout 
)

Member Function Documentation

◆ End()

void DriveUntilPitchRate::End ( bool  interrupted)
override

◆ Execute()

void DriveUntilPitchRate::Execute ( )
override

◆ Initialize()

void DriveUntilPitchRate::Initialize ( )
override

◆ IsFinished()

bool DriveUntilPitchRate::IsFinished ( )
override

Member Data Documentation

◆ m_approachDirection

const ApproachDirection DriveUntilPitchRate::m_approachDirection
private

Threshold approach direction for pitch goal.

◆ m_initialPower

const double DriveUntilPitchRate::m_initialPower
private

Power prior to command start [-1,1].

◆ m_pDrive

SwerveDriveSubsystem* DriveUntilPitchRate::m_pDrive
private

Raw pointer to swerve drive subsystem object.

◆ m_pitchRateGoal

const units::degrees_per_second_t DriveUntilPitchRate::m_pitchRateGoal
private

The pitch rate the robot has to be at to complete the command.

◆ m_power

const double DriveUntilPitchRate::m_power
private

Power to apply in m_velAngle direction as percent output ([0, 1])

◆ m_startTime

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

Start time as a time point.

◆ m_timeout

const units::time::second_t DriveUntilPitchRate::m_timeout
private

The amount of time allowed to pass before the command times out.

◆ m_velAngle

const units::degree_t DriveUntilPitchRate::m_velAngle
private

Angle of drive direction relative to field-centric.

◆ m_velocityRamper

frc::SlewRateLimiter<units::scalar> DriveUntilPitchRate::m_velocityRamper
private

Limit acceleration.


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