Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[respeaker_ros] Display helpful setting command when udev rule is not set. #351

Merged
merged 3 commits into from Jun 20, 2022

Conversation

tkmtnt7000
Copy link
Member

When respeaker_ros is started without setting udev-rules, the command to set udev-rules is displayed as follows.

[ERROR] [1655343700.794731] [/respeaker_node]: You have to give the right permission on respeaker device
[ERROR] [1655343700.796945] [/respeaker_node]: Please run the command as followings to register udev rules
[ERROR] [1655343700.799090] [/respeaker_node]: 
$ roscd respeaker_ros
$ sudo cp -f $(rospack find respeaker_ros)/config/60-respeaker.rules /etc/udev/rules.d/60-respeaker.rules
$ sudo systemctl restart udev
Traceback (most recent call last):
  File "/home/tsukamoto/ros/vendingmachine_demo_ws/src/jsk_3rdparty/respeaker_ros/scripts/respeaker_node.py", line 446, in <module>
    n = RespeakerNode()
  File "/home/tsukamoto/ros/vendingmachine_demo_ws/src/jsk_3rdparty/respeaker_ros/scripts/respeaker_node.py", line 325, in __init__
    self.respeaker = RespeakerInterface()
  File "/home/tsukamoto/ros/vendingmachine_demo_ws/src/jsk_3rdparty/respeaker_ros/scripts/respeaker_node.py", line 119, in __init__
    self.dev.reset()
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 949, in reset
    self._ctx.managed_open()
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 131, in managed_open
    self.handle = self.backend.open_device(self.dev)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 804, in open_device
    return _DeviceHandle(dev)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 652, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
[respeaker_node-3] process has died [pid 26846, exit code 1, cmd /home/tsukamoto/ros/vendingmachine_demo_ws/src/jsk_3rdparty/respeaker_ros/scripts/respeaker_node.py __name:=respeaker_node __log:=/home/tsukamoto/.ros/log/770f123a-ed15-11ec-9282-5405dbb276e2/respeaker_node-3.log].
log file: /home/tsukamoto/.ros/log/770f123a-ed15-11ec-9282-5405dbb276e2/respeaker_node-3*.log

@iory iory self-requested a review June 16, 2022 02:12
"\n" + "$ roscd respeaker_ros"
+ "\n" + "$ sudo cp -f $(rospack find respeaker_ros)/config/60-respeaker.rules /etc/udev/rules.d/60-respeaker.rules"
+ "\n" + "$ sudo systemctl restart udev") # NOQA
raise
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k-okada k-okada merged commit 72d8e96 into jsk-ros-pkg:master Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants