rtab map does not display anything

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

rtab map does not display anything

mwolf
Hi Mathieu,
I followed your tutorial to bring up RTAB-Map on a computer connected to a mobile robot with ASUS Xtion + Odometry + laser (clearpath husky).

I have launched the camera with the opennni2.launch file. The laser is launched via the urg_laser.launch file. This works and I can display the laserscan as well as the images in rviz.

But I am failing to get Rtabmap to work. I am doing the following:

1. export ROS_MASTER_URI of the robot
2. start rtabmap and rtabmap viz on the computer via this launch file:

<launch>

    <!-- Visualization mode -->
    <arg name="rviz" default="false" />
    <arg name="rtabmapviz" default="true" />

    <!-- RTAB-Map -->
    <group ns="rtabmap">
        <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">

          <param name="queue_size" type="int" value="50"/>
            <!-- Fixed frame on the robot -->
            <param name="frame_id" type="string" value="base_link"/>

	    <param name="subscribe_scan" type="bool" value="true"/>

            <remap from="husky_velocity_controller/odom" to="/base_controller/odom"/>
            <remap from="scan" to="/base_scan"/>

            <!-- Depth information from sensors -->
            <param name="subscribe_depth" type="bool" value="true"/>

            <remap from="camera/rgb/image" to="/camera/rgb/image_rect_color"/>
            <remap from="camera/depth/image" to="/camera/depth_registered/image_raw"/>
            <remap from="camera/rgb/camera_info" to="/camera/rgb/camera_info"/>

        </node>

        <!-- Visualisation RTAB-Map -->
        <node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" output="screen">
            <param name="subscribe_depth" type="bool" value="true"/>
            <param name="subscribe_scan" type="bool" value="true"/>

            <param name="frame_id" type="string" value="base_link"/>
            <param name="wait_for_transform" type="bool" value="true"/>

            <remap from="camera/rgb/image" to="/camera/rgb/image_rect_color"/>
            <remap from="camera/depth/image" to="/camera/depth_registered/image_raw"/>
            <remap from="camera/rgb/camera_info" to="/camera/rgb/camera_info"/>

            <remap from="husky_velocity_controller/odom" to="/base_controller/odom"/>
            <remap from="scan" to="/base_scan"/>

        </node>

    </group>

</launch>

This brings up rtab-map displaing nothing:


Console:
[ INFO] [1501497138.858241498]: 
/rtabmap/rtabmapviz subscribed to:
   /rtabmap/rgb/image/compressed,
   /rtabmap/depth/image/compressedDepth,
   /rtabmap/rgb/camera_info,
   /rtabmap/odom,
   /base_scan,
   /rtabmap/odom_info

I have checked that the input is published via:
$ rostopic hz /base_controller/odom
$ rostopic hz /camera/rgb/image_rect_color
$ rostopic hz /camera/depth_registered/image_raw
$ rostopic hz /camera/rgb/camera_info
$ rostopic hz /camera/rgb/camera_info
$ rostopic hz /scan

"rosrun tf view_frames creates following pdf":

frames.pdf

Also the /map node does not show up when I start the launch file. This is also the case, if I start rtabmap on the robot itself and only the visualization on the computer. However this brings up the following warning from rtabmap:

[ WARN] [1501496314.304435045]: /rtabmap/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=50).
/rtabmap/rtabmap subscribed to (approx sync):
   /rtabmap/odom,
   /rtabmap/rgb/image,
   /rtabmap/depth/image,
   /rtabmap/rgb/camera_info,
   /base_scan

All these topics are published and I dont know what I am missing...

Do you know what I am doing wrong?

Thanks in advance!

Reply | Threaded
Open this post in threaded view
|

Re: rtab map does not display anything

Blupon
This post was updated on .
Hi,

I'm perhaps misunderstanding, but you are talking about checking:

$ rostopic hz /scan



whereas the launch file/rtabmap scan topic seems to be /base_scan. Shouldn't you remap from /base_scan to /scan (the latter being the actual topic) ?

Sorry if misunderstood your information & good luck with ROS !

EDIT: see here on this forum

Matthieu talks about You should set "/jn0/base_can" to "/scan" (with '/') for rtabmap node.

for a similar situation
Reply | Threaded
Open this post in threaded view
|

Re: rtab map does not display anything

matlabbe
Administrator
Hi,

