UT-Austin-RPL / deoxys_control

A modular, real-time controller library for Franka Emika Panda robots
Apache License 2.0
140 stars 20 forks source link

Cannot open SpaceMouse #24

Closed Yingdong-Hu closed 5 months ago

Yingdong-Hu commented 6 months ago

I use SpaceMouse Compact. The vendor_id=9583, product_id=50741 But it seems that hid cannot open the device when I run python examples/run_deoxys_with_spacemouse.py

Traceback (most recent call last):
  File "examples/run_deoxys_with_space_mouse.py", line 71, in <module>
    main()
  File "examples/run_deoxys_with_space_mouse.py", line 26, in main
    device = SpaceMouse(vendor_id=args.vendor_id, product_id=args.product_id)
  File "/home/isrlab/codebase/deoxys_control/deoxys/deoxys/utils/io_devices/spacemouse.py", line 118, in __init__
    self.device.open(vendor_id, product_id)  # SpaceMouse
  File "hid.pyx", line 142, in hid.device.open
OSError: open failed

I get the vendor_id and product_id from hid.enumerate(). I found that after connecting the SpaceMouse to the computer, this item will appear, so I am sure this is its id. I don’t know if these outputs mean that the spacemouse is successfully connected. iGm9VBdTJh

derekgeng15 commented 2 months ago

Hi, I encountered this error as well. What's the solution?

zhuyifengzju commented 2 months ago

The person perviously asked solved the issue by just replugging the spacemosue to the machine after all the configuration setup following our documentation. Please give me more details if things still don't work.

tsrobcvai commented 3 days ago

Just a reminder:

Try to use "lsusb". This will list all connected USB devices, and you should see an entry for your SpaceMouse. The ATTRS{idProduct} = "yyyy" will be shown in the format xxxx:yyyy. Then, you might need to modify xx-spacemouse.rules under the folder /etc/udev/rules.d/:

KERNEL=="hidraw*", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="yyyy", MODE="0666", GROUP="plugdev" SUBSYSTEM=="usb", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="yyyy", MODE="0666", GROUP="plugdev"

This works for me.