示例#1
0
 /// <summary>
 /// Clears current objective qeueue and adds the provided one into the empty queue
 /// </summary>
 /// <param name="aObjective">Objective to replace the others with</param>
 public void SetObjective(Objective aObjective)
 {
     ClearObjectives();
     ObjectiveQueue.Enqueue(aObjective);
 }
示例#2
0
        /// <summary>
        /// Initializes the Autopilot object and associates it with provided DroneClient and sets DeafultObjective
        /// </summary>
        /// <param name="aDroneClient">DroneClient object which Autopilot will be controlling</param>
        /// <param name="aDefaultObjective">DefaultObjective to execute when ObjectiveQeueue is depleted</param>
        /// <remarks>Using this constructor will force DeafultObjective to be 'Hover'</remarks>
        public Autopilot(DroneClient aDroneClient, Objective aDefaultObjective)
        {
            DroneClient = aDroneClient;
            DefaultObjective = aDefaultObjective;

            ObjectiveQueue = new ConcurrentQueue<Objective>();
            ApparatusOutputQueue = new ConcurrentQueue<Apparatus.Output>();

            BoundToClient = false;
        }
示例#3
0
 /// <summary>
 /// Add a new objective into autopilot's action queue
 /// </summary>
 /// <param name="aObjective">Objective to be added/queued</param>
 public void EnqueueObjective(Objective aObjective)
 {
     ObjectiveQueue.Enqueue(aObjective);
 }
示例#4
0
 /// <see>
 ///     <cref>Create(long aDuration, params IntentObtainer[] aIntentObtainerList)</cref>
 /// </see>
 public static Objective Create(Expiration aExpiration, params IntentObtainer[] aIntentObtainerList)
 {
     var obj = new Objective(aExpiration);
     foreach (IntentObtainer io in aIntentObtainerList) obj.Add(io);
     return obj;
 }