【Introduction】
- This article will conclude a user manual for GimbalKey.
【Basic function】
- You can setup a listener for KeyGimbalAttitude to get the gimbal attitude. The 0 degree of pitch and roll angle means aircraft heading direction. The yaw degree is using N-E-D coordinate system. If you want to get the yaw angle of the gimbal related with the aircraft heading, you can use KeyYawRelativeToAircraftHeading.
- You can use a to configure the gimbal mode. Not all aircraft supports the 3 type of gimbal mode in GimbalMode enum, you need to double check with the DJI Pilot 2.
【Calibration】
- Normally we will calibrate the gimbal if the app is alert or there is a small gimbal offset after reseting it.
- You can use KeyGimbalCalibrate to start the gimbal self calibration, you can use KeyGimbalCalibrationStatus to view the calibration status.
- If the above calibration is effectless, you need to manually calibrate the gimbal through KeyFineTunePitchInDegrees, KeyFineTuneYawInDegrees and KeyFineTuneRollInDegrees. Every time you call these keys will make the gimbal offsets for 2 degrees. You can use KeyFineTunePitchTotalDegree, KeyFineTuneYawTotalDegree and KeyFineTuneRollTotalDegree to get the total offsets.
【Gimbal operation】
- The gimbal can rotate according to a specific angle by calling KeyRotateByAngle and rotate according to the angular speed. In addition to setting the angle and rotation mode, it is also necessary to set the rotation duration, and its value cannot be less than or equal to 0.
- Call KeyGimbalReset will make the gimbal reset. Its input parameter GimbalResetType supports RECENTER,, PITCH_YAW, ONLY_PITCH, ONLY_ROLL, ONLY_YAW etc.
Comments
2 comments
I have a button which is used to rotate gimbal with angle rotate is 180 degrees. What should I do to code it? Thank you
When I use KeyGimbalAttitude, the Yaw is -75 degrees off. When I point the drone (Mini3 Pro) exactly north (0 degrees - based on the display in the Default Layout app), the KeyGimbalAttitude message is giving me -75.20 degrees.
What's wrong here? Why the offset?
Edit: Solved - just had to recalibrate the gimbal.. example code:
Please sign in to leave a comment.