ValveSoftware / steamvr_unreal_plugin

SteamVR Input Unreal Plugin - Documentation at: https://github.com/ValveSoftware/steamvr_unreal_plugin/wiki Sample project (UE4.15-4.23): https://github.com/ValveSoftware/steamvr_unreal_plugin/wiki/sample/SteamVRInputPlugin.zip Sample Project (UE.424+): https://github.com/ValveSoftware/steamvr_unreal_plugin/wiki/sample/SteamVRInputPlugin_UEIntegrated.7z

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tracker role not working with certain action path

chengnay opened this issue · comments

I set Tracker role to Left or Right Shoulder.
In my json(vive_tracker_left_shoulder.json or vive_tracker_right_shoulder.json) file, I set the poses output to "/actions/main/in/special4", but I couldn't get the pose.
After I edit the output path to "/actions/main/in/special8", I can get the pose.
Is there any mapping rule (role to output path)?

Hi @chengnay - Yes, if you're using an older GitHub source version, here's the key:

A. HANDED CONFIGURATION DEFAULT POSE MAPPINGS
Special 1: Left Hand Raw
Special 2: Right Hand Raw
Special 3: Left Hand Back
Special 4: Right Hand Back
Special 5: Left Hand Front
Special 6: Right Hand Front
Special 7: Left Hand Front & Rolled
Special 8: Right Hand Front & Rolled
Special 9: Left Hand Pistol Grip
Special 10: Right Hand Pistol Grip

B. SEPARATE TRACKER CONFIGURATION MAPPED POSES
Special 1: Camera
Special 2: Waist
Special 3: Left Foot
Special 4: Right Foot
Special 5: Left Shoulder
Special 6: Right Shoulder
Special 7: Chest
Special 8: Keyboard

We also have a pending Pull Request for UE4.26 to get custom motion sources in the engine to make this a bit easier in the future.

The source version (UE 4.23 and below) already have the custom motion sources, see here:

#89

BTW, if you're using 4.24 or 4.25, you need to manually do the role to path via the SteamVR Dashboard (you can set any path to role) until our Pull Request is added in 4.26.

What is the maximum number of trackers that UE4 can support?
Special 1 to 8 + 2 * Held in Hand = 10?

Hi @chengnay - for the built in plugins without our pending pull request/s, it can only handle up to 8 as it is tied to the "Special" motion sources provided by the engine.

with the pull request/s or the code in GitHub you should be able to use all the roles. SteamVR itself has a theoretical limit of 30 + 1 base station + 1 hmd concurrent, but performance and ability for them all to work properly may depend on your system (e.g. usb bandwidth).

During my test, I found out that when I set same role for trackers, they will not show in my content.
Will this be fixed in the pending pull request/s?

Hi @chengnay - sorry, I'm not sure I understood the use case/situation - can you provide some screenshots and json files please so I can have a closer look?

Thanks!

I am using the default "Motion Controller Map" provided by UE4.25.3.
I edited the VRPawn as follows,
image

Below is a success case that if only one tracker is set to Camera, then the other set to Disabled, I can the "LHR-84963CB2" tracker in my content.
image
image

After I set both trackers to Camera role, none of them will show up in the content.

My vive_tracker_camera.json as follows,
{
"name": "Default bindings for Vive Trackers",
"controller_type": "vive_tracker_camera",
"last_edited_by": "UnrealEngine",
"bindings":
{
"/actions/main":
{
"sources": [
{
"mode": "trackpad",
"path": "/user/camera/input/trackpad",
"inputs":
{
"click":
{
"output": "/actions/main/in/TeleportRight"
}
}
},
{
"mode": "trigger",
"path": "/user/camera/input/trigger",
"inputs":
{
"click":
{
"output": "/actions/main/in/GrabRight"
}
}
}
],
"poses": [
{
"output": "/actions/main/in/special1",
"path": "/user/camera/pose/raw"
}
]
}
},
"description": "TrackerBinding-13942748"
}

Hi @chengnay - with the integrated plugin in UE4.25 without our Pull Request, you need to generate your own json files for the vive trackers.

Here're the pre-generated tracker files for all possible roles which you can use (just drop in your Config\SteamVRBindings folder:
vive_tracker_json.zip

