Telemetry

Overview

If you find any problems or bugs when you are using the tutorials, please submit a issue in the github to inform us. We are glad to receive any pull request from the Github, and help you to repair those issues.

Telemetry class in the SDK provides listeners to get various information such as:

  1. Battery level of the drone
  2. Flight mode
  3. GPS info
  4. Health of the drone
  5. RC Status
  6. Ground speed and many more

Please refer the API documentation for more information about various features provided by Telemetry class. The follow code snippet demonstrates how to register to Battery listener in Telemetry class and get call backs regarding the battery level of the drone. 


public static void registerBatteryListener ( final Context context )
   {
       Telemetry.BatteryListener batteryListener = new Telemetry.BatteryListener ( )
         {
            @Override
            public void onBatteryCallback ( Telemetry.Battery battery ) {
               // Handle the result
               Log.d ( TAG, 
               String.format ( "%d", ( int ) ( 100 * battery.remainingPercent ) ) );
            }
         };
      Telemetry.setBatteryListener ( batteryListener );
   }

Similarly, you can register to various listeners and get callbacks. Also remember to unregister the listeners when no longer needed in the app.