private void Cleanup() { _followPath?.Abort(); _skillHelper?.Abort(); _misty.UnregisterAllEvents(OnResponse); _misty.SkillCompleted(); }
private void Cleanup() { _followPath?.Abort(); _docker?.Abort(); _mapNav?.Abort(); _skillHelper?.Abort(); _misty.SkillCompleted(); }
/// <summary> /// Called when the robot wants to start this skill /// </summary> /// <param name="parameters"></param> public void OnStart(object sender, IDictionary <string, object> parameters) { try { //These calls assume system assets on the robot at the time of writing. //Update as needed for new or different assets or as an exercise to allow user to pass in asset names :) _misty.PlayAudio("s_Acceptance.wav", 100, null); _misty.MoveHead(45, 25, 0, 50, AngularUnit.Degrees, null); _misty.MoveArms(0, 45, 25, 60, null, AngularUnit.Degrees, null); _misty.ChangeLED(0, 255, 0, null); _misty.DisplayImage("e_Disoriented.jpg", 1, null); //Pause for 4 seconds, if the cancellation token is set during this time, exit the pause and the method if (!_misty.Wait(4000)) { return; } _misty.PlayAudio("s_Awe2.wav", 100, null); _misty.MoveHead(75, 15, 30, 50, AngularUnit.Degrees, null); _misty.MoveArms(-45, 0, 60, 100, null, AngularUnit.Degrees, null); _misty.ChangeLED(0, 255, 255, null); _misty.DisplayImage("e_ContentRight.jpg", 1, null); //Pause for 3.5 seconds, if the cancellation token is set during this time, exit the pause and the method if (!_misty.Wait(3500)) { return; } _misty.PlayAudio("s_Joy.wav", 100, null); _misty.MoveHead(75, 25, 10, 50, AngularUnit.Degrees, null); _misty.MoveArms(-45, 45, 60, 100, null, AngularUnit.Degrees, null); _misty.ChangeLED(255, 255, 255, null); _misty.DisplayImage("e_ContentLeft.jpg", 1, null); //Pause for 2.5 seconds, if the cancellation token is set during this time, exit the pause and the method if (!_misty.Wait(2500)) { return; } _misty.PlayAudio("s_PhraseHello.wav", 100, null); _misty.MoveHead(-10, 0, -10, 50, AngularUnit.Degrees, null); _misty.MoveArms(0, -45, 60, 100, null, AngularUnit.Degrees, null); _misty.ChangeLED(0, 0, 255, null); _misty.DisplayImage("e_Joy.jpg", 1, null); //Tell the robot the skill has completed early _misty.SkillCompleted(); } catch (Exception ex) { _misty.SkillLogger.Log($"HelloWorldSkill : OnStart: => Exception", ex); } }