Re: Raytracing using stereo camera for better SLAM and obstacle avoidance.

Posted by karleno on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Raytracing-using-stereo-camera-for-better-SLAM-and-obstacle-avoidance-tp5632p5722.html

Thank you for the answer and help. I have som follow-up questions though:

I have two rtabmap packages at the moment, "rtabmap" and "rtabmap_ros". Does both of them have to be updated? Does it matter if rtabmap is only on version 0.17.6? Because when I run the launch files that you sent in your last reply, with rtabmap_ros version 0.19.1, I get the error:

unused args [subscribe_depth] for include of [.../catkin_ws/src/rtabmap_ros/launch/rtabmap.launch]
The traceback for the exception was written to the log file

In an attempt to set subscribe_depth to false, I've instead tried setting "stereo" to "false" in the remote launch file. This results in the following error output:
[rtabmap/rtabmap-2] process has died [pid 30286, exit code 127, cmd /home/karl/catkin_ws/devel/lib/rtabmap_ros/rtabmap --delete_db_on_start rgb/image:=/camera/rgb/image_rect_color_relay depth/image:=/camera/depth_registered/image_raw_relay rgb/camera_info:=/camera/rgb/camera_info rgbd_image:=/camera/rgbd_image_relay left/image_rect:=/stereo_camera/left/image_rect_color_relay right/image_rect:=/stereo_camera/right/image_rect_relay left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info scan:=/scan scan_cloud:=/scan_cloud user_data:=/user_data user_data_async:=/user_data_async gps/fix:=/gps/fix tag_detections:=/tag_detections odom:=/odometry/filtered __name:=rtabmap __log:=/home/karl/.ros/log/9dbabd16-56e7-11e9-830a-40a5ef07349b/rtabmap-rtabmap-2.log].
log file: /home/karl/.ros/log/9dbabd16-56e7-11e9-830a-40a5ef07349b/rtabmap-rtabmap-2*.log
[ERROR] [1554390525.253360074]: Failed to load nodelet [/points_xyzrgb] of type [rtabmap_ros/point_cloud_xyzrgb] even after refreshing the cache: Failed to load library /home/karl/catkin_ws/devel/lib//librtabmap_plugins.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = librealsense2.so.2: cannot open shared object file: No such file or directory)
[ERROR] [1554390525.253425511]: The error before refreshing the cache was: Failed to load library /home/karl/catkin_ws/devel/lib//librtabmap_plugins.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = librealsense2.so.2: cannot open shared object file: No such file or directory)
[ERROR] [1554390525.471739106]: Failed to load nodelet [/rtabmap/republish_rgbd_image] of type [rtabmap_ros/rgbd_relay] even after refreshing the cache: Failed to load library /home/karl/catkin_ws/devel/lib//librtabmap_plugins.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = librealsense2.so.2: cannot open shared object file: No such file or directory)
[ERROR] [1554390525.471796469]: The error before refreshing the cache was: Failed to load library /home/karl/catkin_ws/devel/lib//librtabmap_plugins.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = librealsense2.so.2: cannot open shared object file: No such file or directory)
libGL error: failed to create drawable
[points_xyzrgb-4] process has died [pid 30288, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet standalone rtabmap_ros/point_cloud_xyzrgb left/image:=/stereo_camera/left/image_rect_color_relay right/image:=/stereo_camera/right/image_rect_relay left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info rgbd_image:=/camera/rgbd_image_relay cloud:=voxel_cloud __name:=points_xyzrgb __log:=/home/karl/.ros/log/9dbabd16-56e7-11e9-830a-40a5ef07349b/points_xyzrgb-4.log].
log file: /home/karl/.ros/log/9dbabd16-56e7-11e9-830a-40a5ef07349b/points_xyzrgb-4*.log
[ERROR] [1554390526.211364045]: PluginlibFactory: The plugin for class 'rtabmap_ros/MapCloud' failed to load.  Error: Failed to load library /home/karl/catkin_ws/devel/lib//librtabmap_plugins.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = librealsense2.so.2: cannot open shared object file: No such file or directory)
[ERROR] [1554390526.217853372]: PluginlibFactory: The plugin for class 'rtabmap_ros/Info' failed to load.  Error: Failed to load library /home/karl/catkin_ws/devel/lib//librtabmap_plugins.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = librealsense2.so.2: cannot open shared object file: No such file or directory)


Also, in the remote launch file you sent, on line 7, is it a typo that "rgb_topic" is set, should it be "rgbd_topic"? Considering that the correspoding value is "/camera/rgbd_image"...

