2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00
dent/DentRobot.cpp

54 lines
1.5 KiB
C++
Raw Normal View History

2015-01-16 19:49:16 -05:00
#include "DentRobot.h"
#include "OI.h"
2015-02-07 12:32:46 -05:00
#include "Commands/Autonomous/Autonomous.h"
2015-01-17 12:21:16 -05:00
OI* DentRobot::oi=NULL;
Collector* DentRobot::collector=NULL;
Drivetrain* DentRobot::drivetrain=NULL;
Elevator* DentRobot::elevator=NULL;
2015-02-10 20:12:41 -05:00
BinElevator* DentRobot::binElevator=NULL;
2015-02-07 12:50:36 -05:00
CommandGroup* DentRobot::aut=NULL;
2015-01-17 12:21:16 -05:00
DentRobot::DentRobot(){
oi=new OI();
collector=new Collector();
drivetrain=new Drivetrain();
elevator=new Elevator();
2015-02-10 20:12:41 -05:00
binElevator=new BinElevator();
2015-02-13 17:34:38 -05:00
aut=new Autonomous(0);
CameraServer::GetInstance()->SetQuality(25);
CameraServer::GetInstance()->StartAutomaticCapture("cam0");
//SmartDashboard::PutNumber("Auto Wait Time", 1.0);
//SmartDashboard::PutNumber("Auto Sequence", 0);
2015-01-16 19:49:16 -05:00
printf("Initialized");
}
void DentRobot::RobotInit(){
//SmartDashboard::PutNumber("CodeVersion",0.001);
2015-01-16 19:49:16 -05:00
}
void DentRobot::DisabledPeriodic(){
Scheduler::GetInstance()->Run();
}
void DentRobot::AutonomousInit(){
2015-02-07 12:32:46 -05:00
if(aut != NULL){
aut->Start();
}
2015-01-16 19:49:16 -05:00
}
void DentRobot::AutonomousPeriodic(){
Scheduler::GetInstance()->Run();
}
void DentRobot::TeleopInit(){
if (aut != NULL){
aut->Cancel();
}
2015-01-16 19:49:16 -05:00
}
void DentRobot::TeleopPeriodic(){
Scheduler::GetInstance()->Run();
// TODO: Calibrate 1.0 to the height we want the elevator to automatically raise
if(elevator->GetUseEncoder()&&elevator->GetHeight()<=-1.0){
// Raise the elevator if it dips below elevatorTop
oi->raise->Start();
}
2015-01-16 19:49:16 -05:00
}
void DentRobot::TestPeriodic(){
}
START_ROBOT_CLASS(DentRobot);
2015-02-08 12:26:15 -05:00
// vim: ts=2:sw=2:et