dji-sdk / RoboMaster-SDK

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

RM SDK can't get the Infrared Distance Sensor data #90

Closed alexchenfeng closed 1 year ago

alexchenfeng commented 1 year ago

Hi:

I meet a sdk problem, can't get Infrared Distance Sensor data, when only using plaintext sdk I can get Sensor data, so how can I using the RM Python SDK to get the data?

I review the SDK code, found that I need to construct a protoco object for IR Distance Sensor, then using self._client.send_sync_msg(msg) function to send the msg to the robot, but what is the _cmdset and _cmdid of IR Distance Sensor.

Thank you.

brunoga commented 1 year ago

You are not supposed to use protos directly or manually send them to the robot. You are supposed to use the higher level API. Check sensor.py in the SDK. You will see there is a DistanceSensor class.