2
0
mirror of https://github.com/team2059/Dent synced 2025-01-07 22:14:14 -05:00

changed formatting

This commit is contained in:
Adam Long 2015-09-19 21:57:42 +00:00
parent 0af5b351d6
commit 166e0a96b7
17 changed files with 20 additions and 40 deletions

View File

@ -4,8 +4,7 @@ Turn::Turn(double timeout): Command("Turn") {
Requires(DentRobot::drivetrain); Requires(DentRobot::drivetrain);
SetTimeout(timeout); SetTimeout(timeout);
} }
void Turn::Initialize() { void Turn::Initialize() {}
}
void Turn::Execute() { void Turn::Execute() {
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle) //X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle)
DentRobot::drivetrain->DriveArcade(0.0, 0.0, 0.6, 0.9); DentRobot::drivetrain->DriveArcade(0.0, 0.0, 0.6, 0.9);

View File

@ -4,8 +4,7 @@
BinIn::BinIn(float timeout): Command("BinIn") { BinIn::BinIn(float timeout): Command("BinIn") {
SetTimeout(timeout); SetTimeout(timeout);
} }
void BinIn::Initialize() { void BinIn::Initialize() {}
}
void BinIn::Execute() { void BinIn::Execute() {
DentRobot::binCollector->MoveArms(0.75); DentRobot::binCollector->MoveArms(0.75);
} }

View File

@ -4,8 +4,7 @@
BinOut::BinOut(double timeout): Command("BinOut") { BinOut::BinOut(double timeout): Command("BinOut") {
SetTimeout(timeout); SetTimeout(timeout);
} }
void BinOut::Initialize() { void BinOut::Initialize() {}
}
void BinOut::Execute() { void BinOut::Execute() {
DentRobot::binCollector->MoveArms(-0.1); DentRobot::binCollector->MoveArms(-0.1);
} }

View File

@ -4,16 +4,14 @@
BinCloseArms::BinCloseArms(double timeout): Command("BinCloseArms") { BinCloseArms::BinCloseArms(double timeout): Command("BinCloseArms") {
SetTimeout(timeout); SetTimeout(timeout);
} }
void BinCloseArms::Initialize() { void BinCloseArms::Initialize() {}
}
void BinCloseArms::Execute() { void BinCloseArms::Execute() {
DentRobot::pneumatics->SetArmsOpen(false); DentRobot::pneumatics->SetArmsOpen(false);
} }
bool BinCloseArms::IsFinished() { bool BinCloseArms::IsFinished() {
return true; return true;
} }
void BinCloseArms::End() { void BinCloseArms::End() {}
}
void BinCloseArms::Interrupted() { void BinCloseArms::Interrupted() {
End(); End();
} }

View File

@ -4,8 +4,7 @@
BinLower::BinLower(float timeout): Command("BinLower") { BinLower::BinLower(float timeout): Command("BinLower") {
SetTimeout(timeout); SetTimeout(timeout);
} }
void BinLower::Initialize() { void BinLower::Initialize() {}
}
void BinLower::Execute() { void BinLower::Execute() {
DentRobot::binElevator->Run(-1.0); DentRobot::binElevator->Run(-1.0);
} }

View File

@ -4,16 +4,14 @@
BinOpenArms::BinOpenArms(double timeout): Command("BinOpenArms") { BinOpenArms::BinOpenArms(double timeout): Command("BinOpenArms") {
SetTimeout(timeout); SetTimeout(timeout);
} }
void BinOpenArms::Initialize() { void BinOpenArms::Initialize() {}
}
void BinOpenArms::Execute() { void BinOpenArms::Execute() {
DentRobot::pneumatics->SetArmsOpen(true); DentRobot::pneumatics->SetArmsOpen(true);
} }
bool BinOpenArms::IsFinished() { bool BinOpenArms::IsFinished() {
return true; return true;
} }
void BinOpenArms::End() { void BinOpenArms::End() {}
}
void BinOpenArms::Interrupted() { void BinOpenArms::Interrupted() {
End(); End();
} }

View File

@ -4,8 +4,7 @@
BinRaise::BinRaise(double timeout): Command("BinRaise") { BinRaise::BinRaise(double timeout): Command("BinRaise") {
SetTimeout(timeout); SetTimeout(timeout);
} }
void BinRaise::Initialize() { void BinRaise::Initialize() {}
}
void BinRaise::Execute() { void BinRaise::Execute() {
DentRobot::binElevator->Run(1.0); DentRobot::binElevator->Run(1.0);
} }

View File

@ -3,8 +3,7 @@ RollOut::RollOut(double timeout): Command("RollOut") {
Requires(DentRobot::collector); Requires(DentRobot::collector);
SetTimeout(timeout); SetTimeout(timeout);
} }
void RollOut::Initialize() { void RollOut::Initialize() {}
}
void RollOut::Execute() { void RollOut::Execute() {
// Divide by 2 twice because this speed should be half the collector speed // Divide by 2 twice because this speed should be half the collector speed
DentRobot::collector->MoveRollers(-DentRobot::oi->GetLeftThrottle() * 0.8); DentRobot::collector->MoveRollers(-DentRobot::oi->GetLeftThrottle() * 0.8);

View File

@ -3,8 +3,7 @@
Drive::Drive(): Command("Drive") { Drive::Drive(): Command("Drive") {
Requires(DentRobot::drivetrain); Requires(DentRobot::drivetrain);
} }
void Drive::Initialize() { void Drive::Initialize() {}
}
void Drive::Execute() { void Drive::Execute() {
double x, y, z; double x, y, z;
x = DentRobot::oi->GetLeftStick()->GetRawAxis(0); x = DentRobot::oi->GetLeftStick()->GetRawAxis(0);
@ -29,8 +28,7 @@ void Drive::Execute() {
bool Drive::IsFinished() { bool Drive::IsFinished() {
return IsTimedOut(); return IsTimedOut();
} }
void Drive::End() { void Drive::End() {}
}
void Drive::Interrupted() { void Drive::Interrupted() {
End(); End();
} }

View File

@ -5,8 +5,7 @@ Lower::Lower(double timeout, bool useSoftLimits): Command("Lower") {
SetTimeout(timeout); SetTimeout(timeout);
softLimits=useSoftLimits; softLimits=useSoftLimits;
} }
void Lower::Initialize() { void Lower::Initialize() {}
}
void Lower::Execute() { void Lower::Execute() {
DentRobot::elevator->Run(-1.0); DentRobot::elevator->Run(-1.0);
} }

View File

@ -5,8 +5,7 @@ Raise::Raise(double timeout, bool useSoftLimits): Command("Raise") {
SetTimeout(timeout); SetTimeout(timeout);
softLimits=useSoftLimits; softLimits=useSoftLimits;
} }
void Raise::Initialize() { void Raise::Initialize() {}
}
void Raise::Execute() { void Raise::Execute() {
DentRobot::elevator->Run(1.0); DentRobot::elevator->Run(1.0);
} }

View File

@ -78,7 +78,6 @@ void DentRobot::TeleopPeriodic() {
} }
SmartDashboard::PutNumber("CollectorThrottle", oi->GetLeftThrottle()); SmartDashboard::PutNumber("CollectorThrottle", oi->GetLeftThrottle());
} }
void DentRobot::TestPeriodic() { void DentRobot::TestPeriodic() {}
}
START_ROBOT_CLASS(DentRobot); START_ROBOT_CLASS(DentRobot);
// vim: ts=2:sw=2:et // vim: ts=2:sw=2:et

