示例#1
0
        static object Convert(Locationwp cmd, bool isint = false)
        {
            if (isint)
            {
                var temp = new MAVLink.mavlink_mission_item_int_t()
                {
                    command = cmd.id,
                    param1  = cmd.p1,
                    param2  = cmd.p2,
                    param3  = cmd.p3,
                    param4  = cmd.p4,
                    x       = (int)(cmd.lat * 1.0e7),
                    y       = (int)(cmd.lng * 1.0e7),
                    z       = (float)cmd.alt,
                    seq     = cmd._seq,
                    frame   = cmd._frame
                };

                return(temp);
            }
            else
            {
                var temp = new MAVLink.mavlink_mission_item_t()
                {
                    command = cmd.id,
                    param1  = cmd.p1,
                    param2  = cmd.p2,
                    param3  = cmd.p3,
                    param4  = cmd.p4,
                    x       = (float)cmd.lat,
                    y       = (float)cmd.lng,
                    z       = (float)cmd.alt,
                    seq     = cmd._seq,
                    frame   = cmd._frame
                };

                return(temp);
            }
        }
示例#2
0
 public static Item ConvertFromLocationwp(Locationwp locationwp)
 {
     return(locationwp);
 }
示例#3
0
 public PointLatLngAlt(Locationwp locwp)
 {
     this.Lat = locwp.lat;
     this.Lng = locwp.lng;
     this.Alt = locwp.alt;
 }