0

I have a question for anyone that's been using nDisplay with vive trackers.

I set up using Ben Kidd's videos on youtube with the nDisplay new project template and created this blueprint: https://blueprintue.com/blueprint/fgg1zcub/ by creating a blueprint subclass of DisplayClusterRootActor

Screenshot of DisplayClusterRootActor Blueprint subclass

I put the GetVRPNTrackerLocation not being a function down to being in a different version of UE (4.26)

In VRPN, I'm getting the following data from the controller (not using a tracker atm):

Tracker openvr/controller/LHR-F7FD3B46@192.168.0.41:3884, sensor 0:
        pos (-0.08,  0.78, -0.36); quat ( 0.20,  0.07, -0.15,  0.96)
Tracker openvr/controller/LHR-F7FD3B46@192.168.0.41:3884, sensor 0:
        pos (-0.08,  0.78, -0.36); quat ( 0.20,  0.07, -0.16,  0.96)
...

and that's coming through in my Print String

relative position output

so I know that the data is passing through from the controller -> VRPN -> UE4 / nDisplay and it looks similar to Ben's (numbers from -2ish to 2ish)

lastly in my nDisplay cfg i have (alongside my monitor setup):

...
[camera] id="camera_static" loc="X=0,Y=0,Z=0" parent="eye_level" eye_swap="false" eye_dist="0.064" force_offset="0" tracker_id="ViveVRPN" tracker_ch="0"

[input] id="ViveVRPN" type="tracker"  addr="openvr/controller/LHR-F7FD3B46@192.168.0.41:3884" loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0" front="-Z" right="X" up="Y"
...

however the movement of the camera is really tiny and not representative of the actual camera movements.

obie
  • 578
  • 7
  • 23

2 Answers2

1

Finally it's not only me with this issue.

The issue is that seemingly the GetVRPNTrackerLocation only takes into consideration the first axis, assigns it to front, and sets the rest to positive X.

As for the underlying problem, I have no idea where this happens, but since I needed a quick fix I just hardcoded these values into engine code, and didn't look for a more permanent fix.

So in case you want to do this workaround here's what I did:

  1. Follow these steps to obtain a source version of Unreal 4.26 (I would recommed the 4.26 branch) https://docs.unrealengine.com/en-US/ProductionPipelines/DevelopmentSetup/BuildingUnrealEngine/index.html
  2. Find {UnrealSourceFolder}\Engine\Plugins\Runtime\nDisplay\Source\DisplayCluster\Private\Input\Devices\VRPN\Tracker\DisplayClusterVrpnTrackerInputDevice.cpp
  3. Modify these two methods

FVector FDisplayClusterVrpnTrackerInputDevice::GetMappedLocation(const FVector& Loc, const AxisMapType Front, const AxisMapType Right, const AxisMapType Up) const
{
    static TLocGetter funcs[] = { &LocGetX, &LocGetNX, &LocGetY, &LocGetNY, &LocGetZ, &LocGetNZ };
    //return FVector(funcs[Front](Loc), funcs[Right](Loc), funcs[Up](Loc));
    return FVector(funcs[AxisMapType::NZ](Loc), funcs[AxisMapType::X](Loc), funcs[AxisMapType::Y](Loc));
}
 
FQuat FDisplayClusterVrpnTrackerInputDevice::GetMappedQuat(const FQuat& Quat, const AxisMapType Front, const AxisMapType Right, const AxisMapType Up, const AxisMapType InAxisW) const
{
    static TRotGetter funcs[] = { &RotGetX, &RotGetNX, &RotGetY, &RotGetNY, &RotGetZ, &RotGetNZ, &RotGetW, &RotGetNW };
    //return FQuat(funcs[Front](Quat), funcs[Right](Quat), funcs[Up](Quat), -Quat.W);// funcs[axisW](quat));
    return FQuat(funcs[AxisMapType::NZ](Quat), funcs[AxisMapType::X](Quat), funcs[AxisMapType::Y](Quat), -Quat.W);// funcs[axisW](quat));
}
Dharman
  • 30,962
  • 25
  • 85
  • 135
  • Thanks for the response - We've moved to the LiveLinkXR plugin to manage this and it's working very well – obie Jan 20 '21 at 11:29
  • @obie, did you find any documentation about using LiveLink with ndisplay? I have it connected in editor, but ndisplay shows no motion. Thanks! – anti Feb 05 '21 at 08:55
0

So I just upgraded from a working 4.25 version to 4.26 and then came across the same issue. I then built the engine and debugged my way through to find the cause and a possible solution for this problem. It seems like it is a problem with the .cfg text files and the axes getting parsed incorrectly.

An easy solution would be to import the .cfg file into the editor so it gets then converted to the new .json file format. Here you can then see the issue with wrong assigned axes on the tracker and can also change it in the new file. Afterwards just use the new .json file from then on for your ndisplay configuration and it should work correctly.

Joey
  • 1
  • 1