As Blupon said, there is a problem with topic remapping. Based on your actual topics, the remapping should look like something like this:
<launch>

    <!-- Visualization mode -->
    <arg name="rviz" default="false" />
    <arg name="rtabmapviz" default="true" />

    <!-- RTAB-Map -->
    <group ns="rtabmap">
        <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">

          <param name="queue_size" type="int" value="50"/>
            <!-- Fixed frame on the robot -->
            <param name="frame_id" type="string" value="base_link"/>

	    <param name="subscribe_scan" type="bool" value="true"/>

            <remap from="odom" to="/base_controller/odom"/>
            <remap from="scan" to="/scan"/>

            <!-- Depth information from sensors -->
            <param name="subscribe_depth" type="bool" value="true"/>

            <remap from="rgb/image" to="/camera/rgb/image_rect_color "/>
            <remap from="depth/image" to="/camera/depth_registered/image_raw"/>
            <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>
        </node>

        <!-- Visualisation RTAB-Map -->
        <node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" output="screen">
            <param name="subscribe_depth" type="bool" value="true"/>
            <param name="subscribe_scan" type="bool" value="true"/>

            <param name="frame_id" type="string" value="base_link"/>
            <param name="wait_for_transform" type="bool" value="true"/>

            <remap from="rgb/image" to="/camera/rgb/image_rect_color "/>
            <remap from="depth/image" to="/camera/depth_registered/image_raw"/>
            <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>

            <remap from="odom" to="/base_controller/odom"/>
            <remap from="scan" to="/scan"/>

        </node>

    </group>

</launch>

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: rtab map does not display anything

mwolf
This post was updated on .
Thank you both for the fast replies! Appreciate your help  a lot!! :)

rtabmap subscribes now to the right topics:
/rtabmap/rtabmapviz subscribed to:
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info,
   /odometry/filtered,
   /scan

All these toppics are streaming data (and I can view these topics in rviz). But rtabmapviz does still not show anything...



Launch File:

<launch>

    <!-- Visualization mode -->
    <arg name="rviz" default="false" />
    <arg name="rtabmapviz" default="true" />

    <!-- RTAB-Map -->
    <group ns="rtabmap">

    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
          <param name="frame_id" type="string" value="base_link"/>

          <param name="subscribe_depth" type="bool" value="true"/>
          <param name="subscribe_scan" type="bool" value="true"/>

          <remap from="odom" to="/odometry/filtered"/>
          <remap from="scan" to="/scan"/>

          <remap from="rgb/image" to="/camera/rgb/image_rect_color"/>
          <remap from="depth/image" to="/camera/depth_registered/image_raw"/>
          <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>

          <param name="queue_size" type="int" value="10"/>

          <!-- RTAB-Map's parameters -->
          <param name="RGBD/NeighborLinkRefining" type="string" value="true"/>
          <param name="RGBD/ProximityBySpace"     type="string" value="true"/>
          <param name="RGBD/AngularUpdate"        type="string" value="0.01"/>
          <param name="RGBD/LinearUpdate"         type="string" value="0.01"/>
          <param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/>
          <param name="Optimizer/Slam2D"          type="string" value="true"/>
          <param name="Reg/Strategy"              type="string" value="1"/> <!-- 1=ICP -->
          <param name="Reg/Force3DoF"             type="string" value="true"/>
          <param name="Vis/MinInliers"            type="string" value="5"/>
          <param name="Vis/InlierDistance"        type="string" value="0.1"/>
          <param name="Rtabmap/TimeThr"           type="string" value="700"/>
          <param name="Mem/RehearsalSimilarity"   type="string" value="0.45"/>
    </node>

        <!-- Visualisation RTAB-Map -->
        <node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" output="screen">
            <param name="subscribe_depth" type="bool" value="true"/>
            <param name="subscribe_scan" type="bool" value="true"/>

            <param name="frame_id" type="string" value="base_link"/>
            <param name="wait_for_transform" type="bool" value="true"/>

          <remap from="odom" to="/odometry/filtered"/>
          <remap from="scan" to="/scan"/>

          <remap from="rgb/image" to="/camera/rgb/image_rect_color"/>  
          <remap from="depth/image" to="/camera/depth_registered/image_raw"/>
          <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>

        </node>

    </group>

</launch>

Console log:



mwolf wrote
mwolf@pc-18:/srv-0/mwolf/catkin_ws$ roslaunch mapping rtabmap_all.launch

started roslaunch server http://192.168.20.118:37721/

SUMMARY
========

