luxonis / depthai-ros

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

OAK-D-PRO-W Camera Data Stream Issues in ROS Environment #470

Closed starlight-traveler closed 5 months ago

starlight-traveler commented 6 months ago

I am experiencing a recurrent issue with the OAK-D-PRO-W camera while operating it within a ROS environment. This problem has persisted for the last few days, specifically manifesting when I attempt to launch the camera using camera.launch. The core of the issue lies in the absence of a data stream from the camera in the ROS setup.

Notably, the camera functions as intended in non-ROS environments, which suggests that the hardware is not at fault. This discrepancy leads me to believe that the issue might be related to the ROS integration or configuration.

I have been unable to locate any existing documentation, issues, or discussions that address or resolve this particular problem. If I have missed something, I would be glad to be pointed to it.

PARAMETERS

NODES / oak (nodelet/nodelet) oak_nodelet_manager (nodelet/nodelet) oak_state_publisher (robot_state_publisher/robot_state_publisher)

ROS_MASTER_URI=http://localhost:11311

process[oak_state_publisher-1]: started with pid [17254] process[oak_nodelet_manager-2]: started with pid [17255] process[oak-3]: started with pid [17256] [ INFO] [1701905531.742241699]: Loading nodelet /oak of type depthai_ros_driver/Camera to manager oak_nodelet_manager with the following remappings: [ INFO] [1701905531.750574315]: waitForService: Service [/oak_nodelet_manager/load_nodelet] has not been advertised, waiting... [ INFO] [1701905531.765855955]: Initializing nodelet with 6 worker threads. [ INFO] [1701905531.772846966]: waitForService: Service [/oak_nodelet_manager/load_nodelet] is now available. [ INFO] [1701905532.155187183]: No ip/mxid/usb_id specified, connecting to the next available device. [ INFO] [1701905539.676089107]: Camera with MXID: 18443010810A970F00 and Name: 169.254.1.222 connected! [ INFO] [1701905539.676312473]: PoE camera detected. Consider enabling low bandwidth for specific image topics (see readme). [ INFO] [1701905539.703325316]: Device type: OAK-D-PRO-W-POE-97 [ INFO] [1701905539.716544946]: Pipeline type: rgbd [ INFO] [1701905540.010408174]: NN Family: mobilenet [ INFO] [1701905540.116766056]: NN input size: 300 x 300. Resizing input image in case of different dimensions. [ INFO] [1701905540.576985780]: Finished setting up pipeline. [18443010810A970F00] [169.254.1.222] [7.466] [StereoDepth(8)] [error] Custom disparity/depth width must be multiple of 16. [ INFO] [1701905542.226487428]: Camera ready! [ERROR] [1701905552.217410249]: Camera diagnostics error: No Data [ INFO] [1701905552.217533933]: Restarting camera [ INFO] [1701905552.217609135]: Stopping camera. [18443010810A970F00] [169.254.1.222] [1701905555.657] [host] [warning] Monitor thread (device: 18443010810A970F00 [169.254.1.222]) - ping was missed, closing the device connection [ INFO] [1701905557.698913315]: Starting camera. [ INFO] [1701905557.701144736]: No ip/mxid/usb_id specified, connecting to the next available device. [ INFO] [1701905564.586619342]: Camera with MXID: 18443010810A970F00 and Name: 169.254.1.222 connected! [ INFO] [1701905564.586758961]: PoE camera detected. Consider enabling low bandwidth for specific image topics (see readme). [ INFO] [1701905564.613161537]: Device type: OAK-D-PRO-W-POE-97 [ INFO] [1701905564.621372993]: Pipeline type: rgbd [ INFO] [1701905564.792966853]: NN Family: mobilenet [ INFO] [1701905564.894732859]: NN input size: 300 x 300. Resizing input image in case of different dimensions. [ INFO] [1701905565.235650275]: Finished setting up pipeline. [18443010810A970F00] [169.254.1.222] [6.769] [StereoDepth(8)] [error] Custom disparity/depth width must be multiple of 16. [ INFO] [1701905566.926362394]: Camera ready!

Serafadam commented 6 months ago

Hi, could you post more information according to the bug template? I can see that the camera restarts due to lack of diagnostic data, are other streams stopping here as well, or after the restart? Regarding similar issues, there was one a bit similar that was related to ROS master setup.

yh725k commented 5 months ago

Hi, Did you found the solution? I am facing the same issue here when i run to a 'camera.launch.py'.

Serafadam commented 5 months ago

Hi @yh725k , could you try this branch and see if improves things for you? If not, could you provide more debug information?

yh725k commented 5 months ago

Hi @Serafadam, I already solved the problem. thank you. But I have more questions. I would like to use sorted images in ROS2(humble) like rgb_undistort.py(https://github.com/luxonis/depthai-python/blob/main/examples/ColorCamera/rgb_undistort.py). Is there any guidance regarding this?

starlight-traveler commented 5 months ago

Sincere apologies for a delayed response, University was on holiday. @yh725k you said you solved it? Could you for propensity's sake (and for everyone else who may have this issue in the future) describe what you did to solve it. Did you simply use the new branch?

@Serafadam I will try and post according to the bug template after I try a few more things, especially the new branch. Thanks for your help with this. I appreciate it.

yh725k commented 5 months ago

@RP-ND I solved this problem by just reusing the command below:

colcon build --symlink-install
source install/setup.bash

I hope this helps if you have the same problem.

starlight-traveler commented 5 months ago

@yh725k No it didn't, but it did lead me on the right path.

@Serafadam Building from the newest source worked perfectly, thanks for the help!