Ejemplo n.º 1
0
        private async Task GoTo(GeoPoint location, MavFrame frame, CancellationToken cancel, double?yawDeg = null, double?vx = null, double?vy = null, double?vz = null)
        {
            await EnsureInGuidedMode(cancel).ConfigureAwait(false);


            var yaw = yawDeg.HasValue ? (float?)GeoMath.DegreesToRadians(yawDeg.Value) : null;
            await Mavlink.Common.SetPositionTargetGlobalInt(0, frame, cancel, (int)(location.Latitude * 10000000), (int)(location.Longitude * 10000000), (float)location.Altitude, yaw : yaw).ConfigureAwait(false);
        }
Ejemplo n.º 2
0
        private async Task GoTo(GeoPoint location, MavFrame frame, CancellationToken cancel, double?yawDeg = null, double?vx = null, double?vy = null, double?vz = null)
        {
            await EnsureInGuidedMode(cancel);

            if (location.Altitude.HasValue == false)
            {
                throw new MavlinkException(RS.VehicleArdupilot_GoTo_Altitude_of_end_point_is_null);
            }

            var yaw = yawDeg.HasValue ? (float?)GeoMath.DegreesToRadians(yawDeg.Value) : null;
            await Mavlink.Common.SetPositionTargetGlobalInt(0, frame, cancel, (int)(location.Latitude * 10000000), (int)(location.Longitude * 10000000), (float)location.Altitude.Value, yaw : yaw);
        }