Fix SpaceMouse detection failing when the HID backend reports no product string - #7498
Open
rwiltz wants to merge 3 commits into
Open
Fix SpaceMouse detection failing when the HID backend reports no product string#7498rwiltz wants to merge 3 commits into
rwiltz wants to merge 3 commits into
Conversation
The hidapi wheels bundle a libusb-backed HID backend, which reports an empty product string unless the process may open the USB node. Detection compared the product string against an exact list, so a connected SpaceMouse was reported as 'No device found', and the documented '/dev/hidraw*' permission workaround has no effect on that backend. Match the enumerated devices by their USB vendor and product ids, keeping the product string as a fallback and also accepting the '3Dconnexion ' prefix that some backends prepend. Report the enumerated devices and the required USB permissions when no device is found or when opening one fails, and document the udev rule that actually grants access.
rwiltz
requested review from
AntoineRichard,
StafaH,
fatimaanes,
kellyguo11,
ooctipus and
pbarejko
as code owners
September 2, 2026 20:46
Contributor
Greptile SummaryThe PR makes SpaceMouse discovery independent of optional HID product strings and improves permission diagnostics. It also completes the prior review fixes:
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "Address review feedback on SpaceMouse di..." | Re-trigger Greptile |
Contributor
There was a problem hiding this comment.
Isaac Lab Review Bot
The USB-id-based SpaceMouse detection and permission guidance are coherent overall, but the updated teleoperation tip introduces contradictory compatibility guidance for older supported devices.
- Design and architecture: The shared detection helpers centralize USB-id and product-name resolution while preserving distinct supported-device sets for the SE(2) and SE(3) implementations. No architectural issue was identified.
- API: Constructor signatures and exception types remain unchanged, and USB-id matching extends the previous product-string behavior. However, the documentation now gives setup instructions for SpaceNavigator for Notebooks while the same tip still claims only SpaceMouse Wireless and Compact are compatible; the documented support surface must be made consistent.
- Implementation: The changed detection paths correctly map known USB identifiers to the report-layout names consumed by the listeners, retain product-string fallback behavior, and preserve the original open failure through exception chaining. The actionable issue is limited to reconciling the contradictory supported-model statements in the teleoperation documentation.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
Only the directly attached SpaceMouse Compact and SpaceMouse Wireless ids are confirmed against the USB ID repository and the report layout the listener threads assume. Wireless receivers enumerate under their own product ids and use a different report layout, so match those by product string only, as before.
- Do not abandon discovery when a supported device cannot be opened: an inaccessible device enumerated first no longer hides a usable one behind it. Discovery now stops at the first device it opens, matching the documented contract, and reports the collected open failures only when none succeeded. - Scope the documented udev rule to the local seat and the plugdev group instead of granting every account read and write access to the vendor's devices. - List the actually supported models in the teleoperation tip, which still claimed only the SpaceMouse Wireless and Compact were compatible.
Contributor
Author
Contributor
Author
|
run-ci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
QA reported that
isaaclab teleop run --teleop_device spacemouseaborts withNo device found by SpaceMouse. Is the device connected?while a SpaceMouse Compact(
256f:c635) is connected and visible on/dev/hidraw4, even after applying thesudo chmod 666 /dev/hidraw<#>workaround our teleoperation guide documents.Root cause
The
hidapiwheel we depend on bundles a libusb-backed HID backend, not the hidraw one:That backend reaches the device through
/dev/bus/usb, and it can only read USB stringdescriptors for devices the process is allowed to open. Without that access,
hid.enumerate()still lists the device but returns
product_string == ''. Detection compared the productstring against an exact list:
so an empty string matched nothing and the device was reported as absent. The documented
chmod 666 /dev/hidraw<#>grants nothing to this backend, which is why the workaroundappeared to have no effect.
This reproduces on any USB HID device the user lacks USB permissions for — no SpaceMouse
required:
The exact match is fragile in the other direction too: on a hidraw-backed
hidapitheproduct string can come back as the kernel's combined name, e.g.
3Dconnexion SpaceMouse Compact, which also fails to equalSpaceMouse Compact.Changes
Se2SpaceMouse/Se3SpaceMousenow match enumerated devices by USB vendor/product id(
SPACEMOUSE_USB_IDSindevices/spacemouse/utils.py, ids taken from the USB IDrepository at https://www.linux-usb.org/usb.ids), covering exactly the models each device
class already supported. The product string is kept as a fallback so devices with ids we
do not list keep working, and is matched both verbatim and with a leading
3Dconnexionstripped.
backend needs access to
/dev/bus/usb, not/dev/hidraw*.OSError: open failed.teleop_imitation.rst: replaced the ineffectivechmod 666 /dev/hidraw<#>tip with audev rule for vendor
256f(covering bothSUBSYSTEM=="usb"andhidraw), and correctedthe Docker recipe to mount
/dev/bus/usbwith the matchingdevice_cgroup_rules.Fixes # (issue)
Type of change
Release backport
developChecklist
Docker and GPU tests run on demand. Push the commits you want tested, then
comment
run-cion the pull request.pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that)CONTRIBUTORS.mdor my name already exists there