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

Minor fixes (untested)

This commit is contained in:
Austen Adler 2015-02-06 20:38:02 -05:00
parent 32834cc28b
commit 4494b9131a
6 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,7 @@
#include "AutoDrive.h"
#include <cmath>
#include "../../DentRobot.h"
// Drive for a short while then stop. Just for testing
AutoDrive::AutoDrive() : Command("AutoDrive"){
Requires(DentRobot::drivetrain);
SetTimeout(1.0);

View File

@ -3,6 +3,7 @@ CollectTote::CollectTote() : Command("CollectTote"){
Requires(DentRobot::collector);
}
void CollectTote::Initialize(){
SetTimeout(2.0);
}
void CollectTote::Execute(){
//TODO check this value to move the motors in the right direction

View File

@ -3,10 +3,11 @@ OpenCollector::OpenCollector() : Command("OpenCollector"){
Requires(DentRobot::collector);
}
void OpenCollector::Initialize(){
SetTimeout(0.5);
}
void OpenCollector::Execute(){
//TODO check this value to move the motors in the right direction
DentRobot::collector->MoveArms(-0.1);
DentRobot::collector->MoveArms(-0.1f);
}
bool OpenCollector::IsFinished(){
return DentRobot::collector->ArmSensor();

View File

@ -3,11 +3,13 @@ ReleaseTote::ReleaseTote() : Command("ReleaseTote"){
Requires(DentRobot::collector);
}
void ReleaseTote::Initialize(){
SetTimeout(2.0);
}
void ReleaseTote::Execute(){
//TODO check this value to move the motors in the right direction
printf("releasing tote\n");
DentRobot::collector->MoveRollers((-DentRobot::oi->GetLeftStick()->GetRawAxis(3)+1.0)/2);
// Devide by 2 twice because this speed should be half the collector speed
DentRobot::collector->MoveRollers((-DentRobot::oi->GetLeftStick()->GetRawAxis(3)+1.0)/2/2);
}
bool ReleaseTote::IsFinished(){
return DentRobot::collector->BoxCollected();

View File

@ -10,7 +10,7 @@ Collector::Collector() : Subsystem("Collector") {
}
void Collector::InitDefaultCommand() {
}
void Collector::MoveArms(float a){
void Collector::MoveArms(double a){
windowMotorLeft->Set(a);
windowMotorRight->Set(-a);
}

View File

@ -10,7 +10,7 @@ class Collector: public Subsystem
public:
Collector();
void InitDefaultCommand();
void MoveArms(float);
void MoveArms(double);
void MoveRollers(double);
bool ArmSensor();
bool BoxCollected();