コード例 #1
0
ファイル: locationwp.cs プロジェクト: smalls2/watermelon
        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
ファイル: locationwp.cs プロジェクト: smalls2/watermelon
 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;
 }