Package se.bitcraze.crazyflie

Examples of se.bitcraze.crazyflie.Crazyflie


    if (ArrayUtils.isEmpty(uris)) {
      log.error("No Interfaces are found");
      return;
    }
    log.info("Found: {}", Arrays.toString(uris));
    Crazyflie crazyflie = new Crazyflie();
    Logging logging = crazyflie.getLogging();
    crazyflie.addListener(new LogListener() {

      @Override
      public void valuesReceived(String name, Map<String, Object> values) {
        log.info("{}", values.toString());
      }
    }, "stabilizer", "baro");
    crazyflie.getLogging().addGroup("stabilizer", 200, "stabilizer.roll",
        "stabilizer.pitch", "stabilizer.yaw", "stabilizer.thrust");
    crazyflie.getLogging().addGroup("baro", 200, "baro.aslLong",
        "baro.temp", "baro.pressure");
    logging.startAll();
    crazyflie.addListener(new ConnectionListener() {

      @Override
      public void linkQualityUpdate(CrtpDriver l, int quality) {
        // log.info("linkQualityUpdate: {}", quality);
      }

      @Override
      public void disconnected(CrtpDriver l) {
        log.info("disconnected");
      }

      @Override
      public void connectionSetupFinished(CrtpDriver l) {
        log.info("connectionSetupFinished");
      }

      @Override
      public void connectionLost(CrtpDriver l) {
        log.info("connectionLost");

      }

      @Override
      public void connectionInitiated(CrtpDriver l) {
        log.info("connectionInitiated");

      }

      @Override
      public void connectionFailed(CrtpDriver l) {
        log.info("connectionFailed");

      }
    });
    try {
      crazyflie.connect(uris[0]);

      while (!Thread.currentThread().isInterrupted())
        Thread.sleep(1000);
    } finally {
      crazyflie.disconnect();
    }
  }
View Full Code Here


    }

    p.load(getClass().getClassLoader().getResourceAsStream(
        "FlightControl.properties"));
    log.info("Load Properties: {}", p);
    crazyflie = new Crazyflie();
    crazyflie.addListener(new ConnectionAdapter() {

      @Override
      public void connectionSetupFinished(CrtpDriver driver) {
        super.connectionSetupFinished(driver);
View Full Code Here

TOP

Related Classes of se.bitcraze.crazyflie.Crazyflie

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.