the steamvr_manifest.json under "default_bindings", you need to add the references to the vive tracker json files, like so:

	"default_bindings": [
		{
			"controller_type": "knuckles",
			"binding_url": "knuckles.json"
		},
		{
			"controller_type": "vive_controller",
			"binding_url": "vive_controller.json"
		},
		{
			"controller_type": "vive_cosmos_controller",
			"binding_url": "vive_cosmos_controller.json"
		},
		{
			"controller_type": "oculus_touch",
			"binding_url": "oculus_touch.json"
		},
		{
			"controller_type": "holographic_controller",
			"binding_url": "holographic_controller.json"
		},
		{
			"controller_type": "indexhmd",
			"binding_url": "indexhmd.json"
		},
		{
			"controller_type": "vive",
			"binding_url": "vive.json"
		},
		{
			"controller_type": "vive_pro",
			"binding_url": "vive_pro.json"
		},
		{
			"controller_type": "rift",
			"binding_url": "rift.json"
		},
		{
			"controller_type": "vive_tracker",
			"binding_url": "vive_tracker.json"
		},
		{
			"controller_type": "vive_tracker_camera",
			"binding_url": "vive_tracker_camera.json"
		},
		{
			"controller_type": "vive_tracker_waist",
			"binding_url": "vive_tracker_waist.json"
		},
		{
			"controller_type": "vive_tracker_left_foot",
			"binding_url": "vive_tracker_left_foot.json"
		},
		{
			"controller_type": "vive_tracker_right_foot",
			"binding_url": "vive_tracker_right_foot.json"
		},
		{
			"controller_type": "vive_tracker_left_shoulder",
			"binding_url": "vive_tracker_left_shoulder.json"
		},
		{
			"controller_type": "vive_tracker_right_shoulder",
			"binding_url": "vive_tracker_right_shoulder.json"
		},
		{
			"controller_type": "vive_tracker_chest",
			"binding_url": "vive_tracker_chest.json"
		},
		{
			"controller_type": "vive_tracker_handed",
			"binding_url": "vive_tracker_handed.json"
		},
		{
			"controller_type": "vive_tracker_keyboard",
			"binding_url": "vive_tracker_keyboard.json"
		},
		{
			"controller_type": "gamepad",
			"binding_url": "gamepad.json"
		}
	],

Please note as the engine version of SteamVR is slightly outdated, you won't have access to Elbows and Knees in UE 4.25 even if you generate the tracker files.

Lastly steamvr_manifest.json gets automatically updated by the engine, so you may need to set it to read-only to ensure your changes won't get lost - this would unfortunately also mean you need to manually edit the files if you need new input mappings.

This won't be necessary once Epic adds our Pull Request in to a future version of the engine.

@1runeberg I cannot even get one of my trackers working with pose.

I replaced the json files inside vive_tracker_json.zip to my project folder, this is what I see in Controller Binding UI when I play my content.

When I have 2 trackers using Camera role,

image

The input path looks weird.

After I switched off one of the trackers and set it to DISABLED,

image

After clicking on Unused,

image

Previously, when I was working on trackers in Unity version, I thought the path for each role (which will be the same as what I see in Controller Binding UI) will be as follows,
/user/camera/pose/raw
/user/waist/pose/raw
/user/foot/left/pose/raw or /user/foot/right/pose/raw
/user/shoulder/left/pose/raw or /user/shoulder/right/pose/raw
... etc

I saw the json files provided by you the path of each role are all set to /user/hand/right or /user/hand/left.

Anything that I did wrong which caused my trackers not working with your json files?

@1runeberg Do you have any update regarding the issues that I posted above?

Hi @chengnay - sorry, I mustve missed your response. Did you change the steamvr_manifest as well as per my initial reply? Also, you should have one unque role per tracker, which is what the json files and steamvr manifest edits are complementing.

Hi @1runeberg,
Yes, I did modified the steamvr_manifest. If I can only have one unique role per tracker, how is it possible to support up to 30? Is your pull request merged yet?

@chengnay - the pull request isn't in yet and its unlikely until 4.26 at least.

The 30 is a theoretical limit, as it will depend on your hardware/PC (e.g. usb bandwidth).

The Unreal Plugin, without our Pull Request, cant handle more than the number of "Special" motion sources provided by Unreal.
Did you check the sample I gave for the steamvr manifest? Can you double check please that you have the correct number of json files and references in your steamvr manifest? And you can only assign one role to a camera tracker and link that to a "special" pose action. You need to assign DIFFERENT roles for each tracker.

