Example #1
0
        public void AbortWaypoints()
        {
            SCommGotoExecute executeWaypointsCmd = new SCommGotoExecute();

            executeWaypointsCmd.Command = 10; // abort trajectory

            // Send
            byte[] toSend = Comm.GetBytes(executeWaypointsCmd);
            formMain.SendData(0x80, toSend);
        }
Example #2
0
        public void ExecuteWaypoints(float velocity)
        {
            SCommGotoExecute executeWaypointsCmd = new SCommGotoExecute();

            executeWaypointsCmd.Command  = 0x02; // execute trajectory
            executeWaypointsCmd.Velocity = velocity;

            // Send
            byte[] toSend = Comm.GetBytes(executeWaypointsCmd);
            formMain.SendData(0x80, toSend);
        }
Example #3
0
        private void Goto(SWaypoint targetWaypoint)
        {
            SCommGotoExecute gotoExecuteCmd = new SCommGotoExecute();

            gotoExecuteCmd.Command = 0x01; // execute GOTO
            gotoExecuteCmd.TargetWaypoint.Altitude  = targetWaypoint.Altitude;
            gotoExecuteCmd.TargetWaypoint.Longitude = (int)(targetWaypoint.Longitude * 1e7);
            gotoExecuteCmd.TargetWaypoint.Latitude  = (int)(targetWaypoint.Latitude * 1e7);

            // Send
            byte[] toSend = Comm.GetBytes(gotoExecuteCmd);
            formMain.SendData(0x80, toSend);
        }
Example #4
0
        public void ExecuteOrbit(SWaypoint targetCenter, float velocity)
        {
            SCommGotoExecute executeOrbitCmd = new SCommGotoExecute();

            executeOrbitCmd.Command = 0x03; // execute orbit
            executeOrbitCmd.TargetWaypoint.Altitude  = targetCenter.Altitude;
            executeOrbitCmd.TargetWaypoint.Longitude = (int)(targetCenter.Longitude * 1e7);
            executeOrbitCmd.TargetWaypoint.Latitude  = (int)(targetCenter.Latitude * 1e7);
            executeOrbitCmd.Velocity = velocity;

            // Send
            byte[] toSend = Comm.GetBytes(executeOrbitCmd);
            formMain.SendData(0x80, toSend);
        }