ChilloutCharles / BrainFlowsIntoVRChat

BrainFlow code that sends your brain's relaxation, focus metrics, and machine learned thought commands to vrchat avatar paramaters via OSC.
https://linktr.ee/ChilloutCharles
MIT License
209 stars 15 forks source link

Fix UnboundLocalError on failed init #30

Closed sync1211 closed 3 weeks ago

sync1211 commented 1 month ago

This pull request fixes an UnboundLocalError exception being thrown when the board fails to initialize and adds a retry logic to the initial board initialization (controlled by --retry-count). As a result, the script will no longer exit if it encounters and error during the first initialization.

I have also tried to clean up some of the code in main.py to hopefully make it more readable.

sync1211 commented 1 month ago

Clarified the title as the exception is the main reason for the PR.

ChilloutCharles commented 3 weeks ago

I've added some code to make it work with retry loops on initial success. Tested as well. Pushing to main