PatHightree / SpaceNavigator

SpaceNavigator driver for Unity3D
MIT License
173 stars 52 forks source link

Spacenavigator Wireless via USB - No Rotation but drift #55

Open Podden opened 1 year ago

Podden commented 1 year ago

Describe the bug Translation works but no rotation. Both Values are drifting without deadzone > 7. Input Debugger shows no change on Rotation Vector and hard lock to non-zero values. I use the Spacenavigator Wireless with USB Cable because of loosing the USB Dongle ;). grafik

To Reproduce Steps to reproduce the behavior: Create Project, Install Spacenavigator Driver 2.0.0-pre.9 package, see drifting, move Spacenavigator Navigation Axis, see nothing happen.

Expected behavior Rotation should work

Details (please complete the following information):

Additional context

HID Json { "vendorId": 9583, "productId": 50734, "usage": 8, "usagePage": 1, "inputReportSize": 13, "outputReportSize": 2, "featureReportSize": 8, "elements": [ { "usage": 1, "usagePage": 9, "unit": 0, "unitExponent": 0, "logicalMin": 0, "logicalMax": 0, "physicalMin": 0, "physicalMax": 0, "reportType": 1, "collectionIndex": 0, "reportId": 3, "reportSizeInBits": 1, "reportOffsetInBits": 8, "flags": 2 }, { "usage": 2, "usagePage": 9, "unit": 0, "unitExponent": 0, "logicalMin": 0, "logicalMax": 0, "physicalMin": 0, "physicalMax": 0, "reportType": 1, "collectionIndex": 0, "reportId": 3, "reportSizeInBits": 1, "reportOffsetInBits": 9, "flags": 2 }, { "usage": 39, "usagePage": 65280, "unit": 0, "unitExponent": 0, "logicalMin": 0, "logicalMax": 0, "physicalMin": 0, "physicalMax": 0, "reportType": 1, "collectionIndex": 0, "reportId": 23, "reportSizeInBits": 1, "reportOffsetInBits": 16, "flags": 2 }, { "usage": 53, "usagePage": 1, "unit": 17, "unitExponent": 12, "logicalMin": -350, "logicalMax": 350, "physicalMin": -1400, "physicalMax": 1400, "reportType": 1, "collectionIndex": 0, "reportId": 1, "reportSizeInBits": 16, "reportOffsetInBits": 88, "flags": 2 }, { "usage": 52, "usagePage": 1, "unit": 17, "unitExponent": 12, "logicalMin": -350, "logicalMax": 350, "physicalMin": -1400, "physicalMax": 1400, "reportType": 1, "collectionIndex": 0, "reportId": 1, "reportSizeInBits": 16, "reportOffsetInBits": 72, "flags": 2 }, { "usage": 51, "usagePage": 1, "unit": 17, "unitExponent": 12, "logicalMin": -350, "logicalMax": 350, "physicalMin": -1400, "physicalMax": 1400, "reportType": 1, "collectionIndex": 0, "reportId": 1, "reportSizeInBits": 16, "reportOffsetInBits": 56, "flags": 2 }, { "usage": 50, "usagePage": 1, "unit": 17, "unitExponent": 12, "logicalMin": -350, "logicalMax": 350, "physicalMin": -1400, "physicalMax": 1400, "reportType": 1, "collectionIndex": 0, "reportId": 1, "reportSizeInBits": 16, "reportOffsetInBits": 40, "flags": 2 }, { "usage": 49, "usagePage": 1, "unit": 17, "unitExponent": 12, "logicalMin": -350, "logicalMax": 350, "physicalMin": -1400, "physicalMax": 1400, "reportType": 1, "collectionIndex": 0, "reportId": 1, "reportSizeInBits": 16, "reportOffsetInBits": 24, "flags": 2 }, { "usage": 48, "usagePage": 1, "unit": 17, "unitExponent": 12, "logicalMin": -350, "logicalMax": 350, "physicalMin": -1400, "physicalMax": 1400, "reportType": 1, "collectionIndex": 0, "reportId": 1, "reportSizeInBits": 16, "reportOffsetInBits": 8, "flags": 2 }, { "usage": 32, "usagePage": 6, "unit": 0, "unitExponent": 0, "logicalMin": 0, "logicalMax": 100, "physicalMin": 0, "physicalMax": 1, "reportType": 1, "collectionIndex": 0, "reportId": 23, "reportSizeInBits": 8, "reportOffsetInBits": 8, "flags": 2 } ], "collections": [] }
amyodov commented 4 months ago

I see a similar behavior with my “SpaceMouse Compact” (wired connection) – which, regardless the name, is not a mouse but a typical 3dconnexion “knob”. productId is 50741, attaching the whole HID JSON file below. 3Dconnexion SpaceMouse Compact (HID).json

It seems to me like the newest devices, like SpaceMouse Compact or SpaceMouse Wireless, may not have a proper support by the driver, but the support for some of them may probably be added by some existing forks/pull requests. I see that Pull Request https://github.com/PatHightree/SpaceNavigator/pull/59 adds the support for SpaceMouse Wireless (so @Podden , your particular problem may or may not be resolved by installing the plugin from fork by @yozzozo , using an installation url like https://github.com/yozzozo/SpaceNavigator.git). Probably a very similar code may be implemented to add support for SpaceMouse Compact, with just a different productId; but this is a little bit too much for me, as I am merely on my second day of learning Unity. Let's cross the fingers for @PatHightree to find some time to merge the pull requests, add the newest productIds (I can help with testing for the SpaceMouse Compact!), and bring that 2.0.0 beauty to the Unity Asset Manager store!..

PatHightree commented 3 months ago

The drift issue has been addressed in 2.0.0-pre.10 3DConnection is anything but organized in their structuring of the device data, and the wireless devices are the worst.

The SpaceMouse Wireless HID code in PR #59 is already included. Not sure why the PR wasn't used to do that, might have something to do with axis switching logic being added to it. On second thought, the missing rotation could have been caused by switched rotation axes.

amyodov commented 1 month ago

The SpaceMouse Wireless HID code in PR https://github.com/PatHightree/SpaceNavigator/pull/59 is already included.

But what about the SpaceMouse Compact? Is the support of it merged already?

PatHightree commented 1 month ago

Short answer: no

Long answer: The plan of rewriting the plugin to not use the 3dconnexion sdk but the Unity InputSystem, vastly underestimated the complexity of the many different devices that the sdk abstracts away. This setback, plus the fact that I didn't even use the device anymore (been working on VR a lot) meant that this project has slipped way down my prio list.

However, I'm currently working on a project that makes good use of the SN and this rekindled my interest in the project. I've added some new features, but the device diversity problem remains.

At the moment, I'm not striving to add support for each device one by one. That's a huge amount of work and I only have 2 devices here to test with. (wireless devices are especially complicated) However, there have been some recent developments that could result in a mechanism that adds support for many (if not all) wired devices. Unfortunately, wireless devices are out of scope because of their complexity and the simple fact that I don't own any of those.