Hi everyone,
Trying to solve an issue with logic involving muscle sensor data.
Basically I have a level that reads the value of a EMG sensor. It is hooked up to event tick to read the values. But I also have a calibration script that reads 5 seconds of the sensor data, works out the maximum value of the array and then takes 5% off before putting that value in a variable.
The reason why I want to do this is because once the sensor data reaches this threshold value. I want my avatar to grasp. But due to the technical limitations of the EMG sensor (it’s not fully amplified) I need the release of the hand to be on the next grasp. So grasp to initial close the hand, grasp again to open the hand. There is some code additionally that runs to check if there is an object in the hand’s reach to grasp before closing the hand. E.g if you grasped not near an object nothing would happen.
The issue is lets say 10% of 100 which might be the maximum value of the grasp gives a value of 90. If during tick a grasp is detected once the reading of the EMG goes past 90, putting a branch on if it is 90 or greater leads to another grasp. As the sensor is not amplified the muscle sensor values very quickly go down past 90 hence a release.
What I’m trying to do is thing of either a flip flop or gate logic to ensure that one grasp is detected, which leads to the hand being close then another grasp leading to the hand opening.
Any one got any pointers?
Cheers!