Lighthouse Tracking Room Overview

Lighthouse Tracking Room Overview

christian.buzga
Contributor Contributor
1,765 Views
13 Replies
Message 1 of 14

Lighthouse Tracking Room Overview

christian.buzga
Contributor
Contributor

Hi guys,

 

unfortunately Valve removed the "room overview" for their lighthouse tracking system (long time ago). It was a pretty good function, to get an quick overview over all tracking components and their position/rotation. So you can quickly check, if something is "wrong" with your tracking system.

 

We have an implementation for this in Unity, but because you can not run two application that are "connected" to SteamVR at the same time, we would like to implement such a feature directly in VRED.

So we can access the position/rotation of the tracking devices, like HMD, trackers, controllers. What we are missing are the basestation(s). They are not in the list that we get from vrDeviceService.getConnectedVRDevices(). But I know, that SteamVR is normaly providing these, named as "tracking references".

 

Is there a way to get the position/rotation of the basestation also in VRED?

 

Thanks and best regards,

Christian

0 Likes
Accepted solutions (1)
1,766 Views
13 Replies
Replies (13)
Message 2 of 14

sinje_thiedemann
Autodesk
Autodesk
Accepted solution

Hi,

unfortunately it's currently not possible to access those with the VRED Python API. Any TrackingReference devices are ignored.

 

I'll add your request to access Lighthouses via API to our backlog. Thanks for the information about your use case, that helps.

 

Kind regards

Sinje

Message 3 of 14

extern.Sanju.Mathew
Contributor
Contributor

Hi,

 

I have been trying to get a list of all the connected devices through VRED using the below code. But it always returns the value 0. Even when we have the Vive headsets, left and right controllers and trackers 1.0 connected and showing up in Steam VR. May I know what could be the reason? These trackers are from 2017. We updated the firmware on the trackers but still no results. I can't get the serial numbers or name of these devices printed in VRED. Any advice will be highly appreciated.

 

devices = vrDeviceService.getConnectedVRDevices()

print(len(devices))

 

Regards,

 

Sanju Mathew

0 Likes
Message 4 of 14

__daniel.lincoln__
Alumni
Alumni

Hi,

Execute the code while OpenVR HMD mode is active in VRED, otherwise the devices will not show up.

 

Regards,

Dan

0 Likes
Message 5 of 14

extern.Sanju.Mathew
Contributor
Contributor

Thank you! Now it works

Message 6 of 14

extern.Sanju.Mathew
Contributor
Contributor

Hi,

 

I am trying to get the current position of the tracking device with the following code, but it says 

object has no attribute 'getTrackingOrigin'. May I know how to get the current position of the device? get tracking origin gives me the origin of the VRED grid in VR. I am trying to get the scene positioned and oriented in x, y, z based on the buck orientation. Each time I enter the VR orientation keeps changing. 

tracker_1 = vrDeviceService.getVRDevice("tracker-1")

tracker_1_origin = tracker_1.vrDeviceService.getTrackingOrigin()

print(origin)

 

Regards,

 

Sanju Mathew

0 Likes
Message 7 of 14

__daniel.lincoln__
Alumni
Alumni

Hello,

 

Something like this should work...

tracker_1 = vrDeviceService.getVRDevice("tracker-1")
tracker_1_position = vrMathService.getTranslation(tracker_1.getNode().getWorldTransform())
print(tracker_1_position)
print(f"Z: {tracker_1_position.z():.2f}") # Print Z value rounded

Also, see related tutorial here by Christopher.

https://help.autodesk.com/view/VREDPRODUCTS/2025/ENU/?guid=9Tutorial-VREDPro

 

0 Likes
Message 8 of 14

extern.Sanju.Mathew
Contributor
Contributor

Perfect! Thank you for the link to tutorial. Highly appreciate it!!

 

1) Is there a way to rotate the whole VR session by a certain angle (deg) in Z axis after doing a .setTrackingOrigin() to orient the data in a certain direction?

 

2) Also I am trying to run numpy. 'python.exe -m pip install numpy' as per the tutorial below.
https://help.autodesk.com/view/VREDPRODUCTS/2024/ENU/?guid=VRED_Python_Documentation_Python_API_V2_h...

But it gives me syntax error as below. Can it be run from Script editor or it has to be run in CMD?

Unable to convert:python.exe -m pip install numpy
File "<string>", line 1
python.exe -m pip install numpy
^^^
SyntaxError: invalid syntax

 

Regards,

 

Sanju Mathew

0 Likes
Message 9 of 14

Christian_Garimberti
Advisor
Advisor

Hi, i can answer the question 2:

2) Also I am trying to run numpy. 'python.exe -m pip install numpy' as per the tutorial below

To be sure to use the correct "Python.exe", add the full path for the Vred python, or add the vred python path to the windows "Path" environment variable.

 

Then you can use both via Cmd or script editor, but you should differentiate

cmd: "C:\Program Files\Autodesk\VREDPro-17.1\lib\python\python.exe" -m pip install numpy

to run it from the script editor: 

import subprocess

subprocess.check_call(['C:/Program Files/Autodesk/VREDPro-17.1/lib/python/python.exe', '-m', 'pip', 'install', numpy])

 

in both cases check the VredPro-xx.x version in the python path

 

Best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

0 Likes
Message 10 of 14

__daniel.lincoln__
Alumni
Alumni
Try this to rotate the scene.
cam = vrCameraService.getActiveCamera()
cam.setTranslation(QVector3D(0, 0, 0))
cam.setRotationAsEuler(QVector3D(90, 0, 90))
0 Likes
Message 11 of 14

extern.Sanju.Mathew
Contributor
Contributor

Thank you Christian and Daniel!!

 

We could setup everything the way we had planned. Highly appreciate your support without which we couldn't have accomplished it.

Message 12 of 14

extern.Sanju.Mathew
Contributor
Contributor

Hmm.. somehow it's not installing it.. I am getting below error. while trying to import numpy.

 

Traceback (most recent call last):

File "<string>", line 1, in <module>

ModuleNotFoundError: No module named 'numpy'

0 Likes
Message 13 of 14

Christian_Garimberti
Advisor
Advisor

Hi, exactly which command have you written, where (windows cmd or vred terminal) and which version of vred are you using?

Best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

0 Likes
Message 14 of 14

extern.Sanju.Mathew
Contributor
Contributor

I guess I had to restart VRED. Now it worked. CMD option worked. It says the requirement is already satisfied. I am using Autodesk VREDPro 2024.2. Thank you Christian!!