LucidVR / lucidgloves

Arduino/ESP32 based DIY VR Haptic gloves. Compatible with SteamVR via OpenGloves.
MIT License
2.04k stars 259 forks source link

Add "Dynamic Servo Scaling" as Force Feedback Servo Scaling #56

Closed JohnRThomas closed 2 years ago

JohnRThomas commented 2 years ago

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.

JohnRThomas commented 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.

danwillm commented 2 years ago

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.

JohnRThomas commented 2 years ago

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.