Пример #1
0
//Controls motion of arm
void Arm::OperateArm() {
    AutoArm();
    //Controlled by right analog stick
    if (xboxController->GetRawAxis(5) >= 0.2 || xboxController->GetRawAxis(5) <= -0.2) {  //Absolute value of controller stick
        RaiseArm(xboxController->GetRawAxis(5));
    }

    //Controlled by hat switch on top of joystick
    else if (joystick->GetRawAxis(6) > 0.0)
        RaiseArm(1);
    else if (joystick->GetRawAxis(6) < -0.0)
        LowerArm(1);
    else if (!automatic)
        StopArm();
}
Пример #2
0
//Automatically lowers and raises the arm all the way to the top/bottom on the press of a button
void Arm::AutoArm() {

    if (xboxController->GetRawButton(1)) {
        RaiseArm(1);
        automatic = true;
    }
    else if (xboxController->GetRawButton(2)) {
        LowerArm(1);
        automatic = true;
    }
}
Пример #3
0
// Optionally raises the arm to clear the bridge, then lowers it.
// TODO - Get minimum angle to clear bridge in neutral position
void TipBridge::Execute() {
  if (needsReset) {
    if (!moving) { RaiseArm(); }
    if (accelerometer->GetArmDegree() > 35.0) {
      needsReset = false;
      StopArm();
    }
  } else {
    LowerArm();
  }
}