-
Notifications
You must be signed in to change notification settings - Fork 146
Controller - device communication groundwork #3
Comments
The other option would be to use libusb to get/ser the hid reports directly. HID report requests are really just a wrapper on top of USB control requests. Here is an example of using libusb to make hid report requests: http://janaxelson.com/code/generic_hid.c |
I think the 'hidapi problem' is a symptom of the OS more than it is of hidapi itself. I'm sure I'm butchering the vocabulary, but I think Windows exposes the bluetooth-connected PSMove controller as 3 devices, whether it's enumerated via My hope is that the Windows API somehow corrects for this. If it doesn't then we're no better off using the Windows API than we are using a patched hidapi. |
Collecting some Vendor IDs (VIDs) and Product IDs (PIDs) on my Mac as returned by libusb:
Edit: Also, I realized that hidapi/windows/hid.c uses the Microsoft API that I was planning to use. I guess it'll be better for me to patch it to work with Win 10 than for me to redo all of its efforts. |
…ed to write directly to the lastState member variable instead of making a temporary copy first.
I thought I was done with the controller communication, but then I just realized that I completely forgot about the internal sensor calibration that needs to be copied from the controller when connected by USB then saved to a file, and loaded from the file on subsequent Bluetooth connections. |
Also TODO Unfortunately, I can't seem to find any sort of timestamp for when the frames were received. There is an int16 timestamp and a int4 sequence number so the frames can be put in some order and the time between frames can be saved. I need to make a member variable that is a FIFO buffer of controller states (std::dequeue) and fill the buffer with all available states each time the read function is called. |
… mostly done but we need a general file read/write solution.
Before I can finish this, we need a standardized way of reading and writing configuration data to files. I thought this could be handled by a class something like /psmoveservice/FileManager/FileManager.h & .cpp But boost probably has some utilities for this too. Brendan, do you have any ideas on how you would like config data to be saved/loaded from disk? |
It looks like boost has a pretty easy to use set of utility classes for loading and saving hierarchical configuration data: http://theboostcpplibraries.com/boost.propertytree |
…t once when plugged in via USB to write its calibration data to the config file. This closes #3 . The controller is not completely done, but it is good enough to bring into fusion classes.
I have the config save/load working properly for the controller calibration data. The controller has to be accessed via bluetooth at least once to write its calibration data to disk. I'm going to close this issue because basic controller functionality is done enough that the controller can be brought into a PSMoveFusion class that uses controller data and tracker data, and their histories, to get the current (or even predicted future) pose. One thing that still needs to be done in the controller class is the magnetometer, but I want to open a separate issue for that. |
* Filled in the rest of the ComputeTrackerPoses state machine + Added stages for verification trackers and HMD + filled in 2d and 3d rendering for all but the final test calibration state * Created a stub "calibrateWithHMD" sub stage to handle calibration with HMD method (old style) * Created a stub "calibrateWithMat" sub stage to handle calibration with calibration mat (new style)
* First implementation in place. Partially works. Controller roll coming through but not pitch or yaw.
We will use hidapi for Linux and Mac. hidapi also supports Windows, so we will use that initially, but the plan is to use the MS APIs for Windows instead of hidapi.
A list of feature reports can be found here.
Some hidapi notes:
Some Windows HID notes:
The text was updated successfully, but these errors were encountered: