diff --git a/Commands/Collector/CollectTote.cpp b/Commands/Collector/CollectTote.cpp index 1623d53..9780b39 100644 --- a/Commands/Collector/CollectTote.cpp +++ b/Commands/Collector/CollectTote.cpp @@ -6,13 +6,14 @@ void CollectTote::Initialize(){ } void CollectTote::Execute(){ //TODO check this value to move the motors in the right direction - DentRobot::collector->MoveRollers(-1.0); + printf("collecting tote\n"); + DentRobot::collector->MoveRollers(-(-DentRobot::oi->GetLeftStick()->GetRawAxis(3)+1.0)/2); } bool CollectTote::IsFinished(){ return DentRobot::collector->BoxCollected(); } void CollectTote::End(){ - DentRobot::collector->MoveRollers(0.0f); + DentRobot::collector->MoveRollers(0.0); } void CollectTote::Interrupted(){ End(); diff --git a/Commands/Collector/ReleaseTote.cpp b/Commands/Collector/ReleaseTote.cpp index 2f7d6ff..90ceaab 100644 --- a/Commands/Collector/ReleaseTote.cpp +++ b/Commands/Collector/ReleaseTote.cpp @@ -6,7 +6,8 @@ void ReleaseTote::Initialize(){ } void ReleaseTote::Execute(){ //TODO check this value to move the motors in the right direction - DentRobot::collector->MoveRollers(1.0f); + printf("releasing tote\n"); + DentRobot::collector->MoveRollers((-DentRobot::oi->GetLeftStick()->GetRawAxis(3)+1.0)/2); } bool ReleaseTote::IsFinished(){ return DentRobot::collector->BoxCollected(); diff --git a/Commands/Elevator/Lower.cpp b/Commands/Elevator/Lower.cpp index e3c44ab..e33f3b2 100644 --- a/Commands/Elevator/Lower.cpp +++ b/Commands/Elevator/Lower.cpp @@ -5,7 +5,7 @@ Lower::Lower() : Command("Lower"){ void Lower::Initialize(){ } void Lower::Execute(){ - DentRobot::elevator->Run(-0.4f); + DentRobot::elevator->Run((-DentRobot::oi->GetLeftStick()->GetRawAxis(3)+1.0)/2); } bool Lower::IsFinished(){ return false; diff --git a/Commands/Elevator/Raise.cpp b/Commands/Elevator/Raise.cpp index 0335cc5..ce1248f 100644 --- a/Commands/Elevator/Raise.cpp +++ b/Commands/Elevator/Raise.cpp @@ -1,11 +1,12 @@ #include "Raise.h" #include "../../DentRobot.h" +#include "../../OI.h" Raise::Raise(){ } void Raise::Initialize(){ } void Raise::Execute(){ - DentRobot::elevator->Run(0.4f); + DentRobot::elevator->Run(-(-DentRobot::oi->GetLeftStick()->GetRawAxis(3)+1.0)/2); } bool Raise::IsFinished(){ return false; diff --git a/OI.cpp b/OI.cpp index 5910d71..4fc58f9 100644 --- a/OI.cpp +++ b/OI.cpp @@ -5,10 +5,7 @@ #include "Commands/Collector/CloseCollector.h" #include "Commands/Collector/CollectTote.h" #include "Commands/Collector/ReleaseTote.h" -#include "Commands/Collector/StopCollector.h" -#include "Commands/Collector/StopArm.h" #include "Commands/Compressor/StartCompressing.h" -#include "Commands/Compressor/StopCompressing.h" OI::OI() { leftStick=new Joystick(0); @@ -20,16 +17,12 @@ OI::OI() { JoystickButton *left4=new JoystickButton(leftStick, 4); JoystickButton *left5=new JoystickButton(leftStick, 5); JoystickButton *left6=new JoystickButton(leftStick, 6); - JoystickButton *left7=new JoystickButton(leftStick, 7); - JoystickButton *left8=new JoystickButton(leftStick, 8); left1->WhileHeld(new OpenCollector()); left2->WhileHeld(new CloseCollector()); left3->WhileHeld(new CollectTote()); left4->WhileHeld(new ReleaseTote()); - left5->WhileHeld(new StartCompressing()); - left6->WhileHeld(new StopCompressing()); - left7->WhileHeld(new Raise()); - left8->WhileHeld(new Lower()); + left5->WhileHeld(new Raise()); + left6->WhileHeld(new Lower()); } Joystick* OI::GetRightStick(){ return rightStick; diff --git a/Subsystems/Collector.cpp b/Subsystems/Collector.cpp index 563eb54..b05c76c 100644 --- a/Subsystems/Collector.cpp +++ b/Subsystems/Collector.cpp @@ -14,7 +14,8 @@ void Collector::MoveArms(float a){ windowMotorLeft->Set(a); windowMotorRight->Set(-a); } -void Collector::MoveRollers(float a){ +void Collector::MoveRollers(double a){ + printf("Collector: %f\n", a); collectorMotorLeft->Set(a); collectorMotorRight->Set(-a); } @@ -23,5 +24,6 @@ bool Collector::ArmSensor(){ return false; } bool Collector::BoxCollected(){ - return boxSwitch->Get(); + return false; + //return boxSwitch->Get(); } diff --git a/Subsystems/Collector.h b/Subsystems/Collector.h index 5302835..ef5acf3 100644 --- a/Subsystems/Collector.h +++ b/Subsystems/Collector.h @@ -11,7 +11,7 @@ class Collector: public Subsystem Collector(); void InitDefaultCommand(); void MoveArms(float); - void MoveRollers(float); + void MoveRollers(double); bool ArmSensor(); bool BoxCollected(); }; diff --git a/TODO.txt b/TODO.txt index a386c8a..0f710ce 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,4 +1,2 @@ -Release for all buttons does not work -raise is pushed, elevator raises, lower is pushed, elevator lowers, raise is pushed, no effect -lower is pushed, elevator lowers, raise is pushed, no effect -dos compressor on compressor start or stop +Compressor isn't in use + (dos compressor on compressor start or stop)?