Esempio n. 1
0
            protected override async void nextStageAction()
            {
                try
                {
                    MasterSpellLibrary.SpellFeedbackSFX.Stop();
                    await Task.Delay(150);

                    MasterSpellLibrary.SpellProgressSFX.Play();
                    await Task.Delay(1000); // Give a moment to get ready.

                    //Current.SpellBeingTrained.AddGlyph(new Glyph(AverageAttitude, Stillness.StillnessScore, AverageAttitude.StdDev));
                    Current.SpellBeingTrained.AddGlyph(new Glyph(AverageAttitude, Stillness.StillnessScore, 0));
                    Current.CheckGlyphCount();

                    var EulerAngles = AverageAttitude.Average.ToEulerAngles();
                    //Log.Debug("SpellTraining", $"Saved glyph at yaw {EulerAngles.X:f2}, pitch {EulerAngles.Y}, and roll {EulerAngles.Z} from zero stance.");
                    //Log.Debug("SpellTraining", $"Saved {((GestureRecognizerStage)CurrentStage).Label} at {EulerAngles:f1} from zero stance.  That's {AverageAttitude.Average.AngleTo(lastOrientation):f0} degrees from the last one.  Baselines are {Stillness.StillnessScore:f2} for stillness, {AverageAttitude.StdDev:f2} for orientation.");
                    Log.Debug("SpellTraining", $"Saved {((GestureRecognizerStage)CurrentStage).Label} at {EulerAngles:f1} from zero stance.  That's {AverageAttitude.Average.AngleTo(lastOrientation):f0} degrees from the last one.  Baseline is {Stillness.StillnessScore:f2} for stillness.");
                    CurrentStage = new GlyphTrainingStage($"Glyph {Current.SpellBeingTrained.Glyphs.Count}", Implement, AttitudeProvider);
                }
                catch (Exception e)
                {
                    Log.Error("Glyph training stage progression", e.Message);
                    throw;
                }
            }
Esempio n. 2
0
            protected override async Task nextStageActionAsync()
            {
                await AttitudeProvider.SetFrameShiftFromCurrent();

                SpellBeingTrained.ZeroStance = AttitudeProvider.FrameShift;

                Log.Debug("SpellTraining", $"Zero stance assigned at {SpellBeingTrained.ZeroStance.ToEulerAngles():f1}.");

                await Speech.SayAllOf("Begin");

                //Speech.Say("Begin");
                CurrentStage = new GlyphTrainingStage($"Glyph 0", Implement, AttitudeProvider);
            }