Hi @1runeberg,
I just double check again. The result is still the same which I still cannot use the json files provided by you to work.
I will attach my json files for your reference.
SteamVRBindings_chengnay.zip

I tested with 3 Vive trackers (Role set to Camera, Left Foot and Right Foot), the redundant trackers that are disconnected I set them all to DISABLED.

In SteamVR Controller Binding UI (Left Foot), I saw that the path is not shown as the one you provided in vive_tracker_left_foot.json.

image

Hi @chengnay -the individual json tracker files are not properly mapped it seems. I may have provided you the wrong set of json files though (from your previous comments).

Please try the attached ones here instead.
steamvr_vive_tracker_json.zip

Have you also tried the handed roles? Can you verify please if they work on your end?

Hi @1runeberg,

For some reason, the waist role is not working properly.

image

I set 3 trackers to Chest, Left Shoulder and Waist.

Handed roles are working perfectly.

One question regarding handed roles, if I already have 2 controllers and I also set my 2 trackers to handed roles. I cannot see neither the controllers nor the trackers in the scene. Is it illegal to do that? Even my third tracker which is set to Left Shoulder role is not shown too.

@chengnay can you open the json file for the waist and make sure the path is correct, use the chest as a pattern, just change the word "chest" to waist.

You should be able to use the handed roles with controllers.

Check the logs and see if you get any errors especially on the special roles.

You cannot reuse the Special motion source though to artificially inflate the amount of trackers you can use at the same time. So you have to choose where to use Special1, Special2, etc... see the guide i sent on my first reply on this thread.

@1runeberg Yes, I did double check the vive_tracker_waist.json file is using "/user/waist/pose/raw", but after launching my scene, I found out that the tracker does not appear in the scene, that's why I opened up the Controller Binding UI and saw that the defined path is not the same as the json file.

You should be able to use the handed roles with controllers.

In normal cases, what will I see in the scene if I have handed roles with controllers?

I did not see any error logs on the Output log console. Is there any system level log that I can look into?

You can check the steamvr logs and see if you're loading the correct action manifest, you should be able to see the steamvrmanifest path from the Unreal logs or console output as well.

Also check the steamvr_manifest and see if its pointing at the correct waist json file.

A good quick test to do is change the name of the project under project settings to make sure you are not using an old steamvr manifest

Hi @chengnay - how is it going with trackers for your project?

Hi @1runeberg

I just double check again for 3 Vive trackers case, and this time is the Left Shoulder that cannot bind.

image

By looking at below screenshot, does it mean that default binding file is loaded from my project?

image

By the way, where should I locate the steamvr logs?

I did not see any error log on Unreal output log console.

image

I also change the name of the project, the error still exists.

Hi @chengnay - you mentioned you already checked the raw path in the json file? can you put the contents here?

Hi @1runeberg Yes, I am using the json files that you provided last week.

{
"name": "Default bindings for Vive Tracker (Left Shoulder)",
"controller_type": "vive_tracker_left_shoulder",
"last_edited_by": "steamvr",
"bindings":
{
"/actions/main":
{
"sources": [{}],
"poses": [
{
"output": "/actions/main/in/special5",
"path": "/user/shoulder/left/pose/raw",
"requirement": "optional"
}
]
}
},
"description": "Sample Tracker"
}

the json there looks correct to me still, not sure where your SteamVR is reading "Right Hand Raw" from.

Can you doublecheck:

(1) C:\Users\Chengnan_yang\AppData\Local - Look for the name of your project here as a folder and delete the folder. Restart the Editor

-or-

(2) Try adding a name to the Project - it's still showing the template name from the logs you posted here. You can set the Project Name and Description in "Settings" > "Project Settings" in Unreal under "Project - Description", make sure the Project Name and Description fields aren't empty.

-or-
(3) Open {DriveLetter}:\Program Files (x86)\Steam\config\steamvr.vrsettings and DELETE and entries with "ue" in it.

@1runeberg After I restarted the Editor, the project name is updated.
image

I found out a weird behavior. The one that is showing the wrong path isn't the tracker that is not showing up in the scene.

For example, A and B trackers which are set to Waist and Camera role respectively.
In Controller Binding UI, A tracker shows wrong path and no pose action assigned, but it actually shows up in the scene.
Unlike B tracker which shows correct path but not showing up in the scene.

How should I debug situation like this?

