mirror of
https://github.com/team2059/Dent
synced 2025-01-07 22:14:14 -05:00
Fixed indentation
This commit is contained in:
parent
4717e6f029
commit
7f3a504472
@ -1,15 +1,15 @@
|
||||
#include "CloseCollector.h"
|
||||
CloseCollector::CloseCollector() : Command("CloseCollector"){
|
||||
Requires(DentRobot::collector);
|
||||
Requires(DentRobot::collector);
|
||||
}
|
||||
void CloseCollector::Initialize(){
|
||||
SetTimeout(0.5);
|
||||
}
|
||||
void CloseCollector::Execute(){
|
||||
DentRobot::collector->MoveArms(.1);
|
||||
DentRobot::collector->MoveArms(.1);
|
||||
}
|
||||
bool CloseCollector::IsFinished(){
|
||||
return DentRobot::collector->ArmSensor();
|
||||
return DentRobot::collector->ArmSensor();
|
||||
}
|
||||
void CloseCollector::End(){
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
#include "CollectTote.h"
|
||||
CollectTote::CollectTote() : Command("CollectTote"){
|
||||
Requires(DentRobot::collector);
|
||||
Requires(DentRobot::collector);
|
||||
}
|
||||
void CollectTote::Initialize(){
|
||||
}
|
||||
void CollectTote::Execute(){
|
||||
//TODO check this value to move the motors in the right direction
|
||||
DentRobot::collector->MoveRollers(-1);
|
||||
//TODO check this value to move the motors in the right direction
|
||||
DentRobot::collector->MoveRollers(-1);
|
||||
}
|
||||
bool CollectTote::IsFinished(){
|
||||
return DentRobot::collector->BoxCollected();
|
||||
return DentRobot::collector->BoxCollected();
|
||||
}
|
||||
void CollectTote::End(){
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <cmath>
|
||||
#include "../DentRobot.h"
|
||||
Drive::Drive() : Command("Drive"){
|
||||
Requires(DentRobot::drivetrain);
|
||||
Requires(DentRobot::drivetrain);
|
||||
}
|
||||
void Drive::Initialize(){
|
||||
}
|
||||
@ -18,8 +18,8 @@ void Drive::Execute(){
|
||||
z = DentRobot::oi->GetLeftStick()->GetRawAxis(2);
|
||||
y = DentRobot::oi->GetLeftStick()->GetRawAxis(1);
|
||||
if (DentRobot::oi->GetLeftStick()->GetRawAxis(3)<=0.5){
|
||||
y /= 2;
|
||||
z /= 2;
|
||||
y /= 2;
|
||||
z /= 2;
|
||||
}
|
||||
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle), gyro
|
||||
DentRobot::drivetrain->DriveMecanum(x,y,z,0.9,0);
|
||||
|
@ -1,15 +1,15 @@
|
||||
#include "ReleaseTote.h"
|
||||
ReleaseTote::ReleaseTote() : Command("ReleaseTote"){
|
||||
Requires(DentRobot::collector);
|
||||
Requires(DentRobot::collector);
|
||||
}
|
||||
void ReleaseTote::Initialize(){
|
||||
}
|
||||
void ReleaseTote::Execute(){
|
||||
//TODO check this value to move the motors in the right direction
|
||||
DentRobot::collector->MoveRollers(1);
|
||||
//TODO check this value to move the motors in the right direction
|
||||
DentRobot::collector->MoveRollers(1);
|
||||
}
|
||||
bool ReleaseTote::IsFinished(){
|
||||
return DentRobot::collector->BoxCollected();
|
||||
return DentRobot::collector->BoxCollected();
|
||||
}
|
||||
void ReleaseTote::End(){
|
||||
}
|
||||
|
34
DentRobot.h
34
DentRobot.h
@ -8,23 +8,23 @@
|
||||
#include "Subsystems/Collector.h"
|
||||
#include "Subsystems/AirCompressor.h"
|
||||
class DentRobot: public IterativeRobot {
|
||||
private:
|
||||
Command *driveCommand = NULL;
|
||||
public:
|
||||
static OI* oi;
|
||||
static Collector* collector;
|
||||
static Drivetrain* drivetrain;
|
||||
static Elevator* elevator;
|
||||
static DIO* dio;
|
||||
static AirCompressor* airCompressor;
|
||||
DentRobot();
|
||||
void RobotInit();
|
||||
void DisabledPeriodic();
|
||||
void AutonomousInit();
|
||||
void AutonomousPeriodic();
|
||||
void TeleopInit();
|
||||
void TeleopPeriodic();
|
||||
void TestPeriodic();
|
||||
private:
|
||||
Command *driveCommand = NULL;
|
||||
public:
|
||||
static OI* oi;
|
||||
static Collector* collector;
|
||||
static Drivetrain* drivetrain;
|
||||
static Elevator* elevator;
|
||||
static DIO* dio;
|
||||
static AirCompressor* airCompressor;
|
||||
DentRobot();
|
||||
void RobotInit();
|
||||
void DisabledPeriodic();
|
||||
void AutonomousInit();
|
||||
void AutonomousPeriodic();
|
||||
void TeleopInit();
|
||||
void TeleopPeriodic();
|
||||
void TestPeriodic();
|
||||
};
|
||||
#endif
|
||||
// vim: ts=2:sw=2:et
|
||||
|
4
OI.cpp
4
OI.cpp
@ -16,10 +16,14 @@ OI::OI() {
|
||||
JoystickButton *right2=new JoystickButton(rightStick, 2);
|
||||
JoystickButton *right3=new JoystickButton(rightStick, 3);
|
||||
JoystickButton *right4=new JoystickButton(rightStick, 4);
|
||||
JoystickButton *right5=new JoystickButton(rightStick, 5);
|
||||
JoystickButton *right6=new JoystickButton(rightStick, 6);
|
||||
right1->WhenPressed(new OpenCollector());
|
||||
right2->WhenPressed(new CloseCollector());
|
||||
right3->WhenPressed(new CollectTote());
|
||||
right4->WhenPressed(new ReleaseTote());
|
||||
right5->WhenPressed(new StartCompressing());
|
||||
right6->WhenPressed(new StopCompressing());
|
||||
}
|
||||
Joystick* OI::GetRightStick(){
|
||||
return rightStick;
|
||||
|
@ -5,7 +5,7 @@
|
||||
class AirCompressor: public Subsystem
|
||||
{
|
||||
private:
|
||||
Compressor *compressor;
|
||||
Compressor *compressor;
|
||||
public:
|
||||
AirCompressor();
|
||||
void InitDefaultCommand();
|
||||
|
@ -5,8 +5,8 @@
|
||||
class Collector: public Subsystem
|
||||
{
|
||||
private:
|
||||
CANTalon *windowMotorLeft, *windowMotorRight, *collectorMotorLeft, *collectorMotorRight;
|
||||
DigitalInput *boxSwitch;
|
||||
CANTalon *windowMotorLeft, *windowMotorRight, *collectorMotorLeft, *collectorMotorRight;
|
||||
DigitalInput *boxSwitch;
|
||||
public:
|
||||
Collector();
|
||||
void InitDefaultCommand();
|
||||
|
Loading…
x
Reference in New Issue
Block a user