Open opendata26 opened 6 years ago
Sorry for my slow reply on this and sorry I wasn't very clear on the refactor I had in mind. So the change I have in mind would throw out ps3eyevideocapture and use PS3EyeVideoDevice directly.
1) Spawn instances of PS3EyeVideoDevice directly (instead of PS3EyeVideoCapture) here: https://github.com/HipsterSloth/PSVRTracker/blob/master/src/tests/test_camera.cpp#L53
Convert the video feed property setting from the opencv interface: https://github.com/HipsterSloth/PSVRTracker/blob/master/src/tests/test_camera.cpp#L246-L290
Switch setting the video mode from setting the width and fps properties: https://github.com/HipsterSloth/PSVRTracker/blob/master/src/tests/test_camera.cpp#L293-L305
Switch the video frame polling from the opencv style overloaded operator >> style read: https://github.com/HipsterSloth/PSVRTracker/blob/master/src/tests/test_camera.cpp#L93-L94
To using the notifyFrameReceived callback passed into PS3VideoDevice::open() https://github.com/HipsterSloth/PSVRTracker/blob/master/src/psvrservice/Device/Interface/DeviceInterface.h#L143
That callback will give you a raw unsigned char * to the video frame. You can convert that to an cv::Mat using the cv::Mat raw pointer constructor. Example of that here:
https://github.com/HipsterSloth/PSVRTracker/blob/master/src/tests/test_camera.cpp#L98
Let me know if you have any questions with that. As you can tell, it's a pretty sizable refactor, but it should also help delete a bunch of old code.
Ah, how would I access the PS3EyeVideoDevice and usbenumerator APIs though? Should I just duplicate the needed code into test_camera?
Sort of. You'll want to update the tests/CMakeLists.txt file to include the needed usbenumerator files in the autogenerated test_camera project:
https://github.com/HipsterSloth/PSVRTracker/blob/master/src/tests/CMakeLists.txt#L22-L29
This doesn't duplicate the files, but does re-build them in another project. At some point I want to refactor this so that the test_camera project links against the PSVRService_static library instead, but that can come later.
Right, that makes sense now.
Hey everyone! Are you a codeveloper @opendata26?
I want to involve myself before long. My PSVR is being serviced right now, which has set me back a couple weeks to finding my way here. @HipsterSloth, that list looks like an awful lot. I hope looks are deceiving. I've put some code up here (https://github.com/dylanmckay/psvr-protocol/issues/14) that Trinus PSVR is looking at implementing right now...
Please give it a look if better approximating the view vector without tracking can assist the camera's worldview.
I want to help with tweaking until the experience is best... mainly I would like to help with solving for the best configuration; the stuff that comes after the headlight profiles are handed off from the imaging component.
I have head a look into it but it seems if I did it the way it was done for ps3eyevideocapture there would be a lot of duplicated code, is this still how it should be done though?