/// <summary> /// Executes Misty Drive() command but checks for hazards first. Will wait till hazard is resolved to issue command. /// </summary> /// <param name="linearVelocity">Linear velocity value between -100 and 100 </param> /// <param name="angularVelocity">Linear velocity value between -100 and 100</param> /// <param name="commandCallback">Sets the callback function for the Drive command. Null is okay.</param> /// <param name="wasCalledFromHazard">By default this is false. Only use if calling from a hazard state</param> public void Drive(double linearVelocity, double angularVelocity, ProcessCommandResponse commandCallback, bool wasCalledFromHazard = false) { if (isMovingFromHazard == true && wasCalledFromHazard == false) { autoEvent.WaitOne(); } _misty.Drive(linearVelocity, angularVelocity, null); // commandCallback == null ? null : commandCallback }
/// <summary> /// Executes Misty DriveArc() command but checks for hazards first. Will wait till hazard is resolved to issue command. /// </summary> /// <param name="heading">Misty's end rotation will be facing in this direction. Values are degrees from 0-360, but values outside this range will automatically be translated</param> /// <param name="radius">Radius of the arc that Misty will drive on</param> /// <param name="timeMs">The amount of time that Misty will drive for</param> /// <param name="reverse">Not actually sure what this does. Drives in reverse? </param> /// <param name="commandCallback">Sets the callback function for the Drive command. Null is okay.</param> /// <param name="wasCalledFromHazard">By default this is false. Only use if calling from a hazard state</param> public void DriveArc(double heading, double radius, int timeMs, bool reverse, ProcessCommandResponse commandCallback, bool wasCalledFromHazard = false) { if (isMovingFromHazard == true && wasCalledFromHazard == false) { autoEvent.WaitOne(); } _misty.DriveArc(heading, radius, timeMs, reverse, null); //commandCallback == null ? null : commandCallback //if (commandCallback != null) //{ // _misty.DriveArc(heading, radius, timeMs, reverse, commandCallback);/ //else //{ // _misty.DriveArc(heading, radius, timeMs, reverse, null); //} }