Skip to content

Commit

Permalink
Merge pull request #553 from Ynng/spacemouse-troubleshoot-message
Browse files Browse the repository at this point in the history
Add troubleshooting message for spacemouse failure to open
  • Loading branch information
kevin-thankyou-lin authored Nov 14, 2024
2 parents 81fd714 + e7828fc commit 9c77528
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion robosuite/devices/spacemouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import numpy as np
from pynput.keyboard import Controller, Key, Listener

from robosuite.utils.log_utils import ROBOSUITE_DEFAULT_LOGGER

try:
import hid
except ModuleNotFoundError as exc:
Expand Down Expand Up @@ -128,7 +130,14 @@ def __init__(
self.vendor_id = vendor_id
self.product_id = product_id
self.device = hid.device()
self.device.open(self.vendor_id, self.product_id) # SpaceMouse
try:
self.device.open(self.vendor_id, self.product_id) # SpaceMouse
except OSError as e:
ROBOSUITE_DEFAULT_LOGGER.warning(
"Failed to open SpaceMouse device"
"Consider killing other processes that may be using the device such as 3DconnexionHelper (killall 3DconnexionHelper)"
)
raise

self.pos_sensitivity = pos_sensitivity
self.rot_sensitivity = rot_sensitivity
Expand Down

0 comments on commit 9c77528

Please sign in to comment.