PARAMETERS
 * /rosdistro: indigo
 * /rosversion: 1.11.21
 * /rtabmap/rtabmap/Mem/RehearsalSimilarity: 0.45
 * /rtabmap/rtabmap/Optimizer/Slam2D: true
 * /rtabmap/rtabmap/RGBD/AngularUpdate: 0.01
 * /rtabmap/rtabmap/RGBD/LinearUpdate: 0.01
 * /rtabmap/rtabmap/RGBD/NeighborLinkRefining: true
 * /rtabmap/rtabmap/RGBD/OptimizeFromGraphEnd: false
 * /rtabmap/rtabmap/RGBD/ProximityBySpace: true
 * /rtabmap/rtabmap/Reg/Force3DoF: true
 * /rtabmap/rtabmap/Reg/Strategy: 1
 * /rtabmap/rtabmap/Rtabmap/TimeThr: 700
 * /rtabmap/rtabmap/Vis/InlierDistance: 0.1
 * /rtabmap/rtabmap/Vis/MinInliers: 5
 * /rtabmap/rtabmap/frame_id: base_link
 * /rtabmap/rtabmap/queue_size: 10
 * /rtabmap/rtabmap/subscribe_depth: True
 * /rtabmap/rtabmap/subscribe_scan: True
 * /rtabmap/rtabmapviz/frame_id: base_link
 * /rtabmap/rtabmapviz/subscribe_depth: True
 * /rtabmap/rtabmapviz/subscribe_scan: True
 * /rtabmap/rtabmapviz/wait_for_transform: True

NODES
  /rtabmap/
    rtabmap (rtabmap_ros/rtabmap)
    rtabmapviz (rtabmap_ros/rtabmapviz)

ROS_MASTER_URI=http://192.168.21.80:11311

core service [/rosout] found
process[rtabmap/rtabmap-1]: started with pid [15960]
process[rtabmap/rtabmapviz-2]: started with pid [15961]
[ INFO] [1501580892.089160885]: Starting node...
[ INFO] [1501580892.115852146]: Starting node...
[ INFO] [1501580892.298737782]: rtabmapviz: Using configuration from "/opt/ros/indigo/share/rtabmap_ros/launch/config/rgbd_gui.ini"
[ INFO] [1501580892.918960313]: rtabmap: frame_id = base_link
[ INFO] [1501580892.919006766]: rtabmap: map_frame_id = map
[ INFO] [1501580892.919018382]: rtabmap: queue_size = 10
[ INFO] [1501580892.919038687]: rtabmap: tf_delay = 0.050000
[ INFO] [1501580892.919049002]: rtabmap: tf_tolerance = 0.100000
[ INFO] [1501580892.919070450]: rtabmap: depth_cameras = 1
[ INFO] [1501580892.919081296]: rtabmap: approx_sync = true
[ INFO] [1501580892.976319529]: Reading parameters from the ROS server...
[ INFO] [1501580894.651693215]: Parameters read = 0  // Is this of any importance?
[ INFO] [1501580895.178325705]: Setting RTAB-Map parameter "Mem/RehearsalSimilarity"="0.45"
[ INFO] [1501580895.209685668]:
/rtabmap/rtabmapviz subscribed to:
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info,
   /odometry/filtered,
   /scan
[ INFO] [1501580895.623861327]: rtabmapviz started.
[ INFO] [1501580907.319022296]: Setting RTAB-Map parameter "Optimizer/Slam2D"="true"
[ INFO] [1501580908.102128423]: Setting RTAB-Map parameter "RGBD/AngularUpdate"="0.01"
[ INFO] [1501580909.212834165]: Setting RTAB-Map parameter "RGBD/LinearUpdate"="0.01"
[ INFO] [1501580910.598180860]: Setting RTAB-Map parameter "RGBD/NeighborLinkRefining"="true"
[ INFO] [1501580911.997244397]: Setting RTAB-Map parameter "RGBD/OptimizeFromGraphEnd"="false"
[ INFO] [1501580913.627946337]: Setting RTAB-Map parameter "RGBD/ProximityBySpace"="true"
[ INFO] [1501580916.606823486]: Setting RTAB-Map parameter "Reg/Force3DoF"="true"
[ INFO] [1501580916.662689663]: Setting RTAB-Map parameter "Reg/Strategy"="1"
[ INFO] [1501580923.690022815]: Setting RTAB-Map parameter "Rtabmap/TimeThr"="700"
[ INFO] [1501580943.273966618]: Setting RTAB-Map parameter "Vis/InlierDistance"="0.1"
[ INFO] [1501580944.890753441]: Setting RTAB-Map parameter "Vis/MinInliers"="5"
[ INFO] [1501580985.696758987]: RTAB-Map detection rate = 1.000000 Hz
[ INFO] [1501580985.697346538]: rtabmap: Deleted database "/home/mwolf/.ros/rtabmap.db" (--delete_db_on_start is set).
[ INFO] [1501580985.697385030]: rtabmap: Using database from "/home/mwolf/.ros/rtabmap.db".
[ INFO] [1501580987.578054476]: rtabmap: Database version = "0.11.8".
[ INFO] [1501580993.210972263]:
/rtabmap/rtabmap subscribed to:
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info,
   /odometry/filtered,
   /scan
