DeepSpace  2019
Robot Class Reference

#include <Robot.h>

Inheritance diagram for Robot:

Public Member Functions

void RobotInit () override
 Runs once on robot boot. More...
 
void RobotPeriodic () override
 Runs in a loop while the robot is turned on in any mode. More...
 
void DisabledInit () override
 Runs once every time the robot is disabled. More...
 
void DisabledPeriodic () override
 Runs in a loop while the robot is disabled. More...
 
void AutonomousInit () override
 Runs once at the start of auto. Usually while the announcer starts counting down from 3. More...
 
void AutonomousPeriodic () override
 Runs in a loop during auto. More...
 
void TeleopInit () override
 Runs once at the start of teleop when the bell sounds. More...
 
void TeleopPeriodic () override
 Runs in a loop during teleop. More...
 
void TestPeriodic () override
 Runs in a loop during test mode. More...
 
void SharedPeriodic ()
 Runs during teleop and auto. More...
 
void SharedInit ()
 Used to initalize commands for both auto and teleop. (2019 only) More...
 

Public Attributes

TriggerDrivepTriggerDrive
 Pointer for the TriggerDrive command. More...
 
PullArmpPullArm
 Pointer for the arm debugging command. More...
 
PullLegpPullLeg
 Pointer for the leg debugging command. More...
 
ControlHatchGripperpControlHatchGripper
 Pointer for the finger control command. More...
 
ControlSliderpControlSlider
 Pointer for the ControlSlider command. More...
 
ControlCompressorpControlCompressor
 Pointer for the ControlCompressor command. More...
 
ControlCargopControlCargo
 Pointer for the cargo control command. More...
 
ControlLightpControlLight
 Pointer for the vision light control command. More...
 
ClimbManagerpClimbManager
 Pointer for the climb management command. More...
 
AutoClimbHighpAutoClimbHigh
 Pointer for the auto high climb command. More...
 
ClimbpClimb
 Pointer for the climb control command. More...
 

Static Public Attributes

static cCompressorm_cCompressor
 Pointer for the cCompressor. More...
 
static DriveTrainm_DriveTrain
 Pointer for the DriveTrain. More...
 
static Pistonm_Piston
 Pointer for the Piston. More...
 
static CrawlDrivem_CrawlDrive
 Pointer for the DriveTrain. More...
 
static Armm_Arm
 Pointer for the Arm. More...
 
static Legm_Leg
 Pointer for the Leg. More...
 
static OIm_oi
 Pointer for the Operator Interface (OI) More...
 
static Sliderm_Slider
 Pointer for the Slider. More...
 
static HatchGripperm_HatchGripper
 Pointer for the Hatch Gripper. More...
 
static Flapm_Flap
 Pointer for the Cargo Flap. More...
 
static Lightm_Light
 Pointer for the Light. More...
 

Private Attributes

cs::UsbCamera frontCam
 Variable for the front camera. More...
 
cs::UsbCamera visionCam
 Variable for the Vision camera. More...
 
frc::SendableChooser< frc::Command * > m_chooser
 
frc::DriverStation & driverStation = frc::DriverStation::GetInstance()
 DriverStation instance. More...
 
std::shared_ptr< NetworkTable > ntTelemetry
 A pointer to the /SmartDashboard/Telemetry table. More...
 
AHRS * pGyro
 
clock_t logStart
 
clock_t logCurrent
 

Detailed Description

Definition at line 57 of file Robot.h.

Member Function Documentation

◆ AutonomousInit()

void Robot::AutonomousInit ( )
override

Runs once at the start of auto. Usually while the announcer starts counting down from 3.

This autonomous (along with the chooser code above) shows how to select between different autonomous modes using the dashboard. The sendable chooser code works with the Java SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the chooser code and uncomment the GetString code to get the auto name from the text box below the Gyro.

You can add additional auto modes by adding additional commands to the chooser code above (like the commented example) or additional comparisons to the if-else structure below with additional strings & commands.

Definition at line 173 of file Robot.cpp.

◆ AutonomousPeriodic()

void Robot::AutonomousPeriodic ( )
override

Runs in a loop during auto.

Definition at line 196 of file Robot.cpp.

◆ DisabledInit()

void Robot::DisabledInit ( )
override

Runs once every time the robot is disabled.

This function is called once each time the robot enters Disabled mode. You can use it to reset any subsystem information you want to clear when the robot is disabled.

Definition at line 149 of file Robot.cpp.

◆ DisabledPeriodic()

void Robot::DisabledPeriodic ( )
override

Runs in a loop while the robot is disabled.

Definition at line 160 of file Robot.cpp.

◆ RobotInit()

void Robot::RobotInit ( )
override

Runs once on robot boot.

Definition at line 49 of file Robot.cpp.

◆ RobotPeriodic()

void Robot::RobotPeriodic ( )
override

Runs in a loop while the robot is turned on in any mode.

This function is called every robot packet, no matter the mode. Use this for items like diagnostics that you want ran during disabled, autonomous, teleoperated and test.

This runs after the mode specific periodic functions, but before LiveWindow and SmartDashboard integrated updating.

Definition at line 126 of file Robot.cpp.

◆ SharedInit()

