luxonis / depthai-ros

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

rtabmap.launch Did not receive data since 5 seconds!(ROS-noetic) #552

Closed whaudrms closed 3 days ago

whaudrms commented 4 days ago

Hello, I am having trouble running depthai-ros-driver/rtabmap.launch. It seems to be the same problem as #266.

SUMMARY
========

PARAMETERS
 * /oak/camera_i_base_frame: oak-d_frame
 * /oak/camera_i_cam_pitch: 0.0
 * /oak/camera_i_cam_pos_x: 0.0
 * /oak/camera_i_cam_pos_y: 0.0
 * /oak/camera_i_cam_pos_z: 0.0
 * /oak/camera_i_cam_roll: 0.0
 * /oak/camera_i_cam_yaw: 0.0
 * /oak/camera_i_imu_from_descr: False
 * /oak/camera_i_nn_type: none
 * /oak/camera_i_parent_frame: oak-d-base-frame
 * /oak/camera_i_publish_tf_from_calibration: False
 * /oak/robot_description: <?xml version="1....
 * /oak/stereo_i_subpixel: True
 * /rgbd_odometry/approx_sync: True
 * /rgbd_odometry/approx_sync_max_interval: 0.02
 * /rgbd_odometry/frame_id: oak
 * /rgbd_odometry/subscribe_depth: True
 * /rosdistro: noetic
 * /rosversion: 1.16.0
 * /rtabmap/Rtabmap/DetectionRate: 3.5
 * /rtabmap/frame_id: oak

NODES
  /
    oak (nodelet/nodelet)
    oak_nodelet_manager (nodelet/nodelet)
    oak_state_publisher (robot_state_publisher/robot_state_publisher)
    rgbd_odometry (rtabmap_odom/rgbd_odometry)
    rtabmap (rtabmap_slam/rtabmap)
    rtabmap_viz (rtabmap_viz/rtabmap_viz)

auto-starting new master
process[master]: started with pid [28744]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 3542f3a0-357d-11ef-a551-d9ab7e5cff42
process[rosout-1]: started with pid [28777]
started core service [/rosout]
process[oak_state_publisher-2]: started with pid [28784]
process[oak_nodelet_manager-3]: started with pid [28785]
process[oak-4]: started with pid [28786]
process[rgbd_odometry-5]: started with pid [28787]
process[rtabmap-6]: started with pid [28788]
process[rtabmap_viz-7]: started with pid [28793]
[ INFO] [1719599735.752634858]: Loading nodelet /oak of type depthai_ros_driver/Camera to manager oak_nodelet_manager with the following remappings:
[ INFO] [1719599735.754100791]: waitForService: Service [/oak_nodelet_manager/load_nodelet] has not been advertised, waiting...
[ INFO] [1719599735.757924486]: Initializing nodelet with 24 worker threads.
[ INFO] [1719599735.774629191]: waitForService: Service [/oak_nodelet_manager/load_nodelet] is now available.
[ INFO] [1719599735.819457802]: No ip/mxid/usb_id specified, connecting to the next available device.
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
[ INFO] [1719599738.586861679]: Camera with MXID: 1844301071F8C71200 and Name: 1.9.3 connected!
[ INFO] [1719599738.587858173]: USB SPEED: HIGH
[ INFO] [1719599738.638749482]: Device type: OAK-D-PRO
[ INFO] [1719599738.643537875]: Pipeline type: RGBD
[ INFO] [1719599739.517413026]: Finished setting up pipeline.
[ WARN] [1719599740.144003867]: /rgbd_odometry: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. 
/rgbd_odometry subscribed to (approx sync, max interval=0.020000s):
   /oak/rgb/image_raw \
   /oak/stereo/image_raw \
   /oak/rgb/camera_info
[ WARN] [1719599740.246241396]: /rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=10).
/rtabmap subscribed to (approx sync):
   /odom \
   /oak/rgb/image_raw \
   /oak/stereo/image_raw \
   /oak/rgb/camera_info
[ INFO] [1719599741.714437455]: Camera ready!

The results of rostopic echo are as follows:

subscribed to [/oak/rgb/image_raw]
average rate: 12.210
    min: 0.037s max: 0.134s std dev: 0.02346s window: 12

I read #531 and modified rtabmap.launch rtabmap.launch:

<?xml version="1.0"?>
<launch>
    <arg name="name" default="oak" />
    <arg name="params_file" default="$(find depthai_ros_driver)/config/rgbd.yaml" />

    <include file="$(find depthai_ros_driver)/launch/camera.launch">
        <arg name="name" value="$(arg name)"/>
        <arg name="params_file" value="$(arg params_file)"/>
    </include>
    <node type="rgbd_odometry" name="rgbd_odometry" pkg="rtabmap_odom">
        <remap from="rgb/image" to="$(arg name)/rgb/image_raw"/>
        <remap from="rgb/camera_info" to="$(arg name)/rgb/camera_info"/>
        <remap from="depth/image" to="$(arg name)/stereo/image_raw"/>
        <param name="frame_id" type="string" value="$(arg name)"/>

        <rosparam param="subscribe_depth">True</rosparam>
        <rosparam param="approx_sync">True</rosparam>
        <rosparam param="approx_sync_max_interval">0.02</rosparam>

    </node>
    <node type="rtabmap" name="rtabmap" pkg="rtabmap_slam">
        <remap from="rgb/image" to="$(arg name)/rgb/image_raw"/>
        <remap from="rgb/camera_info" to="$(arg name)/rgb/camera_info"/>
        <remap from="depth/image" to="$(arg name)/stereo/image_raw"/>
        <rosparam param="Rtabmap/DetectionRate">3.5</rosparam>
        <param name="frame_id" type="string" value="$(arg name)"/>

    </node>
    <node type="rtabmap_viz" name="rtabmap_viz" pkg="rtabmap_viz">
        <remap from="rgb/image" to="$(arg name)/rgb/image_raw"/>
        <remap from="rgb/camera_info" to="$(arg name)/rgb/camera_info"/>
        <remap from="depth/image" to="$(arg name)/stereo/image_raw"/>
    </node>

</launch>

I also resized image but it doesn't work. camera.yaml:

/oak:
  camera_i_enable_imu: true
  camera_i_enable_ir: true
  camera_i_floodlight_brightness: 0.0
  camera_i_ip: ''
  camera_i_laser_dot_brightness: 800.0
  camera_i_mx_id: ''
  camera_i_nn_type: spatial
  camera_i_pipeline_type: rgbd
  camera_i_usb_port_id: ''
  camera_i_usb_speed: SUPER_PLUS
  rgb_i_low_bandwidth: True
  rgb_i_low_bandwidth_quality: 30
  rgb_i_height: 540
  rgb_i_width: 960
  left_i_low_bandwidth: True
  left_i_low_bandwidth_quality: 30
  left_i_height: 540
  left_i_width: 960
  right_i_low_bandwidth: True
  right_i_low_bandwidth_quality: 30
  right_i_height: 540
  right_i_width: 960

  nn_i_nn_config_path: depthai_ros_driver/mobilenet

Could you please help me? Thank you for reading.