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

made buttons more logical...again

This commit is contained in:
Adam Long 2015-10-10 07:08:21 +00:00
parent 55896799cd
commit 69e7efabf0
3 changed files with 6 additions and 36 deletions

View File

@ -31,7 +31,7 @@ void DentRobot::RobotInit() {
// Amount of time to collect a tote
SmartDashboard::PutNumber("DriveTime", 1.3);
// Sequence of autonomous command
SmartDashboard::PutNumber("Auto Sequence", 1.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);
@ -72,10 +72,6 @@ void DentRobot::TeleopInit() {
}
void DentRobot::TeleopPeriodic() {
Scheduler::GetInstance()->Run();
if(elevator->GetUseEncoder()&&elevator->GetHeight() <= -1.0) {
// Raise the elevator if it dips below elevatorTop
oi->raise->Start();
}
SmartDashboard::PutNumber("CollectorThrottle", oi->GetLeftThrottle());
}
void DentRobot::TestPeriodic() {}

19
OI.cpp
View File

@ -36,26 +36,17 @@ OI::OI() {
//Open front collector wheels
left9->WhenPressed(new BinOpenArms(2));
left10->WhenPressed(new BinCloseArms(2));
// Elevator
raise = new Raise(3.5,false,1);
lower = new Lower(3.0);
cycle = new ElevatorCycle();
JoystickButton *left11 = new JoystickButton(leftStick, 11);
JoystickButton *left12 = new JoystickButton(leftStick, 12);
JoystickButton *right4 = new JoystickButton(rightStick, 4);
JoystickButton *right6 = new JoystickButton(rightStick, 6);
left11->WhenPressed(new OpenArm(2));
left12->WhenPressed(new CloseArm(2));
JoystickButton *right11 = new JoystickButton(rightStick, 11);
JoystickButton *right12 = new JoystickButton(rightStick, 12);
right11->WhenPressed(new OpenArm(2));
right12->WhenPressed(new CloseArm(2));
//Full speed lift
right4->WhileHeld(new Lower(3.5,false,1));
right6->WhileHeld(new Raise(3.5,false,-1));
// BinCollector
JoystickButton *left3 = new JoystickButton(leftStick, 3);
JoystickButton *left4 = new JoystickButton(leftStick, 4);
left3->WhileHeld(new BinIn(2.0));
left4->WhileHeld(new BinOut(2.0));
}
Joystick* OI::GetRightStick() {
return rightStick;

17
OI.h
View File

@ -19,23 +19,6 @@ class OI {
/**
* Raise command
*/
Command *raise,
/**
* @brief Lower command
*/
*lower,
/**
* @brief BinLower command
*/
*binLower,
/**
* @brief BinRaise command
*/
*binRaise;
/**
* @brief ElevatorCycle commandgroup
*/
CommandGroup *cycle;
/**
* @brief Returns the right joystick
*