In MSDK V5, we can use GimbalKey.KeyGimbalAttitude to obtain the gimbal's attitude, the Yaw indicates the gimbal's orientation.
The orientation obtained from KeyGimbalAttitude is based on the navigation coordinate system, while waypoint files usually use the geodetic coordinate system. Below is the method to convert the orientation obtained from KeyGimbalAttitude into the geodetic coordinate system orientation.
For M300 and M350:
- Call performAction on FlightControllerKey.KeySubscribePack and pass SubscirbePackType.IMU_COORDINATE_TRAN as a parameter;
- Listen to FlightControllerKey.KeyImuCoordinateTran to get the radian deviation value;
- Convert the obtained radian to degrees and add it to the value obtained from KeyGimbalAttitude.
For Mavic 3 Enterprise and M30 series:
- Listen to FlightControllerKey.KeyImuCoordinateTran to get the radian deviation value;
- Convert the obtained radian to degrees and add it to the value obtained from KeyGimbalAttitude.
Comments
0 comments
Please sign in to leave a comment.