Resetting HTC Vive Origin/"World"

368 Views Asked by At

Was wondering if anyone can help.

So I'm attempting to try reset the origin point of "world" on the HTC using OpenVR. e.g. the (0, 0, 0) point as set up during room setup when I had to align the HMD to screen etc.

I was wondering if this is possible to do through code & if so can someone point me in the right direction?

I found that the oculus has a ovr_RecenterTrackingOrigin() function which seems to do what I want.

But is there an equivalent for the HTC? I want to reset the origin point since I am stuck standing in the same spot & want to have an option to calibrate a new origin if I am standing away from the initial "world" origin.

I'm using a python script from: https://github.com/uts-magic-lab/htc_vive_teleop_stuff/blob/master/scripts/vive_tf_and_joy.py

& getting the position from this part of the code:

poses = poses_t()
vrsystem.getDeviceToAbsoluteTrackingPose(
    openvr.TrackingUniverseStanding,
 0,
 len(poses),
    poses)

now = rospy.Time.now()
transforms = []
# Hmd is always 0
matrix = poses[0].mDeviceToAbsoluteTracking

hmd_pose = from_matrix_to_transform(matrix, now, "world", "hmd")
transforms.append(hmd_pose)

If anyone has any tips, I'd appreciate it very much.

1

There are 1 best solutions below

0
On

You should be able to call vrsystem.resetSeatedZeroPose() to reset your OpenVR origin