Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using only VZController to read InputSpeed
#1
I'm working on a VR project for the Oculus Go. The application will be displaying a 360 degree video from a bicycle ride so elderly who need to move to stay healthy or people who need some distraction while they are cycling can cycle using a pedal trainer (cycle while sitting on a chair).

To stimulate people to keep cycling i want to add a functionality where the game will pause after a short amount of time if they stop cycling or come beneath a certain threshold. I want to use the VZFIT SDK to connect a VirZoom Speedometer to my VR application. This SDK offers a lot more functionality than i need and i can't figure out how to implement the functionality i want.

Summarized
  • I want to use a static VR camera (preferably the OVRCameraRig from the Oculus Integration Library) to allow the user to look around in a static position where the video moves through them creating the illusion of moving. 

  • I want to be able to read the InputSpeed from the VZController and display this value on the screen

  • I want to pause the game if the speed drops below (lets say) 5kmh for more than 5 seconds

  • I want to continue the game if they start cycling again and reach above 5kmh
How would i go about to implement this functionality?
Reply
#2
You should be able to place the VZController.prefab in your scene. Then from your game script, lookup the VZController component on it and call ConnectBike().

If you pedal and connect the VZ Sensor then IsBikeConnected() will then return true.

It then checks for a license so that IsBikeLicensed() returns true.

Then you will be able to get InputSpeed. It's units are in estimated meters/second, you can convert and compare to 5 kmh to pause and resume your game script.

Good luck!
Reply
#3
Thank you for your swift answer.

In what order would i have to place the objects since the VZController also has a camera in it?

Do i place the VZController in the OVRCameraRig and remove the camera or do i need to do something else? I am really having a hard time to understand the logic between the different components here. I also can't test the functionality since i don't own a vzfit and need to do the testing by keyboard and this functionality seems to be in the VZPlayer which im not using.

I have now placed the VZController script with the VZControllerMap directly on the OVRCameraRig
Reply
#4
Sorry for the less swift response this time...

It wasn't designed to work cleanly with OVRCameraRig, since we embedded the Camera into VZController.prefab. But since you aren't using other functionality of VZController or VZPlayer, you can just disable that embedded Camera to use your OVRCameraRig.

I wish I could tell you to use VZPlugin.cs directly, because that's what directly talks to the bike, but it currently relies on VZController to perform the license check. Feel free to hack out sections of VZController code until you are just dealing with that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)