Exemple #1
0
        public void CalibrateFoot(Trackable calibrationTrackable)
        {
            //Stromohab_MCE_Connection.TCPProcessor.TrackableListReceivedEvent +=
            //    new TCPProcessor.TrackableListReceivedHandler(TCPProcessor_TrackableListReceivedEvent);
            if (footName == "left")
            {
                currentID = 1;
            }
            if (footName == "right")
            {
                currentID = 2;
            }
            this.calibrationTrackable = calibrationTrackable;
            previousTrackable         = calibrationTrackable;
            PositionData positionCalibration = PositionData.ConvertMarkerPosition((Marker)calibrationTrackable);

            this.footPositionList.Add(positionCalibration);
            footdown_yCoordinate = calibrationTrackable.yCoordinate;
            xDirection           = 0; // -1 -> indicates heading in -x direction
            yDirection           = 0; // +1 -> +y direction etc
            zDirection           = 0; // +1 (+z) is forwards, towards screen; -1 -> moving towards back of treadmill
            xPrevDirection       = 0;
            yPrevDirection       = 0;
            zPrevDirection       = 0;
            zPreviousCoordinate  = previousTrackable.zCoordinate;
            yPreviousCoordinate  = previousTrackable.yCoordinate;
            xPreviousCoordinate  = previousTrackable.xCoordinate;
        }
Exemple #2
0
        public void CalibrateFoot(Marker calibrationMarker)
        {
            footPositionList = new List <PositionData>();
            //TCPProcessor.WholeFrameReceivedEvent +=
            //    new TCPProcessor.WholeFrameReceivedHandler(TCPProcessor_WholeFrameReceivedEvent);
            this.calibrationMarker = calibrationMarker;
            previousMarker         = calibrationMarker;
            //
            currentMarker = new Marker(previousMarker);
            //
            PositionData positionCalibration = PositionData.ConvertMarkerPosition(calibrationMarker);

            this.footPositionList.Add(positionCalibration);
            footdown_yCoordinate = calibrationMarker.yCoordinate;
            currentID            = calibrationMarker.MarkerId;
            xDirection           = 0; // -1 -> indicates heading in -x direction
            yDirection           = 0; // +1 -> +y direction etc
            zDirection           = 0; // +1 (+z) is forwards, towards screen; -1 -> moving towards back of treadmill
            xPrevDirection       = 0;
            yPrevDirection       = 0;
            zPrevDirection       = 0;
            zPreviousCoordinate  = previousMarker.zCoordinate;
            yPreviousCoordinate  = previousMarker.yCoordinate;
            xPreviousCoordinate  = previousMarker.xCoordinate;
        }
 private void TCPProcessor_WholeFrameReceivedEvent()
 {
     if (MarkerList.listOfMarkers.Count == 2)
     {
         List <PositionData> tempMarkerList = new List <PositionData>();
         foreach (Marker singleMarker in MarkerList.listOfMarkers)
         {
             PositionData markerData = PositionData.ConvertMarkerPosition(singleMarker);
             tempMarkerList.Add(markerData);
         }
         allPositionData.Add(tempMarkerList);
     }
 }
        private void TCPProcessor_WholeFrameReceivedEvent()
        {
            if (MarkerList.listOfMarkers.Count == 2)
            {
                //FrontFoot(MarkerList.listOfMarkers[0], MarkerList.listOfMarkers[1]);
                left.PreviousMarker  = new Marker(left.CurrentMarker);
                right.PreviousMarker = new Marker(right.CurrentMarker);
                AssignFootMarkers(MarkerList.listOfMarkers);
                //currentMarker = MarkerList.listOfMarkers[currentID]; //elaborate marker assignment to account for swapping
                //if (currentID != previousID) System.Diagnostics.Debug.WriteLine("Possible marker swap: " + currentMarker.TimeStamp);

                left.FootPositionList.Add(PositionData.ConvertMarkerPosition(left.CurrentMarker));
                right.FootPositionList.Add(PositionData.ConvertMarkerPosition(right.CurrentMarker));
                left.MarkerTrack();
                right.MarkerTrack();
            }
        }
Exemple #5
0
        private void TCPProcessor_TrackableListReceivedEvent(List <Trackable> newTrackableList)
        {
            trackableList = new List <Trackable>(newTrackableList);
            Marker m1 = (Marker)(trackableList.Find(LeftFoot));
            Marker m2 = (Marker)(trackableList.Find(RightFoot));

            if (currentID == 1)
            {
                currentMarker = m1;
            }
            if (currentID == 2)
            {
                currentMarker = m2;
            }
            PositionData footData = PositionData.ConvertMarkerPosition(currentMarker);

            this.footPositionList.Add(footData);
            MarkerTrack();
            //FrontFoot(m1, m2);
        }