JoustMania icon indicating copy to clipboard operation
JoustMania copied to clipboard

Look into python asyncio/callback functions

Open adangert opened this issue 4 years ago • 3 comments

Currently each controller gets it's own process but the logic loop is as follows: get controller reading do game logic ect.....

instead with async or callback functions we can do as follows: do game logic (new sensor reading come in) process sensor reading continue to do game logic until new sensor reading ect..

This paradigm should make things much smoother especially when paired with an EKF as well.

adangert avatar Jan 05 '21 02:01 adangert

Need to process both frames for faster and better response: https://github.com/thp/psmoveapi/blob/85d7eadcf818f34163e2ff23556f06934d9643d8/include/psmove.h#L170

adangert avatar Jan 05 '21 02:01 adangert

currently joustmania uses if move.poll(): which I believe is only using the most up to date data, we should update this to use while move.poll(): to get all data from the controllers

adangert avatar Jan 05 '21 02:01 adangert

Detecting dropped frames: https://github.com/thp/psmoveapi/blob/85d7eadcf818f34163e2ff23556f06934d9643d8/include/psmove.h#L655

adangert avatar Jan 05 '21 02:01 adangert