HipsterSloth / PSVRTracker

A sample app demonstrating position and orientation tracking for the PSVR headset
MIT License
37 stars 12 forks source link

Using ps3eyedevice in test_camera #9

Open opendata26 opened 6 years ago

opendata26 commented 6 years ago

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?

HipsterSloth commented 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

  1. Convert the video feed property setting from the opencv interface: https://github.com/HipsterSloth/PSVRTracker/blob/master/src/tests/test_camera.cpp#L246-L290

  2. 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

  3. 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

https://github.com/HipsterSloth/PSVRTracker/blob/master/src/psvrservice/Device/View/ServerTrackerView.cpp#L297

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.

opendata26 commented 6 years ago

Ah, how would I access the PS3EyeVideoDevice and usbenumerator APIs though? Should I just duplicate the needed code into test_camera?

HipsterSloth commented 6 years ago

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.

opendata26 commented 6 years ago

Right, that makes sense now.

m-7761 commented 6 years ago

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.