Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding HTC tracker support #58921

Merged
merged 1 commit into from
Jun 20, 2022

Conversation

BastiaanOlij
Copy link
Contributor

@BastiaanOlij BastiaanOlij commented Mar 9, 2022

This adds supports for Vive trackers to our OpenXR implementation.

The work in this PR is finished however we are waiting on a fix in SteamVR to be made official. Merging this will break tracking on the current SteamVR even if HTC trackers are not used. You can test this PR using the current SteamVR beta.

HTC trackers are small tracked devices that can track arbitrary locations. You can attach a tracker to peripheral like a gun or keyboard and track its location in space, or you can attach one or more trackers to set locations on your body to enable full body tracking. For this purpose it is important that you pair all the trackers in SteamVR and then identify the usage of each tracker.

This you do by opening the menu in your SteamVR status window and selecting Settings. In the settings window go to Controllers and then MANAGE TRACKERS. A dialog similar to the following will open up:
image
In this screenshot only one tracker is active and it is identified as tracking the location of a keyboard.

In Godot you need to make sure the action map is setup, if you're using the default action map but have an older version, just delete it and once you run your project an updated map is created. Else you need to manually add the entries:
image

You can add an XRController3D node for the tracker underneath your XROrigin3D node like so:
image

Note how in the inspector the tracker is set to the correct input path, in our case /user/vive_tracker_htcx/role/keyboard. All the possible trackers roles are now available in the dropdown. Just add controller nodes for each tracker you wish to support.

In the example we're simply showing a mesh of the tracker body:
image

A demo project showcasing this functionality can be found here: BastiaanOlij/godot4_openxr_demo#6

@Calinou Calinou added this to the 4.0 milestone Mar 9, 2022
@BastiaanOlij BastiaanOlij force-pushed the htc_vive_trackers branch 2 times, most recently from 85c4427 to 1028acf Compare March 15, 2022 09:04
@BastiaanOlij BastiaanOlij force-pushed the htc_vive_trackers branch 2 times, most recently from 87b3c93 to 9d6677d Compare April 22, 2022 04:42
@BastiaanOlij BastiaanOlij marked this pull request as ready for review June 16, 2022 07:59
@BastiaanOlij BastiaanOlij requested a review from a team as a code owner June 16, 2022 07:59
@BastiaanOlij BastiaanOlij self-assigned this Jun 16, 2022
@BastiaanOlij
Copy link
Contributor Author

@akien-mga not sure if there is anyone who can review this, but from my part this is ready to be merged.

@akien-mga akien-mga changed the title Htc vive trackers Adding HTC tracker support Jun 20, 2022
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good.

@akien-mga akien-mga merged commit 77be20e into godotengine:master Jun 20, 2022
@akien-mga
Copy link
Member

Thanks!

@BastiaanOlij BastiaanOlij deleted the htc_vive_trackers branch June 22, 2022 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants