2
0
mirror of https://github.com/team2059/Dent synced 2025-01-17 22:19:21 -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: case 0:
// Just for testing // Just for testing
// Turn testing // Turn testing
AddSequential(new Turn(3.8)); AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
break; break;
case 1: case 1:
// Drive to Auto Zone (TM) // Drive to Auto Zone (TM)
@ -24,15 +24,6 @@ Autonomous::Autonomous(int seq){
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount"))); AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
break; break;
case 2: 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) // Collect a tote with BinElevator, turn, drive to Auto Zone (TM)
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount"))); AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
AddSequential(new BinRaise(1.2)); AddSequential(new BinRaise(1.2));
@ -40,7 +31,7 @@ Autonomous::Autonomous(int seq){
AddSequential(new BinLower(1.0)); AddSequential(new BinLower(1.0));
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount"))); AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
break; break;
case 4: case 3:
// Collect one, two, or three totes, drive to Auto Zone (TM), release totes // Collect one, two, or three totes, drive to Auto Zone (TM), release totes
AddSequential(new CollectTote(SmartDashboard::GetNumber("CollectToteTurn"))); AddSequential(new CollectTote(SmartDashboard::GetNumber("CollectToteTurn")));
if(SmartDashboard::GetBoolean("Two totes")){ 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 AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, 0.75));
AddSequential(new ReleaseTote()); AddSequential(new ReleaseTote());
break; break;
case 5: case 4:
// 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:
//Use rear elevator to move tote //Use rear elevator to move tote
AddSequential(new Turn(1.8)); AddSequential(new Turn(1.8));
AddSequential(new AutoDrive(2.3, 0.0, -0.75)); AddSequential(new AutoDrive(2.3, 0.0, -0.75));
AddSequential(new Turn(1.8)); AddSequential(new Turn(1.8));
break; break;
case 9: case 5:
//Use rear elevator to move bin //Use rear elevator to move bin
AddSequential(new BinLower(0.1)); AddSequential(new BinLower(0.1));
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, 0.75)); AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, 0.75));

View File

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

View File

@ -9,13 +9,12 @@
*/ */
class Lower: public Command{ class Lower: public Command{
private: private:
bool softLimits; bool softLimits; //<! Enables/Disables hall effect sensors
public: public:
/** /**
* @brief Constructs Lower * @brief Constructs Lower
* *
* @param timeout Timeout in seconds (default: 3.0) * @param timeout Timeout in seconds (default: 3.0)
*
* @param useSoftLimits Enables/Disables soft limits via hall effect sensors (default: true) * @param useSoftLimits Enables/Disables soft limits via hall effect sensors (default: true)
*/ */
Lower(double timeout = 3.0, bool useSoftLimits = 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 // Amount of time to collect a tote
SmartDashboard::PutNumber("DriveTime", 1.3); SmartDashboard::PutNumber("DriveTime", 1.3);
// Sequence of autonomous command // Sequence of autonomous command
SmartDashboard::PutNumber("Auto Sequence", 9.0); SmartDashboard::PutNumber("Auto Sequence", 1.0);
SmartDashboard::PutNumber("Auto Wait Time", 0.5); SmartDashboard::PutNumber("Auto Wait Time", 0.5);
// 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("Two totes", false); SmartDashboard::PutBoolean("Two totes", false);
@ -42,12 +42,8 @@ void DentRobot::RobotInit(){
SmartDashboard::PutNumber("Auto Tote Distance", 0.5); SmartDashboard::PutNumber("Auto Tote Distance", 0.5);
SmartDashboard::PutNumber("TurnAmount", 2.6); SmartDashboard::PutNumber("TurnAmount", 2.6);
// Elevators // Elevators
SmartDashboard::PutBoolean("Bin Elevator Bottom", false);
SmartDashboard::PutBoolean("Bin Elevator Top", false);
SmartDashboard::PutBoolean("Elevator Bottom", false); SmartDashboard::PutBoolean("Elevator Bottom", false);
SmartDashboard::PutBoolean("Elevator Top", false); SmartDashboard::PutBoolean("Elevator Top", false);
//Drive speed
SmartDashboard::PutNumber("DriveSpeedReductionThresh", 2.0);
//Gyro //Gyro
SmartDashboard::PutNumber("Gyro kP", -0.02); SmartDashboard::PutNumber("Gyro kP", -0.02);
} }

View File

@ -37,15 +37,13 @@
+ Throttle - Adjusts collector speed + Throttle - Adjusts collector speed
+ Button 1 - Collect totes + Button 1 - Collect totes
+ Button 2 - Eject totes + Button 2 - Eject totes
+ Button 7 - Check robot
#### Right Joystick (USB 1) #### Right Joystick (USB 1)
+ Button 3 - Lowers bin elevator + Button 3 - Lowers bin elevator
+ Button 4 - Lowers main elevator + Button 4 - Lowers main elevator
+ Button 5 - Raises bin elevator + Button 5 - Raises bin elevator
+ Button 6 - Raises main elevator + Button 6 - Raises main elevator
+ Button 7 - Opens bin arms (unused) + Button 7 - Runs an elevator cycle
+ Button 8 - Closes bin arms (unused)
+ Button 12 - Cancel raising and lowering for both elevators + Button 12 - Cancel raising and lowering for both elevators
### Dashboard ### Dashboard
@ -57,12 +55,9 @@
+ Auto Zone Distance - Amount of time in seconds to drive to the auto zone (default: 2.1) + 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 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) + 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) + TurnAmount - Amount of time in seconds to turn the robot 90 degrees
+ Bin Elevator Bottom - Status of the bottom bin elevator sensor (unused)
+ Bin Elevator Top - Status of the top bin elevator sensor (unused)
+ Elevator Bottom - Status of the bottom elevator sensor + Elevator Bottom - Status of the bottom elevator sensor
+ Elevator Top - Status of the top 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 + Auto Sequence - The sequence of autonomous to run
#### Autonomous #### Autonomous

View File

@ -18,11 +18,9 @@ double BinElevator::GetHeight(){
return elevatorEncoder->Get(); return elevatorEncoder->Get();
} }
bool BinElevator::GetElevatorBottom(){ bool BinElevator::GetElevatorBottom(){
SmartDashboard::PutBoolean("Bin Elevator Bottom", elevatorBottom->Get());
return elevatorBottom->Get(); return elevatorBottom->Get();
} }
bool BinElevator::GetElevatorTop(){ bool BinElevator::GetElevatorTop(){
SmartDashboard::PutBoolean("Bin Elevator Top", elevatorTop->Get());
return elevatorTop->Get(); return elevatorTop->Get();
} }
// vim: ts=2:sw=2:et // 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; correctZ = -z * 0.5;
} }
if(DentRobot::oi->GetLeftStick()->GetRawButton(9)){ if(DentRobot::oi->GetLeftStick()->GetRawButton(9)){
correctY /= SmartDashboard::GetNumber("DriveSpeedReductionThresh"); correctY /= 2.0;
} }
rightFront->Set((-correctX + correctY - correctZ)); rightFront->Set((-correctX + correctY - correctZ));
leftFront->Set((correctX + correctY + correctZ)*-1); leftFront->Set((correctX + correctY + correctZ)*-1);