void Robot::SharedInit ( )

Used to initalize commands for both auto and teleop. (2019 only)

Definition at line 222 of file Robot.cpp.

◆ SharedPeriodic()

void Robot::SharedPeriodic ( )

Runs during teleop and auto.

Definition at line 234 of file Robot.cpp.

◆ TeleopInit()

void Robot::TeleopInit ( )
override

Runs once at the start of teleop when the bell sounds.

Definition at line 202 of file Robot.cpp.

◆ TeleopPeriodic()

void Robot::TeleopPeriodic ( )
override

Runs in a loop during teleop.

Definition at line 216 of file Robot.cpp.

◆ TestPeriodic()

void Robot::TestPeriodic ( )
override

Runs in a loop during test mode.

Definition at line 284 of file Robot.cpp.

Member Data Documentation

◆ driverStation

frc::DriverStation& Robot::driverStation = frc::DriverStation::GetInstance()
private

DriverStation instance.

Definition at line 110 of file Robot.h.

◆ frontCam

cs::UsbCamera Robot::frontCam
private

Variable for the front camera.

Definition at line 102 of file Robot.h.

◆ logCurrent

clock_t Robot::logCurrent
private

Definition at line 117 of file Robot.h.

◆ logStart

clock_t Robot::logStart
private

Definition at line 117 of file Robot.h.

◆ m_Arm

Arm * Robot::m_Arm
static

Pointer for the Arm.

Definition at line 66 of file Robot.h.

◆ m_cCompressor

cCompressor * Robot::m_cCompressor
static

Pointer for the cCompressor.

Definition at line 62 of file Robot.h.

◆ m_chooser

frc::SendableChooser<frc::Command*> Robot::m_chooser
private

Definition at line 108 of file Robot.h.

◆ m_CrawlDrive

CrawlDrive * Robot::m_CrawlDrive
static

Pointer for the DriveTrain.

Definition at line 65 of file Robot.h.

◆ m_DriveTrain

DriveTrain * Robot::m_DriveTrain
static

Pointer for the DriveTrain.

Definition at line 63 of file Robot.h.

◆ m_Flap

Flap * Robot::m_Flap
static

Pointer for the Cargo Flap.

Definition at line 71 of file Robot.h.

◆ m_HatchGripper

HatchGripper * Robot::m_HatchGripper
static

Pointer for the Hatch Gripper.

Definition at line 70 of file Robot.h.

◆ m_Leg

Leg * Robot::m_Leg
static

Pointer for the Leg.

Definition at line 67 of file Robot.h.

◆ m_Light

Light * Robot::m_Light
static

Pointer for the Light.

Definition at line 72 of file Robot.h.

◆ m_oi

OI * Robot::m_oi
static

Pointer for the Operator Interface (OI)

Definition at line 68 of file Robot.h.

◆ m_Piston

Piston * Robot::m_Piston
static

Pointer for the Piston.

Definition at line 64 of file Robot.h.

◆ m_Slider

Slider * Robot::m_Slider
static

Pointer for the Slider.

Definition at line 69 of file Robot.h.

◆ ntTelemetry

std::shared_ptr<NetworkTable> Robot::ntTelemetry
private

A pointer to the /SmartDashboard/Telemetry table.

Definition at line 113 of file Robot.h.

◆ pAutoClimbHigh

AutoClimbHigh* Robot::pAutoClimbHigh

Pointer for the auto high climb command.

Definition at line 84 of file Robot.h.

◆ pClimb

Climb* Robot::pClimb

Pointer for the climb control command.

Definition at line 85 of file Robot.h.

◆ pClimbManager

ClimbManager* Robot::pClimbManager

Pointer for the climb management command.

Definition at line 83 of file Robot.h.

◆ pControlCargo

ControlCargo* Robot::pControlCargo

Pointer for the cargo control command.

Definition at line 81 of file Robot.h.

◆ pControlCompressor

ControlCompressor* Robot::pControlCompressor

Pointer for the ControlCompressor command.

Definition at line 80 of file Robot.h.

◆ pControlHatchGripper

ControlHatchGripper* Robot::pControlHatchGripper

Pointer for the finger control command.

Definition at line 78 of file Robot.h.

◆ pControlLight

ControlLight* Robot::pControlLight

Pointer for the vision light control command.

Definition at line 82 of file Robot.h.

◆ pControlSlider

ControlSlider* Robot::pControlSlider

Pointer for the ControlSlider command.

Definition at line 79 of file Robot.h.

◆ pGyro

AHRS* Robot::pGyro
private

Definition at line 115 of file Robot.h.

◆ pPullArm

PullArm* Robot::pPullArm

Pointer for the arm debugging command.

Definition at line 76 of file Robot.h.

◆ pPullLeg

PullLeg* Robot::pPullLeg

Pointer for the leg debugging command.

Definition at line 77 of file Robot.h.

◆ pTriggerDrive

TriggerDrive* Robot::pTriggerDrive

Pointer for the TriggerDrive command.

Definition at line 75 of file Robot.h.

◆ visionCam

cs::UsbCamera Robot::visionCam
private

Variable for the Vision camera.

Definition at line 103 of file Robot.h.


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