mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Merge branch 'develop'
This commit is contained in:
parent
42fbba836a
commit
08473d42e1
@ -13,7 +13,7 @@ void RollIn::Execute(){
|
|||||||
//}else{
|
//}else{
|
||||||
// DentRobot::collector->MoveRollers(cvt*1.5);
|
// DentRobot::collector->MoveRollers(cvt*1.5);
|
||||||
//}
|
//}
|
||||||
DentRobot::collector->MoveRollers(DentRobot::oi->GetLeftThrottle() * 1.0);
|
DentRobot::collector->MoveRollers(DentRobot::oi->GetLeftAxis("left", "throttle") * 1.0);
|
||||||
}
|
}
|
||||||
bool RollIn::IsFinished(){
|
bool RollIn::IsFinished(){
|
||||||
return IsTimedOut();
|
return IsTimedOut();
|
||||||
|
@ -7,8 +7,8 @@ void RollOut::Initialize(){
|
|||||||
}
|
}
|
||||||
void RollOut::Execute(){
|
void RollOut::Execute(){
|
||||||
// Divide by 2 twice because this speed should be half the collector speed
|
// Divide by 2 twice because this speed should be half the collector speed
|
||||||
DentRobot::collector->MoveRollers(-DentRobot::oi->GetLeftThrottle() * 0.8);
|
DentRobot::collector->MoveRollers(-DentRobot::oi->GetLeftAxis("right", "trigger") * 0.8);
|
||||||
SmartDashboard::PutNumber("DriveThrottle", -DentRobot::oi->GetLeftThrottle());
|
SmartDashboard::PutNumber("DriveThrottle", -DentRobot::oi->GetLeftAxis("right", "trigger"));
|
||||||
}
|
}
|
||||||
bool RollOut::IsFinished(){
|
bool RollOut::IsFinished(){
|
||||||
return IsTimedOut();
|
return IsTimedOut();
|
||||||
|
@ -18,7 +18,7 @@ void Drive::Execute(){
|
|||||||
// y=0;
|
// y=0;
|
||||||
//}
|
//}
|
||||||
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle)
|
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle)
|
||||||
if(DentRobot::oi->GetLeftStick()->GetRawButton(11)){
|
if(DentRobot::oi->GetLeftButton("y")){
|
||||||
x = -x;
|
x = -x;
|
||||||
y = -y;
|
y = -y;
|
||||||
}
|
}
|
||||||
|
18
OI.cpp
18
OI.cpp
@ -27,24 +27,34 @@ OI::OI(){
|
|||||||
// Left, right stick press
|
// Left, right stick press
|
||||||
leftLPress = new JoystickButton(leftController, 9);
|
leftLPress = new JoystickButton(leftController, 9);
|
||||||
leftRPress = new JoystickButton(leftController, 10);
|
leftRPress = new JoystickButton(leftController, 10);
|
||||||
|
|
||||||
|
// Commands
|
||||||
|
Raise *raise = new Raise(2.0);
|
||||||
|
Lower *lower = new Lower(2.0);
|
||||||
|
leftA->WhileHeld(raise);
|
||||||
|
leftA->CancelWhenPressed(lower);
|
||||||
|
leftB->WhenPressed(lower);
|
||||||
|
leftB->CancelWhenPressed(raise);
|
||||||
}
|
}
|
||||||
float OI::GetLeftAxis(std::string stick, std::string axis){
|
float OI::GetLeftAxis(std::string stick, std::string axis){
|
||||||
if(stick=="left"){
|
if(stick=="left"){
|
||||||
if(axis=="x"){
|
if(axis=="x"){
|
||||||
return leftController->GetX();
|
return leftController->GetRawAxis(0);
|
||||||
}else if(axis=="y"){
|
}else if(axis=="y"){
|
||||||
return -leftController->GetY();
|
return -leftController->GetRawAxis(1);
|
||||||
}else if(axis=="trigger"){
|
}else if(axis=="trigger"){
|
||||||
//TODO: Figure out what axis this is
|
//TODO: Figure out what axis this is
|
||||||
|
return leftController->GetRawAxis(4);
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
}else if(stick=="right"){
|
}else if(stick=="right"){
|
||||||
if(axis=="x"){
|
if(axis=="x"){
|
||||||
return leftController->GetTwist();
|
return leftController->GetRawAxis(2);
|
||||||
}else if(axis=="y"){
|
}else if(axis=="y"){
|
||||||
return -leftController->GetRawAxis(4);
|
return -leftController->GetRawAxis(3);
|
||||||
}else if(axis=="trigger"){
|
}else if(axis=="trigger"){
|
||||||
//TODO: Figure out what axis this is
|
//TODO: Figure out what axis this is
|
||||||
|
return leftController->GetRawAxis(5);
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user