luxonis / depthai-ros

Official ROS Driver for DepthAI Sensors.
MIT License
239 stars 174 forks source link

[BUG] {Problem with connecting camera #260

Closed qnaa42 closed 10 months ago

qnaa42 commented 1 year ago

Hi, I use OakD pro and WLS Ubuntu 22.04 LTS with humble ros. I have successfully built the environment; however, when I try to run the example script, I'm having this error:

ros2 launch depthai_examples stereo_inertial_node.launch.py [INFO] [launch]: All log files can be found below /home/mateusz/.ros/log/2023-03-22-18-15-15-581018-DESKTOP-HKS633A-1472 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [1486] [INFO] [stereo_inertial_node-2]: process started with pid [1488] [INFO] [component_container-3]: process started with pid [1490] [INFO] [rviz2-4]: process started with pid [1492] [component_container-3] [INFO] [1679508916.539980211] [container]: Load Library: /opt/ros/humble/lib/libdepth_image_proc.so [component_container-3] [INFO] [1679508916.642819764] [container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-3] [INFO] [1679508916.642913179] [container]: Instantiate class: rclcpp_components::NodeFactoryTemplate [INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/convert_metric_node' in container '/container' [component_container-3] [INFO] [1679508916.666400085] [container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-3] [INFO] [1679508916.666453002] [container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-3] [INFO] [1679508916.666458922] [container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-3] [INFO] [1679508916.666463652] [container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-3] [INFO] [1679508916.666468202] [container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-3] [INFO] [1679508916.666472741] [container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-3] [INFO] [1679508916.666477671] [container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-3] [INFO] [1679508916.666484031] [container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-3] [INFO] [1679508916.666490650] [container]: Instantiate class: rclcpp_components::NodeFactoryTemplate [INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/point_cloud_xyzrgb_node' in container '/container' [robot_state_publisher-1] [INFO] [1679508916.807568593] [oak_state_publisher]: got segment oak-d-base-frame [robot_state_publisher-1] [INFO] [1679508916.807715194] [oak_state_publisher]: got segment oak-d_frame [robot_state_publisher-1] [INFO] [1679508916.807729774] [oak_state_publisher]: got segment oak_imu_frame [robot_state_publisher-1] [INFO] [1679508916.807735933] [oak_state_publisher]: got segment oak_left_camera_frame [robot_state_publisher-1] [INFO] [1679508916.807741963] [oak_state_publisher]: got segment oak_left_camera_optical_frame [robot_state_publisher-1] [INFO] [1679508916.807747183] [oak_state_publisher]: got segment oak_model_origin [robot_state_publisher-1] [INFO] [1679508916.807752622] [oak_state_publisher]: got segment oak_rgb_camera_frame [robot_state_publisher-1] [INFO] [1679508916.807758702] [oak_state_publisher]: got segment oak_rgb_camera_optical_frame [robot_state_publisher-1] [INFO] [1679508916.807764162] [oak_state_publisher]: got segment oak_right_camera_frame [robot_state_publisher-1] [INFO] [1679508916.807768951] [oak_state_publisher]: got segment oak_right_camera_optical_frame [stereo_inertial_node-2] 1280 720 1280 720 [stereo_inertial_node-2] Listing available devices... [stereo_inertial_node-2] terminate called after throwing an instance of 'std::runtime_error' [stereo_inertial_node-2] what(): " DepthAI Device with MxId "x" not found. " [ERROR] [stereo_inertial_node-2]: process has died [pid 1488, exit code -6, cmd '/home/mateusz/dai_ws/install/depthai_examples/lib/depthai_examples/stereo_inertial_node --ros-args --params-file /tmp/launch_params_ftz8dedq --params-file /tmp/launch_params__q6vrw02 --params-file /tmp/launch_params_fukdm7p6 --params-file /tmp/launch_params_a2zpqlnr --params-file /tmp/launch_params_o_r_eekj --params-file /tmp/launch_params_40wjoo7r --params-file /tmp/launch_params_di9rvtzq --params-file /tmp/launch_params_zb932nm6 --params-file /tmp/launch_params_qjynarcz --params-file /tmp/launch_params_n6nalu3c --params-file /tmp/launch_params_q2na09hi --params-file /tmp/launch_params_olysu7k3 --params-file /tmp/launch_params_2t7_vcjy --params-file /tmp/launch_params_4z7kibfw --params-file /tmp/launch_params_u_rkub9x --params-file /tmp/launch_params_1yzgkc12 --params-file /tmp/launch_params_frmxl1qw --params-file /tmp/launch_params_eq2rfwnz --params-file /tmp/launch_params_ffv458lz --params-file /tmp/launch_params_x94fv4ya --params-file /tmp/launch_params_no3vydpq --params-file /tmp/launch_params_0h0_yfqk --params-file /tmp/launch_params_h_zf3k25 --params-file /tmp/launch_params_j4sxdo7a --params-file /tmp/launch_params__bbfmpdp --params-file /tmp/launch_params_wq3_a0zo --params-file /tmp/launch_params_02k59yjb --params-file /tmp/launch_params_i81pa_gb --params-file /tmp/launch_params_gedj4nzu --params-file /tmp/launch_params_6f1_jqw1 --params-file /tmp/launch_params_k0vril1u --params-file /tmp/launch_params_h5ij84lj --params-file /tmp/launch_params_s_r5nekn --params-file /tmp/launch_params_r2uz80_q']. [rviz2-4] [INFO] [1679508917.825758112] [rviz2]: Stereo is NOT SUPPORTED [rviz2-4] [INFO] [1679508917.825882855] [rviz2]: OpenGl version: 4.2 (GLSL 4.2) [rviz2-4] [INFO] [1679508917.852114243] [rviz2]: Stereo is NOT SUPPORTED [component_container-3] [WARN] [1679508917.908341108] [point_cloud_xyzrgb_node]: New subscription discovered on topic '/stereo/points', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY [component_container-3] [WARN] [1679508917.909477004] [point_cloud_xyzrgb_node]: New subscription discovered on topic '/stereo/points', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY [rviz2-4] [INFO] [1679508918.032439701] [rviz2]: Stereo is NOT SUPPORTED

I would be grateful for any leads on this.

Serafadam commented 1 year ago

Hi, it seems that your device is not visible in WSL, could you try steps described here?

qnaa42 commented 1 year ago

Hi, so below you can find lsusb from Ubuntu console:

~/dai_ws$ lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 004: ID 03e7:2485 Intel Movidius MyriadX Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and from Windows Power shell usbipd wsl list;

usbipd wsl list BUSID VID:PID DEVICE STATE 1-8 046d:0a6d Logitech G433 Gaming Headset, USB Input Device Not attached 1-9 8087:0a2a Intel(R) Wireless Bluetooth(R) Not attached 1-12 1b3f:1167 GENERAL WEBCAM Not attached 1-13 046d:c08b USB Input Device Not attached 3-1 046d:c342 USB Input Device Not attached 3-2 03e7:2485 Movidius MyriadX Attached - Ubuntu-22.04

but after running ros2 launch depthai_examples stereo_inertial_node.launch.py I'm getting:

/////// [stereo_inertial_node-2] Listing available devices... [stereo_inertial_node-2] Device Mx ID: 18443010C114391300 [rviz2-4] [INFO] [1679576922.444419366] [rviz2]: Stereo is NOT SUPPORTED [rviz2-4] [INFO] [1679576922.444552745] [rviz2]: OpenGl version: 4.2 (GLSL 4.2) [rviz2-4] [INFO] [1679576922.708859340] [rviz2]: Stereo is NOT SUPPORTED [component_container-3] [WARN] [1679576922.875496709] [point_cloud_xyzrgb_node]: New subscription discovered on topic '/stereo/points', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY [component_container-3] [WARN] [1679576922.876747335] [point_cloud_xyzrgb_node]: New subscription discovered on topic '/stereo/points', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY [rviz2-4] [INFO] [1679576923.034213396] [rviz2]: Stereo is NOT SUPPORTED [stereo_inertial_node-2] terminate called after throwing an instance of 'std::runtime_error' //////

After aborting the process I got this:

$ lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

As you can see the camera bus is not present anymore.

I added privileges for udev using the command provided.

Serafadam commented 1 year ago

Could you also try running ros2 launch depthai_ros_driver camera.launch.py and see if that works for you? For additional logging information you can run export DEPTHAI_DEBUG=1 before running examples.

Serafadam commented 10 months ago

Closing due to inactivity, please reopen if there are still questions.