Please select Into the mobile phone version | Continue to access the computer ver.
Close
You need to log in before you can reply       Login | Register now

[Discussion] Query the Matrice battery/position

Author: ChrisJagielski 2017-5-13 05:54
5 189
Hi!

I'm thinking of how best to query the Matrice battery & position.  (I have a Matrice 600).  I'm just curious if I can get this data with my connected computer.

Is it OK to just make a loop which calls the api->getBroadcastData() every so often?  For example, in partial pseudo-code:

while ()
{
    // query the drone's position
    PositionData curPosition = api->getBroadcastData().pos;

    // query the drone's battery
    BatteryData battery = api->getBroadcastData().battery;

    // sleep so I don't consume too much CPU
    sleep(1);
}


Thanks!
- Chris
Reply
Replies
hmoraes4
Did you check if your version API provides callback methods for these items?
2017-5-18 02:07
ChrisJagielski
Yes it does - I'm looking at the onboard SDK which I downloaded online.  I'm going to have a little computer connected to the Matrice 600 (it'll be a payload) and I'm just trying to figure out my capabilities here. Thanks!
2017-5-18 07:43
hmoraes4
ChrisJagielski Posted at 2017-5-18 07:43
Yes it does - I'm looking at the onboard SDK which I downloaded online.  I'm going to have a little  ...

Anytime! Good luck!
2017-5-18 23:58
cmercier
Your code should work as long as you previously activated the A3 correctly. I'm doing something similar and it works.
2017-5-19 20:51
ChrisJagielski
Awesome thanks!
2017-5-20 01:05
You need to log in before you can reply Login | Register now

Quick Reply Back to top Back to list
Quick Reply Back to top Back to list