Aligning VR Scene Origin on the Fly (Varjo XR-3 + SteamVR)

Aligning VR Scene Origin on the Fly (Varjo XR-3 + SteamVR)

emre_ergene4YJKG
Participant Participant
413 Views
4 Replies
Message 1 of 5

Aligning VR Scene Origin on the Fly (Varjo XR-3 + SteamVR)

emre_ergene4YJKG
Participant
Participant

Hello everyone,

We regularly conduct both weekly and on-demand VR reviews within our company. In almost every session, we encounter some form of alignment issue. Our setup includes a Varjo XR-3 headset tracked via SteamVR with base stations.

 

Before each review, we re-do the room setup using the SteamVR app and activate the "Override Origin and Direction" feature in Varjo Base. For some reason, this seems to improve the results. Sometimes everything works on the first try, but often we need to repeat the process multiple times to get it right.

 

The main issue is this:
The origin point of the VR world randomly shifts to a different—and completely unrelated—position. Occasionally, it also tilts. This causes the vehicle in the scene to appear floating in the air, sunken into the ground, or angled incorrectly. We’re not sure if this issue stems from the hardware, SteamVR, or VRED itself, but it's something we experience frequently.

During internal reviews, we can pause and manually re-align the floor if needed. However, this becomes a significant problem during executive reviews or when hosting important guests.

 

Our goal is to find a way to re-align the origin dynamically, without interrupting the session.
We initially considered using Varjo Markers to anchor objects in the real world and hoped to align the entire scene's "root" node to a marker. Unfortunately, it seems the "root" node in VRED cannot be moved directly.

 

I’ve searched the forum and found some discussions around aligning physical bucks to VR scenes, but nothing directly applicable to our situation.

 

Is there any practical way to achieve real-time re-alignment of the scene origin?
We also have access to Vive Trackers. Would it be possible to track a Vive Tracker or Varjo Marker and use a Python script to apply its transformation to the scene origin dynamically?

 

Any insights or suggestions would be greatly appreciated.

 

Many thanks,
Emre

0 Likes
414 Views
4 Replies
Replies (4)
Message 2 of 5

Christian_Garimberti
Advisor
Advisor

Hi @emre_ergene4YJKG, to reset  the HMD position all the time, i added this code to a script that i use to start the XR session.

# once started the XR session the current camera is the HMD camera
currentCam = vrCameraService.getActiveCamera()

# reset the camera position to the world "zero"
currentCam.setTranslation(QVector3D(0,0,0))
currentCam.setRotationAsEuler(QVector3D(90,0,0))

You can always use the 0,0,0 position for an always working behavior, or you can put your position if you want to start in your custom position.

You can create a variant set to start the XR session and set the position.

vrOSGWidget.setDisplayMode(vrOSGWidget.VR_DISPLAY_VARJO)
# your custom code for the XR session settings
#########
# reset the camera position to the world "zero"
currentCam = vrCameraService.getActiveCamera()
currentCam.setTranslation(QVector3D(0,0,0))
currentCam.setRotationAsEuler(QVector3D(90,0,0))

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 3 of 5

emre_ergene4YJKG
Participant
Participant

Hi Christian,

 

Thank you for you reply. I can see what you are suggesting is nice when the active camera in the scene controlled by the headset is not perfectly on the origin point and with some rotation. For example if you accidentally click on the viewport and suddenly the object is flying in the air. Using the code you have written is putting the camera back to the right place.

 

However the main problem we are having is the misalignment between the Steam VR positioning system and VRED. If there is an issue with the system, if it is giving VRED the wrong real world coordinates then resetting the camera position and orientation does not help. Sometimes we setup everything carefully but just before the presentation or review I can clearly see the model jumping to another position or height. Resetting the camera does not help in this case. That is why we are trying to use a real world object / reference point for the re-alignment. So even a if there is an offset with the real world and tracked world, we can reset the world coordinate system.

 

We could somehow manage doing this by using a Vive tracker, combining all the geometry under one node called world "SceneOrigin" (because you can not move the Root node) and creating a temporary constraint between the tracker and this node. You can see the code below. Then we have a Variant Set that triggers the "startResetOrigin()" function. This is working fine for now.

 

sceneOrigin = vrNodeService.findNode("SceneOrigin")
tracker = vrDeviceService.getVRDevice("tracker-1")
trackerNode = tracker.getNode()
timer = vrTimer(1)
timer.connect("endResetOrigin()")
currentCam = vrCameraService.getActiveCamera()

def startResetOrigin():
global constraint
constraint = vrConstraintService.createParentConstraint([trackerNode], sceneOrigin, False)
timer.setActive(true)

def endResetOrigin():
vrConstraintService.deleteConstraint(constraint)
print(constraint)
timer.setActive(false)

 

But I am hoping to find a more elegant solution. Is there a way to reset or re-adjust VRED's original / core World Coordinate System so we do not have to do all the mumbo jumbo?

0 Likes
Message 4 of 5

cikho
Collaborator
Collaborator

as i'm running more or less on the same problem, what type of vive tracker did you use?

https://www.vive.com/eu/accessory/tracker3/

 

the  old ones, or the new ones that work without tracking cameras?

https://www.vive.com/us/accessory/vive-ultimate-tracker/

 

_________________________________________________________

almost a showcase PRO user 😛

if you find my post useful, please give kudos or mark as solution 😄
0 Likes
Message 5 of 5

emre_ergene4YJKG
Participant
Participant

Hi Cikho,

 

We are currently using a Vive Tracker 3 with 4 Base Stations.

 

Cheers,
Emre

0 Likes