IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.53k stars 4.81k forks source link

Permission denied when attempting to activate the motion module #13263

Open radu-iordache-ADI opened 1 month ago

radu-iordache-ADI commented 1 month ago

Required Info
Camera Model D455
Firmware Version (5.16.0.1)
Operating System & Version Linux (Ubuntu 22.04)
Kernel Version (Linux Only) (6.5.0-44-generic)
Platform PC
SDK Version SDK 2.0 (v2.55.1.0)
Language python
Segment Robot

Issue Description

I am using ROS2 to launch a node that is used to start up my RealSense 455. Everything works perfectly if I don't pass enable_gyro: True and enable_accel: True as the parameters. The moment I pass one of those, the launch fails with this error:

Backend in rs2_open_multiple(sensor:0x747d3801df20, profiles:0x747d383eab88, count:2): Failed to open scan_element /sys/devices/pci0000:00/0000:00:14.0/usb4/4-2/4-2:1.5/0003:8086:0B5C.0096/HID-SENSOR-200076.3.auto/iio:device1/scan_elements/in_anglvel_x_en Last Error: Permission denied

The same error i get if I try to activate the Motion Module inside Realsense Viewer.

Worth mentioning that I am start the node inside a Docker container where i install the realsense sdk as such:

# install realsense sdk 
RUN apt-get install -y software-properties-common && apt update
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
RUN add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo focal main" -u
RUN apt-get install -y \
    librealsense2-dkms \
    librealsense2-utils \
    librealsense2-dev \
    librealsense2-dbg

This node worked flawlessly until last Thursday but since Monday I've been getting this issue. I haven't made any significant updates or changes in between.

MartyG-RealSense commented 1 month ago

Hi @radu-iordache-ADI If you are installing on a PC and not an Nvidia Jetson board then it looks as though your Docker file is using old package installation instructions. Whilst the Jetson instructions still use an Ubuntu keyserver, the package instructions for PC changed a while ago to using keyrings.

https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages

Can you confirm please if you are using a PC or an Nvidia Jetson computing board?

radu-iordache-ADI commented 1 month ago

Can you confirm please if you are using a PC or an Nvidia Jetson computing board?

I am indeed using a PC to connect to the Realsense camera through a Docker container, due to using a ROS distribution that's not compatible to Ubuntu 22.04

MartyG-RealSense commented 1 month ago

If you run Docker with a 'docker run' command, are you launching it in sudo admin permissions mode with sudo docker run

Does running Docker in sudo mode make any difference to your Motion Module access problem?

radu-iordache-ADI commented 1 month ago

Unfortunately, I am running docker using the docker extension that I have installed on VScode. As far as I am aware, the container already runs under root by default, right?

MartyG-RealSense commented 4 weeks ago

My knowledge of Docker is admittedly limited.

The Failed to open scan_element error can be caused by a problem with the udev device handling rules, such as the rules not having been installed or improperly installed as advised at https://github.com/IntelRealSense/librealsense/issues/3242#issuecomment-464775017 and https://github.com/IntelRealSense/librealsense/issues/5049#issuecomment-542175378

Checking the udev rules worked for a RealSense ROS user at https://github.com/IntelRealSense/realsense-ros/issues/1436#issuecomment-706857709 who experienced the error.

I note though that your robot was working until recently.

MartyG-RealSense commented 3 weeks ago

Hi @radu-iordache-ADI Do you have an update about this case that you can provide, please? Thanks!

MartyG-RealSense commented 2 weeks ago

Hi @radu-iordache-ADI Do you require further assistance with this case, please? Thanks!

radu-iordache-ADI commented 1 week ago

Hi @MartyG-RealSense ,

I don't, I wish I knew what's causing the problem, but as of now, everything I've tried has had no success.

MartyG-RealSense commented 1 week ago

As the IMU worked until recently and everything tried has had no success, there may be something hidden on your computer that is preventing it from working. Removing librealsense and the wrapper and then reinstalling them may therefore help, unless the hidden problem is in Ubuntu.

The ideal would be to wipe everything including Ubuntu and reinstall the computer from the beginning in order to be certain that hidden issues have been eliminated, though this may not be practical if you would have to reinstall Docker too.

MartyG-RealSense commented 5 days ago

Hi @radu-iordache-ADI Do you require further assistance with this case, please? Thanks!