Closed JohnRThomas closed 2 years ago
Added in a min value to scale too. This way you can specify the haptic range:
For example a Thumb max rate of 0.7f
and min rate of 0.2f
:
(X degrees * 0.7f) + (180 degrees * 0.2f) = 0-180 mapped to 36-162 degrees of motion for the thumb.
I don't think a hardcoded value is a good idea - hand sizes and so max values change pretty significantly and not being able to fully close your hand is a pretty big problem as it makes it harder to grab items. If it could get the scale from the potentiometers then I think that is a better approach.
I had to move the input calibration code up to _main.ino so that the calibration data could be passed to the haptic engine easily.
I'm open to other solutions if we want to keep it better contained somehow.
This change removes that dead code of
dynScaleLimits
and adds in static per finger scaling rates.The default values are based on approximate sizing of each finger using the middle finger as 1.0 since it is the largest.
Hardcoding this will work for now and be configurable when flashing the FW, but it would be nice to have a comm packet the driver could send to set these values dynamically based on user configuration from the driver UI.