Make sure the MotionSource is correctly mapped in Unreal (Special1/2/3/4/... etc) with the correct tracker role. You can double check if you have the correct physical tracker with the correct role by turning htem on and off, I dont think you can get consistent results with tracker + role in every run with steamvr

Hi @1runeberg I double check the mapping and it is correct. After checking by turning off and on and also switch roles to every tracker, only the tracker that assigned with Waist role cannot show up.

Hi @chengnay - bit confused, I thought the problem was the left shoulder one?

Can you try the other solutions I posted on the earlier post? I think it's just some misconfig somewhere, all the settings appear to be correct.

Additionally you can also test setting the other Motion Sources, it might be somehow ending up in a different motion source in your project for some reason. Make sure you dont have any other Motion Controller Component doubling up on the same Motion Source and causing a conflict.

Another thing to check is if you are actually getting proper tracking of all three WITHOUT Unreal Engine - that is just testing with SteamVR.

bit confused, I thought the problem was the left shoulder one?

This is my mistake by looking at Controller Binding UI and mistook that it is Left Shoulder role is not showing up, but actually it is Waist role.

I did double check the tracking of all the trackers in compositor and SteamVR, they all work fine.

Can you post all the tests that I've suggested so far (from several posts) that you try and what the results for EACH one of them are so I understand what's been done and not.

Thanks,
Rune

Can you doublecheck:

(1) C:\Users\Chengnan_yang\AppData\Local - Look for the name of your project here as a folder and delete the folder. Restart the Editor

-or-

(2) Try adding a name to the Project - it's still showing the template name from the logs you posted here. You can set the Project Name and Description in "Settings" > "Project Settings" in Unreal under "Project - Description", make sure the Project Name and Description fields aren't empty.

-or-
(3) Open {DriveLetter}:\Program Files (x86)\Steam\config\steamvr.vrsettings and DELETE and entries with "ue" in it.

(1) I did not find any folder with the name of my project.
(2) I use this method to change the project name and description.
(3) I did not see steamvr.vrsettings under the folder {DriveLetter}:\Program Files (x86)\Steam\config
I only see steamapps.vrmanifest but in this file I did not find any with "ue"

Additionally you can also testing the other Motion Sources, it might be somehow ending up in a different motion source in your project for some reason.

If I change the Motion Source of Waist to Special 1, it can show up normally but this will not resolve my issue as it will be using the same Motion Source as Camera role and I will not be able to use 8 trackers (MAX).

Anything that I miss?

If I change the Motion Source of Waist to Special 1, it can show up normally but this will not resolve my issue as it will be using the same Motion Source as Camera role and I will not be able to use 8 trackers (MAX).

Anything that I miss?

Thanks for that. So are you saying you have SEVEN trackers all working and only the Waist tracker role is not working when you have the MotionController component set to "Special 2"?

Special 1: Camera
Special 2: Waist
Special 3: Left Foot
Special 4: Right Foot
Special 5: Left Shoulder
Special 6: Right Shoulder
Special 7: Chest
Special 8: Keyboard

But all other Motion Sources and configs are working fine?

Hi @1runeberg Yes, I use 4 trackers to test,
First round, Special 1 to 4, only the tracker with Waist role not working.
Second round, Special 5 to 8, all of them working fine.

great! thanks.

a few additional things to check:

(1) Remove any other Motion Controller other than Specials 1-8 in your pawn if you haven't already
(2) Double-check that you do NOT have a Tracker setup as Handed: Right Hand Raw in your pawn or any other object in the scene
(3) Try setting "Display Device Model" for MC_Special2

Failing this, can you post please, directly from your project, the following:

(1) steamvr_manifest.json file
(2) vive_tracker_waist.json
(3) screenshot of the tracker role binding in steamvr
(4) screenshot of the tracker action pose binding
(5) full UE4 log
(6) screenshot of the MC_Special2 MotionSource setting
(7) screenshot of the Static Mesh setting that's attached to the MC_Special2 - specifically the static mesh and the transform settings

@1runeberg

So are you saying you have SEVEN trackers all working and only the Waist tracker role is not working when you have the MotionController component set to "Special 2"?

Sorry for mistaken the question on this part. I found the root cause is that I accidentally set MC_Special2's Motion Source to Special1. @@

Everything works perfectly now.

Thanks for your great support!!

ah, that'll explain it. No prob at all @chengnay . Glad it's all sorted now :) Enjoy!

Cheers,
Rune

Closing per the last couple comments.