Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: VR lighthouse based tracking for lightguns  (Read 5442 times)

0 Members and 1 Guest are viewing this topic.

Toasty833

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:Yesterday at 04:20:45 am
  • I want to build my own arcade controls!
VR lighthouse based tracking for lightguns
« on: August 22, 2021, 12:59:15 pm »
Lighthouse tracking, used with the HTC Vive and Valve Index VR systems, has an accuracy of within a few mm, and they come with 2 controllers out of the box. It wouldn't be too hard to 3D print or strap some gun sights to the top of a controller, define your screen area and positional offsets, and create a lightgun with no distance requirements by just ignoring the headset.

There was an attempt made here: https://www.reddit.com/r/Vive/comments/751j8d/vive_controller_as_a_mouse_pointer_v03/ to do something similar, but unfortunately SteamVR has since updated and I can't get the software to work to see if the accuracy is good enough for use as a light gun. Current LCD systems all require a minimum distance of about 1.5x screen size to work, which isn't so bad on smaller screens, but if you want to play on newer 4k screens you might have to stand very far away. With a tracked gun, it doesn't matter where the gun is in relation to the screen, you can be an inch away and get the same performance.

Toasty833

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:Yesterday at 04:20:45 am
  • I want to build my own arcade controls!
Re: VR lighthouse based tracking for lightguns
« Reply #1 on: January 06, 2022, 09:16:15 am »
Went looking around for this kind of thing again today, and found https://imgur.com/gallery/vBaXSkW, using openVR (https://github.com/asingh57/openvr_lightgun). Very user unfriendly, but I managed to get it working with my Vive wand. In terms of tracking accuracy, it's fantastic, dead on the same mark every time, very low latency. The problem is with calibration, the tool is very basic and doesn't really let you dial in the screen position properly, a proper GUI could offer crosshairs and multi-angle shooting to define the screen much more accurately. And this was clearly early software. I also couldn't get it to compile so I had to use the debugging version with clicks disabled, but I wasn't really expecting it to be feature complete, I just wanted to know what kind of accuracy was possible.

https://imgur.com/a/ZVay1zS is a quick example of the tracking quality from about a foot away, which isn't possible on any existing LCD based setups to my knowledge. The alignment issues are all down to the shoddy calibration, what's important is how well it follows the movement.

Toasty833

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:Yesterday at 04:20:45 am
  • I want to build my own arcade controls!
Re: VR lighthouse based tracking for lightguns
« Reply #2 on: April 09, 2024, 04:17:55 pm »
Well, it's been another 2 years, and I went looking around again. Nothing has changed in that timeframe, I've seen a couple of WIP projects for this kind of thing pop up and then fizzle out without any release.

But today I read a comment somewhere about how you could just use Virtual Desktop, align it to your real screen, and then use a VR controller as a light gun on your monitor. After about 20 minutes of fiddling with distance, taking the headset on and off, I honestly got it pretty close. Not perfect, but it was about 5mm variance for most of the screen. The main problem is my 40" monitor is shiny and reflective, which throws off the tracking, I imagine other screens would work better. More than responsive enough to play with a cursor though, so I played through a bit of Blue Estate, which worked great. Only issue is that one of the buttons in VD seems to be mapped to moving the screen around if you hold it by accident, and obviously you don't get anything fancy like off-screen reloading.

I might try and mess with this concept a bit more. I've got a tracker puck, I might try and attach it to the bottom of a guncon, use a bit of card in front to block reflections, and hook up the buttons via the pogo pins. It'd be really nice if I could somehow calibrate the virtual mouse that VD creates, but that might be beyond the scope of the software, and find a program that takes any left click inputs near the edge of the screen and converts them into an alternate button press for quasi off-screen reloads. Maybe it's something AHK can do with a macro?

EDIT: Got the system half working with a vive wand, which seems to be a lot more robust for tracking than the index controller I was using yesterday, tracking is much more stable even with a reflective monitor. Unfortunately, I couldn't work out a way to remap any of the vive buttons, so you're stuck with just the left click trigger. In order to get the vive wand at a usable angle (by default VD has it coming out straight like a lightsaber), I used an updated version of OpenVR input emulator found at https://github.com/Louka3000/OpenVR-InputEmulator-Fixed to adjust the angle to be more gun like. Sadly, I couldn't get the input remapping element of this tool to work, and attempts to use the SteamVR remapper to add control options proved fruitless, so I used a keyboard button to reload instead. My hope is that with a vive tracker I get similar tracking performance and usable iron sights after attaching it to a gun shell, and maybe I work out a way to get the pogo pin inputs as usable buttons.
« Last Edit: April 10, 2024, 08:17:59 am by Toasty833 »

greymatr

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:Yesterday at 06:26:41 am
  • I want to build my own arcade controls!
Re: VR lighthouse based tracking for lightguns
« Reply #3 on: Yesterday at 06:19:38 am »
Hi Toasty,

I tried the vive tracker as a light gun route myself and used the precompiled vive controller as a mouse pointer as well. I ended up getting this gun (Hyperkin Hyper Blaster) to attach the vive tracker to:



https://unboundxr.eu/hyper-blaster-vr-gun

https://www.amazon.com/Hyperkin-Hyper-Blaster-Vive-Tracker-pc/dp/B077Y9WBDZ

It did all work in the end but it was a lot of mucking around. I ended up getting an off the shelf solution that uses 4 IR emitters around the TV / Monitor.