Package se.bitcraze.crazyflie.client.controller

Examples of se.bitcraze.crazyflie.client.controller.AxisControlEvent


  }

  @Override
  public void onInput(InputEvent event) {
    if (event instanceof AxisControlEvent) {
      AxisControlEvent e = (AxisControlEvent) event;
      setYawAndTrust(e.getYaw(), e.getTrust());
      setRollAndPitch(e.getRoll(), e.getPitch());
      return;
    }
    if (event instanceof AltHoldEvent) {
      AltHoldEvent e = (AltHoldEvent) event;
      xyColor = e.isHold() ? Color.RED : Color.BLACK;
      return;
    }
  }
View Full Code Here


   * .crazyflie.client.controller.InputEvent)
   */
  @Override
  public void onInput(InputEvent event) {
    if (event instanceof AxisControlEvent) {
      AxisControlEvent e = (AxisControlEvent) event;
      if (crazyflie != null) {
        char thrust = 0;
        float t = e.getTrust() - 1.0f;
        thrust = (char) (Math.abs(t) * (Crtp.MAX_THRUST / 2));
        if (on && crazyflie.isConnected() && !window.isPlay()) {
          crazyflie.sendSetpoint(e.getRoll() * maxRoll, e.getPitch()
              * maxPitch, e.getYaw() * maxYaw, thrust);
          recorder.record(e.getRoll() * maxRoll, e.getPitch()
              * maxPitch, e.getYaw() * maxYaw, thrust);
        }
      }
      return;
    }
    if (event instanceof AltHoldEvent) {
      AltHoldEvent e = (AltHoldEvent) event;
      log.info("AltHold: " + e.isHold());
      crazyflie.setAltHold(e.isHold());
      return;
    }

    if (event instanceof StartEvent) {
      on = ((StartEvent) event).isOn();
View Full Code Here

TOP

Related Classes of se.bitcraze.crazyflie.client.controller.AxisControlEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.