2

degreeOutputThalmic Lab の Myo センサーから、センサーからの度数を WPF アプリケーションの double 型変数に保存しています。fist変数に格納される値は、ユーザーが腕を動かすと常に変化しますが、常に変化する値ではなく、人がポーズをとったときの動きのある時点での度数の読み取り値を格納したいと考えています。

私の現在の実装では、測定したいアークの開始値を示すためにdegreeOutputに表示される値をトリガーしますが、これは計画どおりに機能しません。painfulArcStartTbx

代わりに、拳が保持されると、度の値がテキストボックスに出力されますが、常に変化しています。

拳が握られたときの最初の読みだけが出力され、その後の読みは出力されません。

拳のポーズを放した後に円弧の終了値が出力されるはずですが、上記と同じ動作が得られます。

拳を握った時点の現在の値と、拳のポーズを離した時点の現在の値だけを保存する方法について、誰かアドバイスはありますか?

これは、次数の出力が処理されるメソッドです。

private void Myo_OrientationDataAcquired(object sender, OrientationDataEventArgs e)
        {
           App.Current.Dispatcher.Invoke((Action)(() =>
            {

                //need to record degree reading when pose made that
                //signifies begining of painful arc.
                //then specify a second pose that signals the end of
                //painful arc and store arc reading, eg 92dg - 108dg


                //myo indicator must be facing down or degrees will be inverted.
                degreeOutput = ((e.Pitch + PITCH_MIN) * CALLIBRATION_FACTOR);

                degreeOfAbductionTbx.Text = "Degree: " + degreeOutput;

                if(e.Myo.Pose == Pose.Fist)
                {
                    //get the start reading of the painful arc
                    painfulArcStartTbx.Text = "start: " + degreeOutput;

                }
                //then get the finish reading of the painful arc
                //after the fist pose has been let go, indicating
                //end of pain in movement
                else
                {

                    painfulArcEndTbx.Text = "end: " + degreeOutput;

                }




            })); 

        }
4

1 に答える 1

3

そのセンサーが何であるかわからないので、ここでは完全に間違っているかもしれませんが、非常に基本的なものが欠けているようです:

       private string startingDegree;
       private string endDegree;  
       private void Myo_OrientationDataAcquired(object sender, OrientationDataEventArgs e)
    {
       App.Current.Dispatcher.Invoke((Action)(() =>
        {

            //need to record degree reading when pose made that
            //signifies begining of painful arc.
            //then specify a second pose that signals the end of
            //painful arc and store arc reading, eg 92dg - 108dg


            //myo indicator must be facing down or degrees will be inverted.
            degreeOutput = ((e.Pitch + PITCH_MIN) * CALLIBRATION_FACTOR);

            degreeOfAbductionTbx.Text = "Degree: " + degreeOutput;

            if(e.Myo.Pose == Pose.Fist)
            {
               endDegree = string.Empty;
               if(string.IsNullOrEmpty(startingDegree))
                {
                    startingDegree = "start: " + degreeOutput;
                }

                //get the start reading of the painful arc
                painfulArcStartTbx.Text = startingDegree;

            }
            //then get the finish reading of the painful arc
            //after the fist pose has been let go, indicating
            //end of pain in movement
            else
            {
                startingDegree = string.Empty;
                if(string.IsNullOrEmpty(endDegree))
                {
                    endDegree = "end: " + degreeOutput;
                }
                painfulArcEndTbx.Text = endDegree;

            }




        })); 

    }
于 2015-01-31T21:57:20.273 に答える