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

#include <drive_until_pitch.h>

Inheritance diagram for DriveUntilPitch:

Public Member Functions

 DriveUntilPitch (SwerveDriveSubsystem *swerveDrive, units::degree_t velAngle, double power, double initialPower, units::degree_t pitchGoal, 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::degree_t m_pitchGoal
 The pitch 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

◆ DriveUntilPitch()

DriveUntilPitch::DriveUntilPitch ( SwerveDriveSubsystem swerveDrive,
units::degree_t  velAngle,
double  power,
double  initialPower,
units::degree_t  pitchGoal,
ApproachDirection  approachDirection,
units::time::second_t  timeout 
)

Member Function Documentation

◆ End()

void DriveUntilPitch::End ( bool  interrupted)
override

◆ Execute()

void DriveUntilPitch::Execute ( )
override

◆ Initialize()

void DriveUntilPitch::Initialize ( )
override

◆ IsFinished()

bool DriveUntilPitch::IsFinished ( )
override

Member Data Documentation

◆ m_approachDirection

const ApproachDirection DriveUntilPitch::m_approachDirection
private

Threshold approach direction for pitch goal.

◆ m_initialPower

const double DriveUntilPitch::m_initialPower
private

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

◆ m_pDrive

SwerveDriveSubsystem* DriveUntilPitch::m_pDrive
private

Raw pointer to swerve drive subsystem object.

◆ m_pitchGoal

const units::degree_t DriveUntilPitch::m_pitchGoal
private

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

◆ m_power

const double DriveUntilPitch::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> DriveUntilPitch::m_startTime
private

Start time as a time point.

◆ m_timeout

const units::time::second_t DriveUntilPitch::m_timeout
private

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

◆ m_velAngle

const units::degree_t DriveUntilPitch::m_velAngle
private

Angle of drive direction relative to field-centric.

◆ m_velocityRamper

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

Limit acceleration.


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