mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
added new auto, changed default parameters for raise and lower, ran astyle
This commit is contained in:
parent
e2a614de87
commit
34e05baf56
@ -5,6 +5,8 @@
|
|||||||
#include "../Elevator/Lower.h"
|
#include "../Elevator/Lower.h"
|
||||||
#include "../BinElevator/BinRaise.h"
|
#include "../BinElevator/BinRaise.h"
|
||||||
#include "../BinElevator/BinLower.h"
|
#include "../BinElevator/BinLower.h"
|
||||||
|
#include "../BinCollector/BinCloseClaw.h"
|
||||||
|
#include "../BinCollector/BinOpenClaw.h"
|
||||||
#include "AutoDrive.h"
|
#include "AutoDrive.h"
|
||||||
#include "Turn.h"
|
#include "Turn.h"
|
||||||
#include "../Collector/RollIn.h"
|
#include "../Collector/RollIn.h"
|
||||||
@ -25,11 +27,12 @@ Autonomous::Autonomous(int seq) {
|
|||||||
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
|
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
//Collect a bin upright into the robot upright, turn, drive to Auto Zone (TM),turn
|
//Collect a bin upright into the robot upright and raise elevator
|
||||||
AddSequential(new RollIn(1.0));
|
AddSequential(new BinOpenClaw());
|
||||||
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
|
AddSequential(new CollectTote());
|
||||||
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, -0.75));
|
AddSequential(new BinCloseClaw());
|
||||||
AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount")));
|
AddParallel(new AutoDrive(SmartDashboard::GetNumber("DriveTime2"), 0.0, 0.75, 0, false));
|
||||||
|
AddSequential(new Raise(2.5,false,-1));
|
||||||
break;
|
break;
|
||||||
case 3:
|
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
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "AutoDrive.h"
|
#include "AutoDrive.h"
|
||||||
#include "../Collector/RollIn.h"
|
#include "../Collector/RollIn.h"
|
||||||
CollectTote::CollectTote(double z) {
|
CollectTote::CollectTote(double z) {
|
||||||
AddParallel(new AutoDrive(SmartDashboard::GetNumber("DriveTime"), 0.0, 0.75, z, false));
|
AddParallel(new AutoDrive(SmartDashboard::GetNumber("DriveTime1"), 0.0, 0.75, z, false));
|
||||||
AddSequential(new RollIn(1.0));
|
AddSequential(new RollIn(1.0));
|
||||||
}
|
}
|
||||||
// vim: ts=2:sw=2:et
|
// vim: ts=2:sw=2:et
|
||||||
|
@ -21,7 +21,7 @@ class Lower: public Command {
|
|||||||
*
|
*
|
||||||
* @param liftSpeed Speed at which to lower the lift
|
* @param liftSpeed Speed at which to lower the lift
|
||||||
*/
|
*/
|
||||||
Lower(double timeout = 3.0, bool useSoftLimits = true, double liftSpeed=0);
|
Lower(double timeout = 3.0, bool useSoftLimits = true, double liftSpeed=1);
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the class
|
* @brief Initializes the class
|
||||||
*/
|
*/
|
||||||
|
@ -21,7 +21,7 @@ class Raise: public Command {
|
|||||||
*
|
*
|
||||||
* @param liftSpeed Speed at which to raise the elevator
|
* @param liftSpeed Speed at which to raise the elevator
|
||||||
*/
|
*/
|
||||||
Raise(double timeout = 3.5, bool useSoftLimits = true, double liftSpeed=0);
|
Raise(double timeout = 3.5, bool useSoftLimits = true, double liftSpeed=-1);
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the class
|
* @brief Initializes the class
|
||||||
*/
|
*/
|
||||||
|
@ -29,7 +29,8 @@ void DentRobot::RobotInit() {
|
|||||||
// Amount to turn while collecting the initial tote in auto 4
|
// Amount to turn while collecting the initial tote in auto 4
|
||||||
SmartDashboard::PutNumber("CollectToteTurn", 0.25);
|
SmartDashboard::PutNumber("CollectToteTurn", 0.25);
|
||||||
// Amount of time to collect a tote
|
// Amount of time to collect a tote
|
||||||
SmartDashboard::PutNumber("DriveTime", 1.3);
|
SmartDashboard::PutNumber("DriveTime1", 1.3);
|
||||||
|
SmartDashboard::PutNumber("DriveTime2", 1.3);
|
||||||
// Sequence of autonomous command
|
// Sequence of autonomous command
|
||||||
SmartDashboard::PutNumber("Auto Sequence", -1.0);
|
SmartDashboard::PutNumber("Auto Sequence", -1.0);
|
||||||
SmartDashboard::PutNumber("Auto Wait Time", 0.5);
|
SmartDashboard::PutNumber("Auto Wait Time", 0.5);
|
||||||
|
@ -16,7 +16,7 @@ void Pneumatics::SetArmsOpen(bool state) {
|
|||||||
solenoid2->Set(!state);
|
solenoid2->Set(!state);
|
||||||
armState=state;
|
armState=state;
|
||||||
}
|
}
|
||||||
void Pneumatics::SetClawOpen(bool state){
|
void Pneumatics::SetClawOpen(bool state) {
|
||||||
solenoid3->Set(state);
|
solenoid3->Set(state);
|
||||||
solenoid4->Set(!state);
|
solenoid4->Set(!state);
|
||||||
clawState=state;
|
clawState=state;
|
||||||
|
Loading…
Reference in New Issue
Block a user