Add callback interface for frame-driven data and use UTF-8 for long description#1
Open
starwey604 wants to merge 2 commits into
Open
Add callback interface for frame-driven data and use UTF-8 for long description#1starwey604 wants to merge 2 commits into
starwey604 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a callback mechanism for handling frame updates in the
OculusReaderclass, improves the main execution flow, and makes a minor fix tosetup.py. The main changes focus on making it easier to process frame data in real-time with higher frame rate and improving code robustness.Callback integration and API improvements:
Added an optional
callbackparameter to theOculusReaderconstructor, stored it as an instance variable, and modified theread_logcat_by_linemethod to call this callback with the latesttransformsandbuttonsdata after each frame is processed.Main function and execution flow:
Refactored the
mainfunction to use the new callback mechanism for printing frame data, added proper cleanup usingatexitto stop the reader, and improved handling of keyboard interrupts.Bug fixes and minor improvements:
setup.pyto explicitly specify UTF-8 encoding when readingREADME.md, preventing encoding issues in Windows platform