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

optimized auto values for the betterment of mankind

This commit is contained in:
Adam Long 2015-02-27 14:51:02 +00:00
parent 55bbfcd44f
commit 0035a736f4
4 changed files with 13 additions and 12 deletions

View File

@ -20,15 +20,16 @@ Autonomous::Autonomous(int seq){
case 1: case 1:
// Wait a desigated value, drive to Auto Zone (TM) // Wait a desigated value, drive to Auto Zone (TM)
Wait(SmartDashboard::GetNumber("Auto Wait Time")); Wait(SmartDashboard::GetNumber("Auto Wait Time"));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), -.8,0)); AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.8,0.0));
break; break;
case 2: case 2:
// Wait a desigated value, drive to Auto Zone (TM) // Wait a desigated value, drive to Auto Zone (TM)
Wait(SmartDashboard::GetNumber("Auto Wait Time")); Wait(SmartDashboard::GetNumber("Auto Wait Time"));
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
AddSequential(new BinRaise(1.2)); AddSequential(new BinRaise(1.2));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0,1)); AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"),0.75,0.0));
AddSequential(new BinLower(.9)); //AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0,-1.0));
//AddSequential(new AutoDrive(1.2, -0.75,0)); AddSequential(new BinLower(1.0));
break; break;
case 3: case 3:
// Collect three totes, drive to Auto Zone (TM) // Collect three totes, drive to Auto Zone (TM)

View File

@ -3,14 +3,13 @@
// Drive for a short while then stop. Just for testing // Drive for a short while then stop. Just for testing
Turn::Turn(int k) : Command("Turn"){ Turn::Turn(int k) : Command("Turn"){
Requires(DentRobot::drivetrain); Requires(DentRobot::drivetrain);
degrees=k; SetTimeout(k);
SetTimeout(0.85);
} }
void Turn::Initialize(){ void Turn::Initialize(){
} }
void Turn::Execute(){ void Turn::Execute(){
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle), gyro //X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle), gyro
DentRobot::drivetrain->DriveMecanum(0.0,0.0,1.0,0.9,0.0); DentRobot::drivetrain->DriveMecanum(0.0,0.0,0.65,0.9,0.0);
} }
bool Turn::IsFinished(){ bool Turn::IsFinished(){
return IsTimedOut(); return IsTimedOut();

View File

@ -26,15 +26,16 @@ void DentRobot::RobotInit(){
SmartDashboard::PutNumber("CodeVersion",CODE_VERSION); SmartDashboard::PutNumber("CodeVersion",CODE_VERSION);
// Autonomous // Autonomous
// Sequence of autonomous command // Sequence of autonomous command
SmartDashboard::PutNumber("Auto Sequence",1.0); SmartDashboard::PutNumber("Auto Sequence",2.0);
SmartDashboard::PutNumber("Auto Wait Time",1.0); SmartDashboard::PutNumber("Auto Wait Time",3.0);
// If the robot will be picking up three totes in sequence 3 // If the robot will be picking up three totes in sequence 3
SmartDashboard::PutBoolean("Three totes", true); SmartDashboard::PutBoolean("Three totes", true);
// TODO: Calibrate the following two values // TODO: Calibrate the following two values
// Distance (in time) to auto zone // Distance (in time) to auto zone
SmartDashboard::PutNumber("Auto Zone Distance", 4.2); SmartDashboard::PutNumber("Auto Zone Distance", 3.0);
// Distance (in time) to auto tote (used in sequence 3) // Distance (in time) to auto tote (used in sequence 3)
SmartDashboard::PutNumber("Auto Tote Distance", 0.5); SmartDashboard::PutNumber("Auto Tote Distance", 0.5);
SmartDashboard::PutNumber("TurnAmount",1.6);
// Elevators // Elevators
SmartDashboard::PutBoolean("Bin Elevator Bottom", false); SmartDashboard::PutBoolean("Bin Elevator Bottom", false);

View File

@ -26,14 +26,14 @@ double Elevator::GetHeight(){
return elevatorEncoder->Get(); return elevatorEncoder->Get();
} }
bool Elevator::GetElevatorBottom(){ bool Elevator::GetElevatorBottom(){
SmartDashboard::PutBoolean("Elevator Bottom", elevatorBottom->Get()); SmartDashboard::PutBoolean("Elevator Bottom", !elevatorBottom->Get());
return elevatorBottom->Get(); return elevatorBottom->Get();
} }
bool Elevator::GetElevatorMiddle(){ bool Elevator::GetElevatorMiddle(){
return elevatorMiddle->Get(); return elevatorMiddle->Get();
} }
bool Elevator::GetElevatorTop(){ bool Elevator::GetElevatorTop(){
SmartDashboard::PutBoolean("Elevator Top", elevatorTop->Get()); SmartDashboard::PutBoolean("Elevator Top", !elevatorTop->Get());
return elevatorTop->Get(); return elevatorTop->Get();
} }
void Elevator::SetUseEncoder(bool param){ void Elevator::SetUseEncoder(bool param){