Strange offset HID, SpaceMouse Wireless

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
BYFo_Max
Posts: 5
Joined: Tue Nov 30, 2021 8:05 am
Contact:

Strange offset HID, SpaceMouse Wireless

Post by BYFo_Max »

Hi guys,
Im currently working on a assignment regarding SpaceMouse Navigation in virtual Unity 3D showroom.
Sadly the provided addon by Pat only works in the nonbuild version. When I build the project one of the axis has no output.

Anyway... so I wrote my own InputParser using Unitys new InputManager. Works very well and also functions in the final build version.
But Im getting a very strange offset. If you move the stick axis and idle for 3second suddenly there is a offset on the X-axis (0.1942825f).
When you move the stick again it's gone but if you don't do any inputs, the offset will reappear after 3seconds.
Here a picture with the offset shown at the VEC2 X value in the Unity Input Debugger.
Image
And here without offset.
Image

Im using Win 10 64bit
Unity 2020.3.5f1
Input System 1.0.2
Driver Versions:
1st generic Win10 auto pull driver
2nd try 3DxWare64_v10-7-4_r3350.exe

Any Ideas? Best regards, Max
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Strange offset HID, SpaceMouse Wireless

Post by jwick »

I must be missing something. Those two images look identical to me (other than the color).

Are you holding a steady force in one direction and holding it? If so, I'd suspect some sort of drift correction.

If it is the SMW, you would have to hold it very steady at that value - how much are you displacing it.
Then you would get data, then nothing (0 values). When you released the cap and let the device return to its physical center, you would get the exact opposite value until it autocalibrates itself again. 3 seconds sounds too short.

Do you have the same result over USB as over the air?
BYFo_Max
Posts: 5
Joined: Tue Nov 30, 2021 8:05 am
Contact:

Re: Strange offset HID, SpaceMouse Wireless

Post by BYFo_Max »

thanks for the quick reply,
the thing is that the preview cuts off digits but the difference is in the VEC2 value 93.6 and 93.4
notice the altering of the tailing digits and the offset occurs without any human input, they are cut off for better readability
but I logged the values via c# and discovered the 0.1942825
when I use the SpaceMouse with a USB connection instead the offset jumps after 2-3 to 1.0 hmmpf in the VEC2 on the X axis
Image
Here a screen again with the timelog of the last inputs, the last at 230.8189 is the pseudo input adding the offset
and you can see the 2sec pause? very odd
but the pause can also be 3secs in some cases
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Strange offset HID, SpaceMouse Wireless

Post by jwick »

Yes, you are right. I missed that digit after the decimal pt. What's the other value in there (93.6) mean?
What do you mean by "without any human input"? You aren't touching the device?
If it is a wireless device, it will send a battery packet after you release the cap. That may be misinterpreted by something.

Are you trying to get the device to work in the game, or just in the editor? Last I looked, PatH's plugin worked well. I heard he was working on a new version. They may all be limited to the editor though.
BYFo_Max
Posts: 5
Joined: Tue Nov 30, 2021 8:05 am
Contact:

Re: Strange offset HID, SpaceMouse Wireless

Post by BYFo_Max »

when I just start the scene, no problemo
as soon as I touch the SpaceMouse once, 2-3seconds after the last user input on the SpaceMouse the offset appears

this is the static offset the 93.6, I can say InputControl.getValueAsObject - InputControl.getDefaultValueAsObject and then I get the -1.0 to 1.0 range
but maybe this parsing is the root of my problem
I will have a closer look again and try to parse it maybe in another way

and the problem I sadly encounter with the Version of Pat is that as soon that I build the project to *.exe the rotation axis is not responding anymore
just the translation axis
BYFo_Max
Posts: 5
Joined: Tue Nov 30, 2021 8:05 am
Contact:

Re: Strange offset HID, SpaceMouse Wireless

Post by BYFo_Max »

I managed to use the Version from Pat by manually calling a static constructor through reflection
through adding the following lines to my Camera Script
thanks for your effort

Code: Select all

        void Start()
        {
            Type wireless = typeof(SpaceNavigatorWirelessHID);
            System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(wireless.TypeHandle);

            Type wired = typeof(SpaceNavigatorHID);
            System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(wired.TypeHandle);
            Debug.Log("Called static");
        }
Post Reply