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

Removed unused autos, removed unused dashboard values, fixed doxygen documentation to meet guidelines

This commit is contained in:
Adam Long 2015-04-05 10:45:31 +00:00
parent 98d6f7e4b5
commit e0536cf787
7 changed files with 10 additions and 43 deletions

View File

@ -16,7 +16,7 @@ Autonomous::Autonomous(int seq){
case 0:
// Just for testing
// Turn testing
AddSequential(new Turn(3.8));
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
break;
case 1:
// Drive to Auto Zone (TM)
@ -24,15 +24,6 @@ Autonomous::Autonomous(int seq){
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
break;
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, 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));
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
break;
case 3:
// Collect a tote with BinElevator, turn, drive to Auto Zone (TM)
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
AddSequential(new BinRaise(1.2));
@ -40,7 +31,7 @@ Autonomous::Autonomous(int seq){
AddSequential(new BinLower(1.0));
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
break;
case 4:
case 3:
// Collect one, two, or three totes, drive to Auto Zone (TM), release totes
AddSequential(new CollectTote(SmartDashboard::GetNumber("CollectToteTurn")));
if(SmartDashboard::GetBoolean("Two totes")){
@ -62,25 +53,13 @@ Autonomous::Autonomous(int seq){
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, 0.75));
AddSequential(new ReleaseTote());
break;
case 5:
// Same as auto 4, but navigate around bins
//TODO: Implement this
break;
case 6:
// Collect 1 bin and 1 tote
//TODO: Implement this
break;
case 7:
// Same as auto 4, then collect bin, drive to Auto Zone (TM), release totes
//TODO: Implement this
break;
case 8:
case 4:
//Use rear elevator to move tote
AddSequential(new Turn(1.8));
AddSequential(new AutoDrive(2.3, 0.0, -0.75));
AddSequential(new Turn(1.8));
break;
case 9:
case 5:
//Use rear elevator to move bin
AddSequential(new BinLower(0.1));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, 0.75));

View File

@ -15,7 +15,7 @@
class ElevatorCycle: public CommandGroup{
public:
/**
* @brief Constructs Elevatorcycle
* @brief Constructs ElevatorCycle
*/
ElevatorCycle();
};

View File

@ -9,13 +9,12 @@
*/
class Lower: public Command{
private:
bool softLimits;
bool softLimits; //<! Enables/Disables hall effect sensors
public:
/**
* @brief Constructs Lower
*
* @param timeout Timeout in seconds (default: 3.0)
*
* @param useSoftLimits Enables/Disables soft limits via hall effect sensors (default: true)
*/
Lower(double timeout = 3.0, bool useSoftLimits = true);

View File

@ -29,7 +29,7 @@ void DentRobot::RobotInit(){
// Amount of time to collect a tote
SmartDashboard::PutNumber("DriveTime", 1.3);
// Sequence of autonomous command
SmartDashboard::PutNumber("Auto Sequence", 9.0);
SmartDashboard::PutNumber("Auto Sequence", 1.0);
SmartDashboard::PutNumber("Auto Wait Time", 0.5);
// If the robot will be picking up three totes in sequence 3
SmartDashboard::PutBoolean("Two totes", false);
@ -42,12 +42,8 @@ void DentRobot::RobotInit(){
SmartDashboard::PutNumber("Auto Tote Distance", 0.5);
SmartDashboard::PutNumber("TurnAmount", 2.6);
// Elevators
SmartDashboard::PutBoolean("Bin Elevator Bottom", false);
SmartDashboard::PutBoolean("Bin Elevator Top", false);
SmartDashboard::PutBoolean("Elevator Bottom", false);
SmartDashboard::PutBoolean("Elevator Top", false);
//Drive speed
SmartDashboard::PutNumber("DriveSpeedReductionThresh", 2.0);
//Gyro
SmartDashboard::PutNumber("Gyro kP", -0.02);
}

View File

@ -37,15 +37,13 @@
+ Throttle - Adjusts collector speed
+ Button 1 - Collect totes
+ Button 2 - Eject totes
+ Button 7 - Check robot
#### Right Joystick (USB 1)
+ Button 3 - Lowers bin elevator
+ Button 4 - Lowers main elevator
+ Button 5 - Raises bin elevator
+ Button 6 - Raises main elevator
+ Button 7 - Opens bin arms (unused)
+ Button 8 - Closes bin arms (unused)
+ Button 7 - Runs an elevator cycle
+ Button 12 - Cancel raising and lowering for both elevators
### Dashboard
@ -57,12 +55,9 @@
+ Auto Zone Distance - Amount of time in seconds to drive to the auto zone (default: 2.1)
+ Auto Tote Distance - Amount of time in seconds to drive to a second or third tote if using Auto Sequence 4, 5, or 7 (default: 0.5)
+ Auto Bin Distance - Amount of time in seconds to drive to a bin if using Auto Sequence 6 or 7 (default: 0.5)
+ TurnAmount - Amount of time in seconds to turn the robot (default: 1.8)
+ Bin Elevator Bottom - Status of the bottom bin elevator sensor (unused)
+ Bin Elevator Top - Status of the top bin elevator sensor (unused)
+ TurnAmount - Amount of time in seconds to turn the robot 90 degrees
+ Elevator Bottom - Status of the bottom elevator sensor
+ Elevator Top - Status of the top elevator sensor
+ DriveSpeedReductionThresh - Maximum y value of the joystick when driving
+ Auto Sequence - The sequence of autonomous to run
#### Autonomous

View File

@ -18,11 +18,9 @@ double BinElevator::GetHeight(){
return elevatorEncoder->Get();
}
bool BinElevator::GetElevatorBottom(){
SmartDashboard::PutBoolean("Bin Elevator Bottom", elevatorBottom->Get());
return elevatorBottom->Get();
}
bool BinElevator::GetElevatorTop(){
SmartDashboard::PutBoolean("Bin Elevator Top", elevatorTop->Get());
return elevatorTop->Get();
}
// vim: ts=2:sw=2:et

View File

@ -24,7 +24,7 @@ void Drivetrain::DriveMecanum(double x, double y, double z, double sensitivity,
correctZ = -z * 0.5;
}
if(DentRobot::oi->GetLeftStick()->GetRawButton(9)){
correctY /= SmartDashboard::GetNumber("DriveSpeedReductionThresh");
correctY /= 2.0;
}
rightFront->Set((-correctX + correctY - correctZ));
leftFront->Set((correctX + correctY + correctZ)*-1);