mirror of
https://github.com/team2059/Dent
synced 2025-01-07 22:14:14 -05:00
made buttons more logical...again
This commit is contained in:
parent
55896799cd
commit
69e7efabf0
@ -31,7 +31,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", 1.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);
|
||||||
@ -72,10 +72,6 @@ void DentRobot::TeleopInit() {
|
|||||||
}
|
}
|
||||||
void DentRobot::TeleopPeriodic() {
|
void DentRobot::TeleopPeriodic() {
|
||||||
Scheduler::GetInstance()->Run();
|
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());
|
SmartDashboard::PutNumber("CollectorThrottle", oi->GetLeftThrottle());
|
||||||
}
|
}
|
||||||
void DentRobot::TestPeriodic() {}
|
void DentRobot::TestPeriodic() {}
|
||||||
|
19
OI.cpp
19
OI.cpp
@ -36,26 +36,17 @@ OI::OI() {
|
|||||||
//Open front collector wheels
|
//Open front collector wheels
|
||||||
left9->WhenPressed(new BinOpenArms(2));
|
left9->WhenPressed(new BinOpenArms(2));
|
||||||
left10->WhenPressed(new BinCloseArms(2));
|
left10->WhenPressed(new BinCloseArms(2));
|
||||||
|
|
||||||
// Elevator
|
// 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 *right4 = new JoystickButton(rightStick, 4);
|
||||||
JoystickButton *right6 = new JoystickButton(rightStick, 6);
|
JoystickButton *right6 = new JoystickButton(rightStick, 6);
|
||||||
left11->WhenPressed(new OpenArm(2));
|
JoystickButton *right11 = new JoystickButton(rightStick, 11);
|
||||||
left12->WhenPressed(new CloseArm(2));
|
JoystickButton *right12 = new JoystickButton(rightStick, 12);
|
||||||
|
right11->WhenPressed(new OpenArm(2));
|
||||||
|
right12->WhenPressed(new CloseArm(2));
|
||||||
//Full speed lift
|
//Full speed lift
|
||||||
right4->WhileHeld(new Lower(3.5,false,1));
|
right4->WhileHeld(new Lower(3.5,false,1));
|
||||||
right6->WhileHeld(new Raise(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() {
|
Joystick* OI::GetRightStick() {
|
||||||
return rightStick;
|
return rightStick;
|
||||||
|
17
OI.h
17
OI.h
@ -19,23 +19,6 @@ class OI {
|
|||||||
/**
|
/**
|
||||||
* Raise command
|
* 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
|
* @brief Returns the right joystick
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user