luxonis / depthai-ros

Official ROS Driver for DepthAI Sensors.
MIT License
255 stars 186 forks source link

[Question] Unable to launch camera.launch file in depthai_ros_driver package #280

Closed cwillboyd closed 1 year ago

cwillboyd commented 1 year ago

I was told to post my questions about the depthai-ros package here rather than in the Luxonis Discord.

I am trying to launch the camera.launch file in depthai_ros_driver package but I am getting the error " [FATAL] [1681073113.027777298]: Failed to unload nodelet '/oakfrom manageroak_nodelet_manager'". I am able to run the launch file with no errors when I follow the steps on the README and launch from the dai_ws folder in my home directory. However when I import the depthai_ros as a submodule into my ROS Noetic git repo and try to launch the same camera.launch file I an getting the error. I have checked out the noetic branch of depthai-ros. Can anyone provide suggestions on how to troubleshoot this? Is this potentially an issue with the build environment or dependencies ? I have included the entire terminal output below. Thank You!

roslaunch camera.launch
... logging to /home/christopher/.ros/log/abe6848e-d716-11ed-9541-65c17a58062e/roslaunch-cwb-ubuntu-9785.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://cwb-ubuntu:44575/

SUMMARY
========

PARAMETERS
 * /oak/camera_i_enable_imu: True
 * /oak/camera_i_enable_ir: True
 * /oak/camera_i_floodlight_brightness: 0
 * /oak/camera_i_ip: 
 * /oak/camera_i_laser_dot_brightness: 800
 * /oak/camera_i_mx_id: 
 * /oak/camera_i_nn_type: spatial
 * /oak/camera_i_pipeline_type: RGBD
 * /oak/camera_i_usb_speed: SUPER_PLUS
 * /oak/imu_i_max_q_size: 30
 * /oak/left_i_board_socket_id: 1
 * /oak/left_i_fps: 15.0
 * /oak/left_i_height: 400
 * /oak/left_i_max_q_size: 30
 * /oak/left_i_preview_size: 416
 * /oak/left_i_publish_topic: False
 * /oak/left_i_resolution: 400
 * /oak/left_i_set_isp_scale: True
 * /oak/left_i_width: 640
 * /oak/left_r_exposure: 1000
 * /oak/left_r_focus: 1
 * /oak/left_r_iso: 800
 * /oak/left_r_keep_preview_aspect_ratio: True
 * /oak/left_r_set_man_exposure: False
 * /oak/left_r_set_man_focus: False
 * /oak/left_r_set_man_whitebalance: False
 * /oak/left_r_whitebalance: 3300
 * /oak/nn_i_nn_config_path: depthai_ros_drive...
 * /oak/rgb/image_raw/compressed/format: jpeg
 * /oak/rgb/image_raw/compressed/jpeg_optimize: False
 * /oak/rgb/image_raw/compressed/jpeg_progressive: False
 * /oak/rgb/image_raw/compressed/jpeg_quality: 80
 * /oak/rgb/image_raw/compressed/jpeg_restart_interval: 0
 * /oak/rgb/image_raw/compressed/png_level: 9
 * /oak/rgb/image_raw/compressedDepth/depth_max: 10.0
 * /oak/rgb/image_raw/compressedDepth/depth_quantization: 100.0
 * /oak/rgb/image_raw/compressedDepth/format: png
 * /oak/rgb/image_raw/compressedDepth/png_level: 9
 * /oak/rgb/image_raw/theora/keyframe_frequency: 64
 * /oak/rgb/image_raw/theora/optimize_for: 1
 * /oak/rgb/image_raw/theora/quality: 31
 * /oak/rgb/image_raw/theora/target_bitrate: 800000
 * /oak/rgb_i_board_socket_id: 0
 * /oak/rgb_i_enable_preview: False
 * /oak/rgb_i_fps: 15.0
 * /oak/rgb_i_height: 720
 * /oak/rgb_i_max_q_size: 30
 * /oak/rgb_i_preview_size: 416
 * /oak/rgb_i_publish_topic: True
 * /oak/rgb_i_resolution: 1080
 * /oak/rgb_i_set_isp_scale: True
 * /oak/rgb_i_width: 1280
 * /oak/rgb_r_exposure: 1000
 * /oak/rgb_r_focus: 1
 * /oak/rgb_r_iso: 800
 * /oak/rgb_r_keep_preview_aspect_ratio: True
 * /oak/rgb_r_set_man_exposure: False
 * /oak/rgb_r_set_man_focus: False
 * /oak/rgb_r_set_man_whitebalance: False
 * /oak/rgb_r_whitebalance: 3300
 * /oak/right_i_board_socket_id: 2
 * /oak/right_i_fps: 15.0
 * /oak/right_i_height: 400
 * /oak/right_i_max_q_size: 30
 * /oak/right_i_preview_size: 416
 * /oak/right_i_publish_topic: False
 * /oak/right_i_resolution: 400
 * /oak/right_i_set_isp_scale: True
 * /oak/right_i_width: 640
 * /oak/right_r_exposure: 1000
 * /oak/right_r_focus: 1
 * /oak/right_r_iso: 800
 * /oak/right_r_keep_preview_aspect_ratio: True
 * /oak/right_r_set_man_exposure: False
 * /oak/right_r_set_man_focus: False
 * /oak/right_r_set_man_whitebalance: False
 * /oak/right_r_whitebalance: 3300
 * /oak/stereo/image_raw/compressed/format: jpeg
 * /oak/stereo/image_raw/compressed/jpeg_optimize: False
 * /oak/stereo/image_raw/compressed/jpeg_progressive: False
 * /oak/stereo/image_raw/compressed/jpeg_quality: 80
 * /oak/stereo/image_raw/compressed/jpeg_restart_interval: 0
 * /oak/stereo/image_raw/compressed/png_level: 9
 * /oak/stereo/image_raw/compressedDepth/depth_max: 10.0
 * /oak/stereo/image_raw/compressedDepth/depth_quantization: 100.0
 * /oak/stereo/image_raw/compressedDepth/format: png
 * /oak/stereo/image_raw/compressedDepth/png_level: 9
 * /oak/stereo/image_raw/theora/keyframe_frequency: 64
 * /oak/stereo/image_raw/theora/optimize_for: 1
 * /oak/stereo/image_raw/theora/quality: 31
 * /oak/stereo/image_raw/theora/target_bitrate: 800000
 * /oak/stereo_i_align_depth: True
 * /oak/stereo_i_bilateral_sigma: 0
 * /oak/stereo_i_board_socket_id: 0
 * /oak/stereo_i_decimation_filter_decimation_factor: 1
 * /oak/stereo_i_decimation_filter_decimation_mode: PIXEL_SKIPPING
 * /oak/stereo_i_depth_filter_size: 5
 * /oak/stereo_i_depth_preset: HIGH_DENSITY
 * /oak/stereo_i_enable_decimation_filter: False
 * /oak/stereo_i_enable_distoartion_correction: False
 * /oak/stereo_i_enable_spatial_filter: False
 * /oak/stereo_i_enable_temporal_filter: False
 * /oak/stereo_i_enable_threshold_filter: False
 * /oak/stereo_i_extended_disp: True
 * /oak/stereo_i_height: 400
 * /oak/stereo_i_lr_check: True
 * /oak/stereo_i_lrc_threshold: 10
 * /oak/stereo_i_max_q_size: 30
 * /oak/stereo_i_rectify_edge_fill_color: 0
 * /oak/stereo_i_spatial_filter_alpha: 0.5
 * /oak/stereo_i_spatial_filter_delta: 20
 * /oak/stereo_i_spatial_filter_hole_filling_radius: 2
 * /oak/stereo_i_spatial_filter_iterations: 1
 * /oak/stereo_i_stereo_conf_threshold: 255
 * /oak/stereo_i_temporal_filter_alpha: 0.4
 * /oak/stereo_i_temporal_filter_delta: 20
 * /oak/stereo_i_temporal_filter_persistency: VALID_2_IN_LAST_4
 * /oak/stereo_i_threshold_filter_max_range: 15000
 * /oak/stereo_i_threshold_filter_min_range: 400
 * /oak/stereo_i_width: 640
 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.15.15

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 [9839]
process[oak_nodelet_manager-2]: started with pid [9840]
process[oak-3]: started with pid [9841]
[ INFO] [1681073112.875344885]: Loading nodelet /oak of type depthai_ros_driver/Camera to manager oak_nodelet_manager with the following remappings:
[FATAL] [1681073112.879964070]: Failed to load nodelet '/oak` of type `depthai_ros_driver/Camera` to manager `oak_nodelet_manager'
[ INFO] [1681073112.893322097]: Initializing nodelet with 20 worker threads.
[ WARN] [1681073112.943437257]: Shutdown request received.
[ WARN] [1681073112.947921975]: Reason given for shutdown: [[/oak_state_publisher] Reason: new node registered with same name]
[ERROR] [1681073113.027116328]: Failed to find nodelet with name '/oak' to unload.
================================================================================REQUIRED process [oak-3] has died!
process has died [pid 9841, exit code 255, cmd /opt/ros/noetic/lib/nodelet/nodelet load depthai_ros_driver/Camera oak_nodelet_manager __name:=oak __log:=/home/christopher/.ros/log/abe6848e-d716-11ed-9541-65c17a58062e/oak-3.log].
log file: /home/christopher/.ros/log/abe6848e-d716-11ed-9541-65c17a58062e/oak-3*.log
Initiating shutdown!
================================================================================
[oak-3] killing on exit
[oak_nodelet_manager-2] killing on exit
[oak_state_publisher-1] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
Serafadam commented 1 year ago

Hi, based on [ WARN] [1681073112.947921975]: Reason given for shutdown: [[/oak_state_publisher] Reason: new node registered with same name] it seems that you launch state publisher node twice, could you show how your launch file looks?

cwillboyd commented 1 year ago

I was able to fix the issue by removing the depthai-ros submodule, reinstalling the depthai-ros submodule, and running sudo apt install ros-noetic-depthai-ros-*