dji-sdk / RoboMaster-SDK

DJI RoboMaster Python SDK and Sample Code for RoboMaster EP.
Apache License 2.0
312 stars 141 forks source link

Directly access TOF data? #78

Open MrCampbellDuchess opened 1 year ago

MrCampbellDuchess commented 1 year ago

So I'm trying to access the TOF data directly to control the movement of the bot.

I know I can subscribe to the data from the TOF sensor it its own function but how can I use that data outside the function?

I'd like to be able to run an "if [TOFDistance] < 20" situation. Is this possible?

danifuertes commented 5 months ago

Any news on this topic? I am facing the same problem

brunoga commented 5 months ago

There are several ways to do that but none of them are actually specific to the SDK. You could, for example, write the update to a global variable and then read that anywhere in your code. Not the cleanest way to do it but the simplest one.

alexchenfeng commented 5 months ago

Any news on this topic? I am facing the same problem

You need to use subscribe function to get tof data

issues/90

danifuertes commented 5 months ago

Sorry for the late response. Thank you for your answers. I will give it a try!