diff --git a/CommandBase.cpp b/CommandBase.cpp index ef64dae..72a2ffc 100644 --- a/CommandBase.cpp +++ b/CommandBase.cpp @@ -10,9 +10,9 @@ Elevator* CommandBase::elevator = NULL; BinElevator* CommandBase::binElevator = NULL; Pneumatics* CommandBase::pneumatics=NULL; OI* CommandBase::oi = NULL; -CommandBase::CommandBase(char const *name) : Command(name) { +CommandBase::CommandBase(char const *name): Command(name){ } -CommandBase::CommandBase() : Command() { +CommandBase::CommandBase(): Command(){ } void CommandBase::init(){ drivetrain = new Drivetrain(); diff --git a/CommandBase.h b/CommandBase.h index cb7453b..d0a855f 100644 --- a/CommandBase.h +++ b/CommandBase.h @@ -10,7 +10,7 @@ #include "OI.h" #include "WPILib.h" -class CommandBase: public Command { +class CommandBase: public Command{ public: CommandBase(char const *name); CommandBase(); diff --git a/Commands/Autonomous/AutoDrive.cpp b/Commands/Autonomous/AutoDrive.cpp index 4f8dea5..2525eb8 100644 --- a/Commands/Autonomous/AutoDrive.cpp +++ b/Commands/Autonomous/AutoDrive.cpp @@ -1,7 +1,7 @@ #include "AutoDrive.h" #include "../../DentRobot.h" // Drive for a short while then stop. Just for testing -AutoDrive::AutoDrive(double duration, double xtmp, double ytmp) : Command("AutoDrive"){ +AutoDrive::AutoDrive(double duration, double xtmp, double ytmp): Command("AutoDrive"){ Requires(DentRobot::drivetrain); SetTimeout(duration); x=xtmp; diff --git a/Commands/Autonomous/Turn.cpp b/Commands/Autonomous/Turn.cpp index d9a68d7..b44dab9 100644 --- a/Commands/Autonomous/Turn.cpp +++ b/Commands/Autonomous/Turn.cpp @@ -1,6 +1,6 @@ #include "Turn.h" #include "../../DentRobot.h" -Turn::Turn(double timeout) : Command("Turn"){ +Turn::Turn(double timeout): Command("Turn"){ Requires(DentRobot::drivetrain); SetTimeout(timeout); } diff --git a/Commands/BinElevator/BinCloseArms.cpp b/Commands/BinElevator/BinCloseArms.cpp index f16cab0..45cd81b 100644 --- a/Commands/BinElevator/BinCloseArms.cpp +++ b/Commands/BinElevator/BinCloseArms.cpp @@ -1,7 +1,7 @@ #include "BinCloseArms.h" #include "../../DentRobot.h" #include "../../OI.h" -BinCloseArms::BinCloseArms(double timeout) : Command("BinCloseArms"){ +BinCloseArms::BinCloseArms(double timeout): Command("BinCloseArms"){ SetTimeout(timeout); } void BinCloseArms::Initialize(){ diff --git a/Commands/BinElevator/BinLower.cpp b/Commands/BinElevator/BinLower.cpp index fe781ed..e8373bd 100644 --- a/Commands/BinElevator/BinLower.cpp +++ b/Commands/BinElevator/BinLower.cpp @@ -1,7 +1,7 @@ #include "BinLower.h" #include "../../DentRobot.h" #include "../../OI.h" -BinLower::BinLower(float timeout) : Command("BinLower"){ +BinLower::BinLower(float timeout): Command("BinLower"){ SetTimeout(timeout); } void BinLower::Initialize(){ @@ -10,7 +10,7 @@ void BinLower::Execute(){ DentRobot::binElevator->Run(-1.0); } bool BinLower::IsFinished(){ - if (/*!DentRobot::binElevator->GetElevatorBottom()||*/IsTimedOut()){ + if(/*!DentRobot::binElevator->GetElevatorBottom()||*/IsTimedOut()){ printf("Robot stoped BinLowering. Sensor based? %d\n", !DentRobot::binElevator->GetElevatorBottom()); return true; }else{ diff --git a/Commands/BinElevator/BinOpenArms.cpp b/Commands/BinElevator/BinOpenArms.cpp index 694f357..91f9bb1 100644 --- a/Commands/BinElevator/BinOpenArms.cpp +++ b/Commands/BinElevator/BinOpenArms.cpp @@ -1,7 +1,7 @@ #include "BinOpenArms.h" #include "../../DentRobot.h" #include "../../OI.h" -BinOpenArms::BinOpenArms(double timeout) : Command("BinOpenArms"){ +BinOpenArms::BinOpenArms(double timeout): Command("BinOpenArms"){ SetTimeout(timeout); } void BinOpenArms::Initialize(){ diff --git a/Commands/BinElevator/BinRaise.cpp b/Commands/BinElevator/BinRaise.cpp index 8ac189f..0f89c78 100644 --- a/Commands/BinElevator/BinRaise.cpp +++ b/Commands/BinElevator/BinRaise.cpp @@ -1,7 +1,7 @@ #include "BinRaise.h" #include "../../DentRobot.h" #include "../../OI.h" -BinRaise::BinRaise(double timeout) : Command("BinRaise"){ +BinRaise::BinRaise(double timeout): Command("BinRaise"){ SetTimeout(timeout); } void BinRaise::Initialize(){ @@ -10,7 +10,7 @@ void BinRaise::Execute(){ DentRobot::binElevator->Run(1.0); } bool BinRaise::IsFinished(){ - if (/*!DentRobot::binElevator->GetElevatorTop()||*/IsTimedOut()){ + if(/*!DentRobot::binElevator->GetElevatorTop()||*/IsTimedOut()){ printf("Robot stoped raising. Sensor based? %d\n", !DentRobot::binElevator->GetElevatorTop()); return true; }else{ diff --git a/Commands/Collector/RollIn.cpp b/Commands/Collector/RollIn.cpp index 87ec0f9..f87de00 100644 --- a/Commands/Collector/RollIn.cpp +++ b/Commands/Collector/RollIn.cpp @@ -1,5 +1,5 @@ #include "RollIn.h" -RollIn::RollIn(double speed) : Command("RollIn"){ +RollIn::RollIn(double speed): Command("RollIn"){ rawSpeed=speed; } void RollIn::Initialize(){ diff --git a/Commands/Collector/RollOut.cpp b/Commands/Collector/RollOut.cpp index eb07ad6..d9a696a 100644 --- a/Commands/Collector/RollOut.cpp +++ b/Commands/Collector/RollOut.cpp @@ -1,5 +1,5 @@ #include "RollOut.h" -RollOut::RollOut(double timeout) : Command("RollOut"){ +RollOut::RollOut(double timeout): Command("RollOut"){ Requires(DentRobot::collector); SetTimeout(timeout); } @@ -9,7 +9,7 @@ void RollOut::Execute(){ //TODO check this value to move the motors in the right direction // Devide by 2 twice because this speed should be half the collector speed DentRobot::collector->MoveRollers(-DentRobot::oi->GetLeftThrottle() * 0.8); - SmartDashboard::PutNumber("DriveThrottle",-DentRobot::oi->GetLeftThrottle()); + SmartDashboard::PutNumber("DriveThrottle", -DentRobot::oi->GetLeftThrottle()); } bool RollOut::IsFinished(){ return IsTimedOut(); diff --git a/Commands/Drivetrain/Drive.cpp b/Commands/Drivetrain/Drive.cpp index 4354717..71470eb 100644 --- a/Commands/Drivetrain/Drive.cpp +++ b/Commands/Drivetrain/Drive.cpp @@ -1,6 +1,6 @@ #include "Drive.h" #include "../../DentRobot.h" -Drive::Drive() : Command("Drive"){ +Drive::Drive(): Command("Drive"){ Requires(DentRobot::drivetrain); } void Drive::Initialize(){ @@ -11,10 +11,10 @@ void Drive::Execute(){ y = -DentRobot::oi->GetLeftStick()->GetRawAxis(1); z = DentRobot::oi->GetLeftStick()->GetRawAxis(2); // Lock the x axis when not holding button 1 - //if (DentRobot::oi->GetLeftStick()->GetRawButton(1)){ + //if(DentRobot::oi->GetLeftStick()->GetRawButton(1)){ // x=0; //} - //if (DentRobot::oi->GetLeftStick()->GetRawButton(2)){ + //if(DentRobot::oi->GetLeftStick()->GetRawButton(2)){ // y=0; //} //X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle), gyro diff --git a/Commands/Elevator/Lower.cpp b/Commands/Elevator/Lower.cpp index 3b11e4f..54f26f2 100644 --- a/Commands/Elevator/Lower.cpp +++ b/Commands/Elevator/Lower.cpp @@ -1,7 +1,7 @@ #include "Lower.h" #include "../../DentRobot.h" #include "../../OI.h" -Lower::Lower(double timeout) : Command("Lower"){ +Lower::Lower(double timeout): Command("Lower"){ SetTimeout(timeout); } void Lower::Initialize(){ @@ -10,7 +10,7 @@ void Lower::Execute(){ DentRobot::elevator->Run(-1.0); } bool Lower::IsFinished(){ - if (!DentRobot::elevator->GetElevatorBottom()||IsTimedOut()){ + if(!DentRobot::elevator->GetElevatorBottom()||IsTimedOut()){ printf("Robot stoped lowering. Sensor based? %d\n", !DentRobot::elevator->GetElevatorBottom()); return true; }else{ diff --git a/Commands/Elevator/Raise.cpp b/Commands/Elevator/Raise.cpp index 48286c7..feaa933 100644 --- a/Commands/Elevator/Raise.cpp +++ b/Commands/Elevator/Raise.cpp @@ -1,7 +1,7 @@ #include "Raise.h" #include "../../DentRobot.h" #include "../../OI.h" -Raise::Raise(double timeout) : Command("Raise"){ +Raise::Raise(double timeout): Command("Raise"){ SetTimeout(timeout); } void Raise::Initialize(){ @@ -13,12 +13,12 @@ bool Raise::IsFinished(){ //if(!DentRobot::elevator->GetElevatorMiddle()){ // DentRobot::elevator->stoppedAtSensor=true; //} - //if ((DentRobot::elevator->stoppedAtSensor)){ + //if((DentRobot::elevator->stoppedAtSensor)){ // printf("Stopped at the middle sensor\n"); // DentRobot::elevator->stoppedAtSensor=false; // return true; - //}else if (!DentRobot::elevator->GetElevatorTop()) { - if (!DentRobot::elevator->GetElevatorTop()||!DentRobot::elevator->GetElevatorMiddle()||IsTimedOut()){ + //}else if(!DentRobot::elevator->GetElevatorTop()){ + if(!DentRobot::elevator->GetElevatorTop()||!DentRobot::elevator->GetElevatorMiddle()||IsTimedOut()){ printf("Robot stopped raising. Sensor based? %d\n", !DentRobot::elevator->GetElevatorTop()||!DentRobot::elevator->GetElevatorMiddle()); return true; }else{ diff --git a/Commands/Test/CheckDrive.cpp b/Commands/Test/CheckDrive.cpp index 8ce3b65..8a114b7 100644 --- a/Commands/Test/CheckDrive.cpp +++ b/Commands/Test/CheckDrive.cpp @@ -3,7 +3,7 @@ #include "Commands/CommandGroup.h" #include "../../DentRobot.h" #include "../../RobotMap.h" -CheckDrive::CheckDrive(int motorID) : CommandGroup("CheckDrive"){ +CheckDrive::CheckDrive(int motorID): CommandGroup("CheckDrive"){ Requires(DentRobot::drivetrain); motor = motorID; } diff --git a/DentRobot.cpp b/DentRobot.cpp index 5bdb235..be86154 100644 --- a/DentRobot.cpp +++ b/DentRobot.cpp @@ -43,7 +43,7 @@ void DentRobot::RobotInit(){ SmartDashboard::PutBoolean("Elevator Bottom", false); SmartDashboard::PutBoolean("Elevator Top", false); //Drive speed - SmartDashboard::PutNumber("DriveSpeedReductionThresh",2); + SmartDashboard::PutNumber("DriveSpeedReductionThresh", 2); } void DentRobot::DisabledPeriodic(){ Scheduler::GetInstance()->Run(); @@ -60,7 +60,7 @@ void DentRobot::AutonomousPeriodic(){ Scheduler::GetInstance()->Run(); } void DentRobot::TeleopInit(){ - if (aut != NULL){ + if(aut != NULL){ aut->Cancel(); } } diff --git a/DentRobot.h b/DentRobot.h index 43759bd..5519df6 100644 --- a/DentRobot.h +++ b/DentRobot.h @@ -13,7 +13,7 @@ * * Features a 4-motor collector, 4-motor mecanum drivetrain, two one-motor elevators */ -class DentRobot: public IterativeRobot { +class DentRobot: public IterativeRobot{ private: /** * @brief The default driving command diff --git a/OI.cpp b/OI.cpp index 3bea98f..f3d07f9 100644 --- a/OI.cpp +++ b/OI.cpp @@ -10,7 +10,7 @@ #include "Commands/Autonomous/CollectTote.h" #include "Commands/Autonomous/ReleaseTote.h" #include "Commands/Test/CheckRobot.h" -OI::OI() { +OI::OI(){ // Joysticks leftStick=new Joystick(0); rightStick=new Joystick(1); diff --git a/OI.h b/OI.h index 369ea2b..13fb16a 100644 --- a/OI.h +++ b/OI.h @@ -7,8 +7,7 @@ /** * @brief Controls the robot with joysticks */ -class OI -{ +class OI{ private: Joystick *leftStick, *rightStick; public: diff --git a/Subsystems/Collector.cpp b/Subsystems/Collector.cpp index 7e5296a..ddae882 100644 --- a/Subsystems/Collector.cpp +++ b/Subsystems/Collector.cpp @@ -1,7 +1,7 @@ #include "Collector.h" #include "../RobotMap.h" -Collector::Collector() : Subsystem("Collector"){ +Collector::Collector(): Subsystem("Collector"){ collectorMotorLeft=new CANTalon(COLLECTOR_LEFT_CAN); collectorMotorBottom=new CANTalon(COLLECTOR_BOTTOM_CAN); collectorMotorRamp=new CANTalon(COLLECTOR_RAMP_CAN); diff --git a/Subsystems/Collector.h b/Subsystems/Collector.h index 7698f82..19afdfb 100644 --- a/Subsystems/Collector.h +++ b/Subsystems/Collector.h @@ -7,8 +7,7 @@ * * Uses four motors, two on the sides, one on the bottom, and one on the ramp to collect and eject totes */ -class Collector: public Subsystem -{ +class Collector: public Subsystem{ private: CANTalon *collectorMotorLeft, //GetLeftStick()->GetRawButton(9)){ + if(DentRobot::oi->GetLeftStick()->GetRawButton(9)){ correctY /= SmartDashboard::GetNumber("DriveSpeedReductionThresh"); } rightFront->Set((-correctX + correctY - correctZ)); diff --git a/Subsystems/Pneumatics.cpp b/Subsystems/Pneumatics.cpp index 93dab86..ef040af 100644 --- a/Subsystems/Pneumatics.cpp +++ b/Subsystems/Pneumatics.cpp @@ -1,7 +1,7 @@ #include "Pneumatics.h" #include "../RobotMap.h" -Pneumatics::Pneumatics() : Subsystem("Pneumatics"){ +Pneumatics::Pneumatics(): Subsystem("Pneumatics"){ solenoid1 = new Solenoid(BINELEVATOR_SOLDENOID_ONE); solenoid2 = new Solenoid(BINELEVATOR_SOLDENOID_TWO); }