On-board launch file (now with nodelet embedded in main launch):
<launch>
  <arg name="rate"  default="5"/>
  <arg name="approx_sync" default="false" />

  <include file="$(find realsense2_camera)/launch/rs_camera.launch">
      <arg name="align_depth" value="True"/>
      <arg name="linear_accel_cov" value="1.0"/>
      <arg name="unite_imu_method" value="linear_interpolation"/>
    	<arg name="color_width"         value="424"/>
    	<arg name="color_height"        value="240"/>
    	<arg name="infra_width"        value="424"/>
    	<arg name="infra_height"       value="240"/>
    	<arg name="depth_width"         value="424"/>
    	<arg name="depth_height"        value="240"/>
      <arg name="fisheye_width"       value="424"/>
   	  <arg name="fisheye_height"      value="240"/>

  	  <arg name="fisheye_fps"  value="60"/>
      <arg name="depth_fps"    value="60"/>
      <arg name="infra_fps"    value="60"/>
      <arg name="color_fps"    value="60"/>

  </include>

  <group ns="camera">
    <node pkg="nodelet" type="nodelet" name="data_throttle" args="load rtabmap_ros/rgbd_sync camera_nodelet_manager" output="screen">
      <param name="compressed_rate"  type="double" value="$(arg rate)"/>
      <param name="approx_sync"      type="bool"   value="$(arg approx_sync)"/>

      <remap from="rgb/image"       to="color/image_raw"/>
      <remap from="depth/image"     to="depth/image_rect_raw"/>
      <remap from="rgb/camera_info" to="color/camera_info"/>

      <remap from="rgbd_image"      to="rgbd_image"/> <!-- output -->
    </node>
  </group>



  <node pkg="imu_filter_madgwick" type="imu_filter_node" name="ImuFilter">
      <param name="_use_ma" type="bool" value="false" />
      <param name="_publish_tf" type="bool" value="false" />
      <param name="_world_frame" type="string" value="enu" />
      <remap from="/imu/data_raw" to="/camera/imu"/>
  </node>

    <!-- check type of params (might not actually be string but double...)-->
    <!--
    <node name="$(anon dynparam)" pkg="dynamic_reconfigure" type="dynparam"   args="set_from_parameters /camera/RGB_Camera">
      <param name="Enable_Auto_Exposure"    type="bool" value="false" />
      <param name="Exposure"                type="int"  value="30" />
      <param name="Auto_Exposure_Priority"  type="bool" value="true"/>
      <param name="Frames_Queue_Size"       type="int"  value="50" />
    </node>
-->

    <include file="$(find robot_localization)/launch/ukf_template.launch"/>
    <param name="/ukf_se/frequency" value="300"/>
    <param name="/ukf_se/base_link_frame" value="camera_link"/>
    <param name="/ukf_se/odom0" value="rtabmap/odom"/>
    <rosparam param="/ukf_se/odom0_config">[true,true,true,
                                            true,true,true,
                                            true,true,true,
                                            true,true,true,
                                            true,true,true]
    </rosparam>
    <param name="/ukf_se/odom0_relative" value="true"/>
    <param name="/ukf_se/odom0_pose_rejection_threshold" value="10000000"/>
    <param name="/ukf_se/odom0_twist_rejection_threshold" value="10000000"/>

    <param name="/ukf_se/imu0" value="/imu/data"/>
    <rosparam param="/ukf_se/imu0_config">[false, false, false,
                                           true,  true,  true,
                                           true,  true,  true,
                                           true,  true,  true,
                                           true,  true,  true]
    </rosparam>
    <param name="/ukf_se/imu0_differential" value="true"/>
    <param name="/ukf_se/imu0_relative" value="false"/>
    <param name="/ukf_se/use_control" value="false"/>
    <!-- <param name="/ukf_se/odom0_config" value="{true,true,true,}"/> -->


</launch>

And the remote launch file:
<launch>
    <include file="$(find rtabmap_ros)/launch/rtabmap.launch">
        <arg name="compressed" value="true"/>
        <arg name="args" value="--delete_db_on_start"/>
      <!-- <arg name="subscribe_depth" value="false"/> -->

       <arg name="stereo" value="true"/>

        <arg name="subscribe_rgbd" value="true"/>
        <arg name="rgbd_topic" value="/camera/rgbd_image"/> <!-- rgb changed to rgbd -->
        <arg name="rtabmapviz" value="false"/>
        <arg name="rviz" value="true"/>

        <arg name="odom_topic" value="/odometry/filtered"/>
        <arg name="visual_odometry" value="false"/>
    </include>
</launch>


Thank you for any help and guidance!