Re: cv::Exception Airsim implementation

Posted by Manuelo247 on
URL: http://official-rtab-map-forum.206.s1.nabble.com/cv-Exception-Airsim-implementation-tp10281p10346.html

I'm sorry for the delayed response, i was able to resolve some issues that were hindering my progress.
I managed to fix the error you mentioned regarding the distorted data. This issue was due to an error in the publication of the depth image, where the data was not being converted correctly. Here are the new results.



The point cloud seems to be generated correctly based on my tests, but when sending this data to RTAB-Map, it still crashes.
I'm not sure if this could be due to the way I'm executing it or if I'm missing a dependency. What I get is an image like the one in the previous message with the same errors. Additionally, when interacting with the 3D map, it closes and gives me the message that the process died, which I'll share below.
[ WARN] (2024-08-12 22:09:32.575) Rtabmap.cpp:4560::process() Republishing data of requested node(s) 2 1 (Rtabmap/MaxRepublished=2)
[ WARN] (2024-08-12 22:09:42.306) util3d.cpp:606::cloudFromDepthRGB() Cloud with only NaN values created!
[ INFO] [1723522182.308177993]: rtabmap (13): Rate=1.00s, Limit=0.000s, Conversion=0.0003s, RTAB-Map=0.0341s, Maps update=0.0000s pub=0.0000s (local map=13, WM=13)
[rtabmap_viz-7] process has died [pid 14562, exit code -11, cmd /opt/ros/noetic/lib/rtabmap_viz/rtabmap_viz /odom:=/airsim_node/drone_1/odom_local_ned __name:=rtabmap_viz __log:=/home/manuelo247/.ros/log/d3fde6ba-5929-11ef-adb7-c57683ed6876/rtabmap_viz-7.log].
log file: /home/manuelo247/.ros/log/d3fde6ba-5929-11ef-adb7-c57683ed6876/rtabmap_viz-7*.log

I've included a small rosbag with my data and, lastly, my launch file.

<launch>
  <arg name="rviz" default="true" />
  <arg name="rtabmap" default="true" />
  <arg name="rtabmap_viz" default="true" />
  <arg name="rqt_graph" default="true" />
  <arg name="gnome" default="false" />
  <arg name="oldproject" default="false" />

  <arg unless="$(arg gnome)" name="gnome_terminal" default=""/>
  <arg if="$(arg gnome)" name="gnome_terminal" default="gnome-terminal -- bash -c "/>

  <rosparam command="load" file="$(find drone_slam_simulation)/config/params.yaml"/>
  <include unless="$(arg oldproject)" file="$(find airsim_ros_pkgs)/launch/airsim_node.launch"/>
  <include unless="$(arg oldproject)" file="$(find airsim_tutorial_pkgs)/launch/front_stereo_and_center_mono/depth_to_pointcloud.launch"/> 
  <include if="$(arg oldproject)" file="$(find drone_slam_simulation)/launch/rtabmap_depth_to_pointcloud.launch"/>

  <node pkg="rtabmap_slam" type="rtabmap" name="rtabmap" output="screen"  args="--delete_db_on_start udebug" if="$(arg rtabmap)">
    <param name="frame_id" type="string" value="front_left_custom_optical"/>

    <!-- <param name="subscribe_rgbd" value="true"/> -->
    <param name="subscribe_rgb" value="true"/>
    <param name="subscribe_depth" value="true"/>
    <param name="subscribe_odom" value="true"/>

    <remap from="/rgb/camera_info" to="/airsim_node/drone_1/front_left_custom/Scene/camera_info"/>
    <!-- <remap from="/odom_info" to="/airsim/odom_info"/> -->
    <remap from="/odom" to="/airsim_node/drone_1/odom_local_ned"/> 
    <remap from="/depth/image" to="/airsim_node/drone_1/front_left_custom/DepthPerspective"/>
    <remap from="/rgb/image" to="/airsim_node/drone_1/front_left_custom/Scene"/>

    <param name="approx_sync" value="true"/>
    <param name="sync_queue_size" value="50"/>
    <param name="topic_queue_size" value="50"/>
  </node>

  <node pkg="rtabmap_viz" type="rtabmap_viz" name="rtabmap_viz" output="screen" if="$(eval arg('rtabmap') == true and arg('rtabmap_viz') == true)">
    <remap from="/odom" to="/airsim_node/drone_1/odom_local_ned"/>
    <param name="frame_id" value="front_left_custom_optical"/>
    <param name="sync_queue_size" value="50"/>
    <param name="topic_queue_size" value="50"/>
  </node>


  
  <node if="$(eval arg('rviz') == true and arg('oldproject') == false)" pkg="rviz" type="rviz" name="rviz" output="screen" args="-d $(find drone_slam_simulation)/config/topics.rviz"/>
  <node if="$(eval arg('rviz') == true and arg('oldproject') == true)" pkg="rviz" type="rviz" name="rviz" output="screen" args="-d $(find drone_slam_simulation)/config/topics_old.rviz"/>

  <node pkg="rqt_graph" type="rqt_graph" name="rqt_graph" required="false" if="$(arg rqt_graph)"/>

  <node pkg="drone_slam_simulation" type="move_dron.py" name="move_dron" output="screen" launch-prefix="$(arg gnome_terminal)"/>
  <node if="$(arg oldproject)" pkg="drone_slam_simulation" type="publish_topics.py" name="publish_topics" output="screen" launch-prefix="$(arg gnome_terminal)"/>
  
  

</launch>