Skip to content

Finishing up support the the ZCM2 PSMove controller#372

Merged
thp merged 6 commits into
thp:masterfrom
HipsterSloth:ZCM2U
Oct 22, 2018
Merged

Finishing up support the the ZCM2 PSMove controller#372
thp merged 6 commits into
thp:masterfrom
HipsterSloth:ZCM2U

Conversation

@HipsterSloth
Copy link
Copy Markdown
Contributor

I've been working with @nitsch to get the new ZCM2 PSMoveController working in PSMoveService. I wanted to port the relevant subset of that work over to psmoveapi. Specifically the controller calibration parsing, input packet parsing, and controller pairing in Windows. I've done some preliminary testing on Windows to verify controller pairing and verifying that the orientation work in the test_opengl programs and also updated the calibration dumping code to show ZCM2 calibration fields we are currently interpreting. Given that this is a big enough change I would love any feedback on the implementation.

The single biggest question I have is if you are ok with the PSMove_Data_Input getting turned into a union of two structs (PSMove_ZCM1_Data_Input and PSMove_ZCM1_Data_Input) or if you would prefer the common fields shared in PSMove_Data_Input and only the differences in the union. This would simplify some changes, but make some sizeof()s a bit more tricky.

* Added "authenticate controller" step using BluetoothAuthenticateDeviceEx
* Parse gyro and accelerometer calibration values (new calibration format for ZCM2)
* Separated ZCM1 vs ZCM2 input packet handling cases
  - psmove_connect_internal (magnetometer initialization)
  - psmove_poll
  - psmove_get_ext_data
  - psmove_get_buttons
  - psmove_is_ext_connected
  - psmove_send_ext_data
  - psmove_get_temperature
  - psmove_get_trigger
  - psmove_get_half_frame
  - psmove_get_accelerometer
  - psmove_get_gyroscope
  - psmove_get_magnetometer
* psmove_orientation_new will default OrientationFusion_MadgwickIMU for the ZCM2 (since it doesn't have a magnetometer)
@yuripourre
Copy link
Copy Markdown

You mean union of PSMove_ZCM1_Data_Input and PSMove_ZCM2_Data_Input, right?

@HipsterSloth
Copy link
Copy Markdown
Contributor Author

@yuripourre Oops! Yes "union of PSMove_ZCM1_Data_Input and PSMove_ZCM2_Data_Input". Sorry that was a typo on my part.

Derek Quam and others added 4 commits October 2, 2018 12:17
Handle unknown errors from BluetoothAuthenticateDeviceEx. Not handling these errors could cause a hang. Fixed an incorrect cast of the callback parameters in bluetooth_auth_callback.
Fixed bugs in bluetooth authentication of ZCM2U on Windows
Allow BluetoothAuthenticateDeviceEx errors to fall through again.
@thp
Copy link
Copy Markdown
Owner

thp commented Oct 22, 2018

Thanks a lot for working on this, @HipsterSloth 👍

@HipsterSloth HipsterSloth deleted the ZCM2U branch October 23, 2018 07:45
@HipsterSloth
Copy link
Copy Markdown
Contributor Author

Happy to help!

@sl1pkn07
Copy link
Copy Markdown

i get this message in my CECH-ZCM1E unit

[PSMOVE CRITICAL] Assertion fail in psmove_load_magnetometer_calibration: result == 3

is ok?

greetings

@nitsch
Copy link
Copy Markdown
Collaborator

nitsch commented Oct 13, 2022

Please continue the discussion in issue #452.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants