• ROS
  • Running ROS2 camera.cpp node USB protocol not available error

Using this readme:

luxonis/rae-ros/blob/humble/README.md

I installed the docker container in rae and ran using this:

docker run -it --restart=unless-stopped -v /dev/:/dev/ -v /sys/:/sys/ --privileged --net=host -e ROS_DOMAIN_ID='1' luxonis/rae-ros-robot:humble

and then

➜ / ros2 run rae_camera camera

Here is the log:

[2023-11-14 22:27:51.946] [depthai] [warning] USB protocol not available - If running in a container, make sure that the following is set: "-v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw'"
[INFO] [1700000877.726183086] [rae_camera]: Camera set up, starting publishing.

However, per camera.cpp this should be publishing on topics /rae/stereo_front/image_raw and others, but they are not being published.

I tried rebooting (and disabled the RH agent) with the same effect.

I also tried this with the same result:

docker run -it --restart=unless-stopped -v /dev/:/dev/ -v /sys/:/sys/ -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw' --privileged --net=host -e ROS_DOMAIN_ID='1' luxonis/rae-ros-robot:humble

also:

top:
  1414 root      20   0 3556704 388628  29076 S  83.1  13.4   0:02.61 depthai-device-      
   1373 root      20   0 1068124 209292  56828 S  11.3   7.2   0:02.64 camera               
    374 root      20   0   38568   7720   6580 S   1.0   0.3   0:00.74 systemd-journal      
     33 root      20   0       0      0      0 I   0.7   0.0   0:00.28 kworker/1:1-mm_percp+
    667 root      20   0    4732   2420   1916 R   0.7   0.1   0:01.23 top   

What would be the fix to this?

Hi, the USB protocol message should be treated more as a warning, it shouldn't affect the performance of the driver. Could you try running ros2 launch rae_camera rae_camera.launch.py and see if that publishes topics?

So I changed /etc/systemd/network/20-wifi.network to this to set the wifi as a static ip to be sure rae is on my 192.168.1.xxx net:

[Match]
Name=wlp1s0
[Network]
DHCP=no
DNS=192.168.1.1 8.8.8.8
IPv6PrivacyExtensions=false
Gateway=192.168.1.1
Address=192.168.1.130/24

and /etc/wpa_supplicant.conf to this:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=root
network={
    ssid="<my network ssid>"
    psk="<wifi password>"

then after restarting the network

docker run -it --restart=unless-stopped -v /dev/:/dev/ -v /sys/:/sys/ -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw' --privileged --net=host -e ROS_DOMAIN_ID='1' luxonis/rae-ros-robot:humble

then

➜ / ros2 launch rae_camera rae_camera.launch.py

and finally

ros2 topic list
/diagnostics
/parameter_events
/rae/imu/data
/rae/imu/mag
/rae/left_back/camera_info
/rae/left_back/image_raw
/rae/left_back/image_raw/compressed
/rae/left_back/image_raw/compressedDepth
/rae/left_back/image_raw/theora
/rae/right/camera_info
/rae/right/image_raw
/rae/right/image_raw/compressed
/rae/right/image_raw/compressedDepth
/rae/right/image_raw/theora
/rae/stereo_back/camera_info
/rae/stereo_back/image_raw
/rae/stereo_back/image_raw/compressed
/rae/stereo_back/image_raw/compressedDepth
/rae/stereo_back/image_raw/theora
/rae/stereo_front/camera_info
/rae/stereo_front/image_raw
/rae/stereo_front/image_raw/compressed
/rae/stereo_front/image_raw/compressedDepth
/rae/stereo_front/image_raw/theora
/rosout

I checked this out using rviz2 and all camera topics seem to be publishing correctly, although there is quite a bit of latency.

top 
   1666 root      20   0 3402072 325312  29552 S **197.4**  11.2   1:17.02 depthai-device-                                         
   1624 root      20   0 1713152 241644  60596 S  13.2   8.3   0:07.78 component_conta                                         
    374 root      20   0   46840  14064  12704 R   4.3   0.5   0:06.46 systemd-journal