Puara / puara-gestures

High-level gestural descriptor functions for the Puara Framework
MIT License
1 stars 6 forks source link

Questions about the logic of the jab extractor #2

Closed aburt2 closed 1 year ago

aburt2 commented 1 year ago

Hey @edumeneses just have some questions about the logic of the jab extractor, in the x direction.

https://github.com/Puara/puara-gestures/blob/34f3e525c3269390c335f23a96282afbec27d884/puara_gestures.cpp#L53-L73

  1. Following the code why is it that when maxX is > 0 and minX < 0 you output a 0 for jabX
  2. Also why do jabs in Y and Z not have the same logic as jabs in the X direction
edumeneses commented 1 year ago
  1. If I remember correctly, that case implies you gave an impossible jab that changes direction.
  2. That is a mistake. The right code should be the one for jabX. Also, you might already noticed that the jabThreshold is not applied to Y and Z (also a mistake).

This part of the function would benefit from a review.

aburt2 commented 1 year ago

Second question, is there any reason we only use the gyroBuffers and not any accelerometer data for jabs and shakes

edumeneses commented 1 year ago

Closing this issue as we already discussed in person. In a nutshell:

For shakes, gyro seems a good choice as it allows a simpler implementation, as well as the fact it zeroes when static heps.

For jabs, that was a wrong decision. @aburt2's PR adds a function to use accelerometer data for jabs. In a future revision, the plan is to leave the function generic and plug the type of data