RoboMaster-SDK icon indicating copy to clipboard operation
RoboMaster-SDK copied to clipboard

Directly access TOF data?

Open MrCampbellDuchess opened this issue 2 years ago • 4 comments

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?

MrCampbellDuchess avatar Oct 13 '22 20:10 MrCampbellDuchess

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

danifuertes avatar Jan 11 '24 14:01 danifuertes

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.

brunoga avatar Jan 11 '24 15:01 brunoga

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

You need to use subscribe function to get tof data

issues/90

alexchenfeng avatar Jan 11 '24 23:01 alexchenfeng

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

danifuertes avatar Feb 06 '24 16:02 danifuertes