dji-sdk / Onboard-SDK

DJI Onboard SDK Official Repository
https://github.com/dji-sdk/Onboard-SDK
Other
909 stars 634 forks source link

Inverted logic in rotateSync #888

Open ahmed-elsaharti opened 2 years ago

ahmed-elsaharti commented 2 years ago

Hi folks! It seems like in the latest change to the rotateSync API, the logic mentioned in the code-comments was inverted.

According to the logic in rotateSync's definition , if rotation.rotationMode is set to 0, settings.reference gets set to 1 and setting.coordinate is set to 0. This results in: settings.coordinate = 0 -> use drone coordinate, reference bit will work settings.reference = 1 -> execute angle command based on current point. This would result in the gimbal moving relative to its previous location. However, the comment in the code suggests that when rotation.rotationMode is set to 0 we should expect execute angle command based on ground frame as the horizontal frame (NEU).

Also, it looks like the change done in #797 was only added to rotateSync while rotateAsync still has the old logic.

Thanks

dji-dev commented 2 years ago

Agent comment from kyle.cai in Zendesk ticket #67905:

Dear developer ,

Thank you for contacting DJI.

Sorry for the inconvenience, you are right, after this modification, the definition of rotationMode needs to be changed, /*! rotation cooradiration

rotateAsync also needs to be fixed, we have submitted a request.

Thank you for your understanding and support, hope you have a nice day.

Best Regards, DJI SDK Support Team

°°°