View File

@ -5,8 +5,7 @@ BinCollector::BinCollector(): Subsystem("BinCollector") {
leftBinCollectorMotor = new CANTalon(BINCOLLECTOR_LEFT_CAN); leftBinCollectorMotor = new CANTalon(BINCOLLECTOR_LEFT_CAN);
rightBinCollectorMotor = new CANTalon(BINCOLLECTOR_RIGHT_CAN); rightBinCollectorMotor = new CANTalon(BINCOLLECTOR_RIGHT_CAN);
} }
void BinCollector::InitDefaultCommand() { void BinCollector::InitDefaultCommand() {}
}
void BinCollector::MoveArms(double speed) { void BinCollector::MoveArms(double speed) {
leftBinCollectorMotor->Set(speed); leftBinCollectorMotor->Set(speed);
rightBinCollectorMotor->Set(-speed); rightBinCollectorMotor->Set(-speed);

View File

@ -7,8 +7,7 @@ BinElevator::BinElevator() {
elevatorBottom = new DigitalInput(BINELEVATOR_BOTTOM_DIO); elevatorBottom = new DigitalInput(BINELEVATOR_BOTTOM_DIO);
elevatorTop = new DigitalInput(BINELEVATOR_TOP_DIO); elevatorTop = new DigitalInput(BINELEVATOR_TOP_DIO);
} }
void BinElevator::InitDefaultCommand() { void BinElevator::InitDefaultCommand() {}
}
void BinElevator::Run(double power) { void BinElevator::Run(double power) {
leftMotor->Set(power); leftMotor->Set(power);
rightMotor->Set(-power); rightMotor->Set(-power);

View File

@ -8,8 +8,7 @@ Collector::Collector(): Subsystem("Collector") {
collectorMotorRight = new CANTalon(COLLECTOR_RIGHT_CAN); collectorMotorRight = new CANTalon(COLLECTOR_RIGHT_CAN);
sonarAnalog = new AnalogInput(COLLECTOR_SONAR_ANALOG); sonarAnalog = new AnalogInput(COLLECTOR_SONAR_ANALOG);
} }
void Collector::InitDefaultCommand() { void Collector::InitDefaultCommand() {}
}
void Collector::MoveRollers(double power) { void Collector::MoveRollers(double power) {
MoveLeftRoller(power); MoveLeftRoller(power);
MoveRightRoller(-power); MoveRightRoller(-power);

View File

@ -9,8 +9,7 @@ Elevator::Elevator() {
// Checks if the elevator is drifting // Checks if the elevator is drifting
useEncoder = false; useEncoder = false;
} }
void Elevator::InitDefaultCommand() { void Elevator::InitDefaultCommand() {}
}
void Elevator::Run(double power) { void Elevator::Run(double power) {
// If we're not telling it to stop // If we're not telling it to stop
if(power != 0.0) { if(power != 0.0) {

View File

@ -9,8 +9,7 @@ Pneumatics::Pneumatics(): Subsystem("Pneumatics") {
solenoid4 = new Solenoid(COMPRESSOR_PCM_CAN, BINELEVATOR_SOLENOID_FOUR); solenoid4 = new Solenoid(COMPRESSOR_PCM_CAN, BINELEVATOR_SOLENOID_FOUR);
armState = false; armState = false;
} }
void Pneumatics::InitDefaultCommand() { void Pneumatics::InitDefaultCommand() {}
}
void Pneumatics::SetArmsOpen(bool state) { void Pneumatics::SetArmsOpen(bool state) {
if(state) { if(state) {
solenoid1->Set(true); solenoid1->Set(true);