[ INFO] [1501580993.211390873]: rtabmap 0.11.8 started...
[ INFO] [1501581405.732106378]: rtabmap: Getting map (global=true optimized=true graphOnly=false)...

Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: rtab map does not display anything

matlabbe
Administrator
Hi,

What is the frame rate of the input topics (shown by "rostopic hz")? For example, if scan topic is at 1 Hz, and camera topics are at 30 Hz, you should increase "queue_size" parameter at least 30 or more.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: rtab map does not display anything

mwolf
This post was updated on .
Thank you, that was the problem! It works now!

But it stops updating the map after the first frames even if i start to move the robot around...



To reduce latency I have tried to use the freenect_throttle launch file you provided in the tutorials. This itself works as expected.

Remapping to the throttled topics however does not apper to be sucessfull as rtabmapviz shows in the console that it is still subscribe to the normal camera topics. Rtabmap however does subscribe to the throttled ones and the <remap> is exactly the same...

        
    <!-- RTAB-Map -->
    <group ns="rtabmap">

    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
          <param name="frame_id" type="string" value="base_link"/>

          <param name="subscribe_depth" type="bool" value="true"/>
          <param name="subscribe_scan" type="bool" value="true"/>

          <remap from="odom" to="/odometry/filtered"/>
          <remap from="scan" to="/scan"/>

          <remap from="rgb/image" to="/camera/data_throttled_image"/>
          <remap from="depth/image" to="/camera/data_throttled_image_depth"/>
          <remap from="rgb/camera_info" to="/camera/data_throttled_camera_info"/>

          <param name="queue_size" type="int" value="60"/>

          <!-- RTAB-Map's parameters -->
          <param name="RGBD/NeighborLinkRefining" type="string" value="true"/>
          <param name="RGBD/ProximityBySpace"     type="string" value="true"/>
          <param name="RGBD/AngularUpdate"        type="string" value="0.01"/>
          <param name="RGBD/LinearUpdate"         type="string" value="0.01"/>
          <param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/>
          <param name="Optimizer/Slam2D"          type="string" value="true"/>
          <param name="Reg/Strategy"              type="string" value="1"/> <!-- 1=ICP -->
          <param name="Reg/Force3DoF"             type="string" value="true"/>
          <param name="Vis/MinInliers"            type="string" value="5"/>
          <param name="Vis/InlierDistance"        type="string" value="0.1"/>
          <param name="Rtabmap/TimeThr"           type="string" value="700"/>
          <param name="Mem/RehearsalSimilarity"   type="string" value="0.45"/>
    </node>

        <!-- Visualisation RTAB-Map -->
        <node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" output="screen">
            <param name="subscribe_depth" type="bool" value="true"/>
            <param name="subscribe_scan" type="bool" value="true"/>

            <param name="frame_id" type="string" value="base_link"/>
            <param name="wait_for_transform" type="bool" value="true"/>

          <remap from="odom" to="/odometry/filtered"/>
          <remap from="scan" to="/scan"/>

          <remap from="rgb/image" to="/camera/data_throttled_image"/>
          <remap from="depth/image" to="/camera/data_throttled_image_depth"/>
          <remap from="rgb/camera_info" to="/camera/data_throttled_camera_info"/>

        </node>

    </group>

</launch>


Keep up your good work!
Moritz
Reply | Threaded
Open this post in threaded view
|

Re: rtab map does not display anything

matlabbe
Administrator
Hi,

the remaping seems okay, not sure why rtabmapviz is not using the new topic names. Well, you can set for rtabmapviz:
<param name="subscribe_depth" type="bool" value="false"/>
<param name="subscribe_scan" type="bool" value="false"/>
as they are optional. rtabmapviz will only subscribe to rtabmap/mapData.

For the problem "But it stops updating the map after the first frames even if i start to move the robot around... ": What are you showing in the terminal "average rate", is it the laser scan topic? If so it is indeed very slow, which would be difficult to synchronize with the camera or odometry topics. What is the framerate of odometry (/odometry/filtered)? If odometry is over 30 Hz, it will be indeed difficult to synchronize the topics. You may show what is the frame rate for all input topics to rtabmap.

cheers,
Mathieu

cheers,
Mathieu