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

groundbaking knew features added to robot without non-can

This commit is contained in:
Adam Long 2015-03-12 18:29:26 +00:00
parent 7df3576bc8
commit 9f9da69886
3 changed files with 12 additions and 11 deletions

View File

@ -27,7 +27,7 @@ Autonomous::Autonomous(int seq){
case 2:
// Lower BinElevator, collect bin, turn, drive to AutoZone (TM)
AddSequential(new BinLower(0.5));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Bin Distance"), 0, 0.75));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Bin Distance"), 0.0, 0.75));
AddSequential(new BinRaise(1.0));
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, -0.75));
@ -50,19 +50,19 @@ Autonomous::Autonomous(int seq){
AddSequential(new CollectTote());
if(SmartDashboard::GetBoolean("Two totes")){
AddSequential(new Raise(3.5));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Tote Distance"), 0, 0.75));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Tote Distance"), 0.0, 0.75));
AddSequential(new CollectTote());
AddSequential(new Lower(3.0));
AddSequential(new Raise(3.5));
if(SmartDashboard::GetBoolean("Three totes")){
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Tote Distance"), 0, 0.75));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Tote Distance"), 0.0, 0.75));
AddSequential(new CollectTote());
AddSequential(new Lower(3.0));
AddSequential(new Raise(3.5));
}
}
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0, 0.75));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, 0.75));
AddSequential(new ReleaseTote());
break;
case 5:

View File

@ -3,7 +3,7 @@
#include "AutoDrive.h"
#include "../Collector/RollIn.h"
CollectTote::CollectTote(){
AddParallel(new AutoDrive(1.0, -0.75, 0.0));
AddParallel(new AutoDrive(1.0, 0.0, -0.75));
AddSequential(new RollIn(1.0));
}
// vim: ts=2:sw=2:et

View File

@ -7,12 +7,13 @@ void RollIn::Initialize(){
SetTimeout(2.0);
}
void RollIn::Execute(){
double cvt=(rawSpeed)*DentRobot::collector->GetSonarDistance()/0.4;
if(cvt>=1.0){
DentRobot::collector->MoveRollers(1.0);
}else{
DentRobot::collector->MoveRollers(cvt*1.5);
}
//double cvt=(rawSpeed)*DentRobot::collector->GetSonarDistance()/0.4;
//if(cvt<=1.0){
// DentRobot::collector->MoveRollers(1.0);
//}else{
// DentRobot::collector->MoveRollers(cvt*1.5);
//}
DentRobot::collector->MoveRollers(DentRobot::oi->GetLeftThrottle() * 0.8);
}
bool RollIn::IsFinished(){
return IsTimedOut();