rtabmap_ros: rtabmap looking for a frame that I did not defined, source_frame firefly/firefly/laser_lidar_link12

Thanks for your effort.

However, when I run the package I face the following Error:

[ WARN] [1533199508.052997875, 963.860000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: source_frame base_footprint does not exist.. canTransform returned after 0.1 timeout was 0.1.
[ WARN] [1533199508.202823939, 964.010000000]: Could not get transform from firefly/base_link to firefly/firefly/laser_lidar_link12 after 0.200000 seconds (for stamp=963.750000)! Error="canTransform: source_frame firefly/firefly/laser_lidar_link12 does not exist.. canTransform returned after 0.2 timeout was 0.2.".
[ERROR] [1533199508.202867336, 964.010000000]: Could not convert laser scan msg! Aborting rtabmap update...

Error happens when I am running: roslaunch rtabmap_ros demo_firefly_mapping.launch

demo_firefly_mapping.launch is a copy of demo_turtlebot_mapping.launch, I just changed some arguments.

It is strange because I have no source_frame called firefly/firefly/laser_lidar_link12, the frame should be firefly/laser_lidar_link12

demo_firefly_mapping.launch


<launch> 
<!--
    
       Bringup Turtlebot:
       $ roslaunch turtlebot_bringup minimal.launch
       
       Mapping:
       $ roslaunch rtabmap_ros demo_turtlebot_mapping.launch
       
       Visualization:
       $ roslaunch rtabmap_ros demo_turtlebot_rviz.launch
       
       This launch file is a one to one replacement of the gmapping_demo.launch in the 
       "SLAM Map Building with TurtleBot" tutorial:
       http://wiki.ros.org/turtlebot_navigation/Tutorials/indigo/Build%20a%20map%20with%20SLAM
       
       For localization-only after a mapping session, add argument "localization:=true" to
       demo_turtlebot_mapping.launch line above. Move the robot around until it can relocalize in 
       the previous map, then the 2D map should re-appear again. You can then follow the same steps 
       from 3.3.2 of the "Autonomous Navigation of a Known Map with TurtleBot" tutorial:
       http://wiki.ros.org/turtlebot_navigation/Tutorials/Autonomously%20navigate%20in%20a%20known%20map
 
       For turtlebot in simulation (Gazebo):
         $ roslaunch turtlebot_gazebo turtlebot_world.launch
         $ roslaunch rtabmap_ros demo_turtlebot_mapping.launch simulation:=true
         $ roslaunch rtabmap_ros demo_turtlebot_rviz.launch
 

  <node pkg = "tf" type = "static_transform_publisher" name="laser_to_vi_sensor_base_sensor_r200cam_transform_publisher" args = "0 0 0 0 0 0 firefly/base_link firefly/firefly/laser_lidar_link12 100"/> 
 -->
  
  <arg name="database_path"     default="rtabmap.db"/>
  <arg name="rgbd_odometry"     default="false"/>
  <arg name="rtabmapviz"        default="false"/>
  <arg name="localization"      default="false"/>
  <arg name="simulation"        default="true"/>
  <arg     if="$(arg localization)" name="args"  default=""/>
  <arg unless="$(arg localization)" name="args"  default="--delete_db_on_start"/>

  <arg     if="$(arg simulation)" name="rgb_topic"   default="/firefly/vi_sensor/camera_depth/camera/image_raw"/>
  <arg unless="$(arg simulation)" name="rgb_topic"   default="/firefly/vi_sensor/camera_depth/camera/image_raw"/>
  <arg     if="$(arg simulation)" name="depth_topic" default="/firefly/vi_sensor/camera_depth/depth/disparity"/>
  <arg unless="$(arg simulation)" name="depth_topic" default="/firefly/vi_sensor/camera_depth/depth/disparity"/>
  <arg name="camera_info_topic" default="/firefly/vi_sensor/camera_depth/camera/camera_info"/>

  <arg name="wait_for_transform"  default="0.2"/> 
  <!-- 
      robot_state_publisher's publishing frequency in "turtlebot_bringup/launch/includes/robot.launch.xml" 
      can be increase from 5 to 10 Hz to avoid some TF warnings.
  -->
  
  <!-- Navigation stuff (move_base) -->
  <include unless="$(arg simulation)" file="$(find turtlebot_bringup)/launch/3dsensor.launch"/>
  <include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>
  
  <!-- Mapping -->
  <group ns="rtabmap">

    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="$(arg args)">
	  <param name="database_path"       type="string" value="$(arg database_path)"/>
	  <param name="frame_id"            type="string" value="firefly/base_link"/>
	  <param name="wait_for_transform_duration"  type="double"   value="$(arg wait_for_transform)"/>
	  <param name="subscribe_depth"     type="bool"   value="true"/>
	  <param name="subscribe_scan"      type="bool"   value="true"/>
	  <param name="map_negative_poses_ignored" type="bool" value="true"/>
	
	  <!-- inputs -->
	  <remap from="scan"            to="/scan"/> 
	  <remap from="rgb/image"       to="$(arg rgb_topic)"/>
  	  <remap from="depth/image"     to="$(arg depth_topic)"/>
  	  <remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
	  <remap unless="$(arg rgbd_odometry)" from="odom" to="/odom"/>
	  <param name="odom_frame_id" type="string" value="/firefly/odometry_sensor1"/>
  	  
  	  <!-- output 
  	  <remap from="grid_map" to="/map"/> -->
	
	  <!-- RTAB-Map's parameters: do "rosrun rtabmap rtabmap (double-dash)params" to see the list of available parameters. -->
	  <param name="RGBD/ProximityBySpace"        type="string" value="true"/>   <!-- Local loop closure detection (using estimated position) with locations in WM -->
	  <param name="RGBD/OptimizeFromGraphEnd"    type="string" value="false"/>  <!-- Set to false to generate map correction between /map and /odom -->
	  <param name="Kp/MaxDepth"                  type="string" value="4.0"/>
	  <param name="Reg/Strategy"                 type="string" value="0"/>      <!-- Loop closure transformation: 0=Visual, 1=ICP, 2=Visual+ICP -->
	  <param name="Icp/CorrespondenceRatio"      type="string" value="0.3"/>
	  <param name="Vis/MinInliers"               type="string" value="15"/>      <!-- 3D visual words minimum inliers to accept loop closure -->
	  <param name="Vis/InlierDistance"           type="string" value="0.1"/>    <!-- 3D visual words correspondence distance -->
	  <param name="RGBD/AngularUpdate"           type="string" value="0.1"/>    <!-- Update map only if the robot is moving -->
	  <param name="RGBD/LinearUpdate"            type="string" value="0.1"/>    <!-- Update map only if the robot is moving -->
	  <param name="RGBD/ProximityPathMaxNeighbors" type="string" value="0"/> 
	  <param name="Rtabmap/TimeThr"              type="string" value="700"/>
	  <param name="Mem/RehearsalSimilarity"      type="string" value="0.30"/>
	  <param name="Optimizer/Slam2D"             type="string" value="true"/>
	  <param name="Reg/Force3DoF"                type="string" value="true"/>
	  <param name="GridGlobal/MinSize"           type="string" value="20"/>
          <param name="RGBD/OptimizeMaxError"        type="string" value="0.1"/>

	  
	  <!-- localization mode -->
	  <param     if="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="false"/>
	  <param unless="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="true"/>
	  <param name="Mem/InitWMWithAllNodes" type="string" value="$(arg localization)"/> 
    </node>
   
    <!-- Odometry : ONLY for testing without the actual robot! /odom TF should not be already published. -->
    <node if="$(arg rgbd_odometry)" pkg="rtabmap_ros" type="rgbd_odometry" name="rgbd_odometry" output="screen">
      <param name="frame_id"                    type="string" value="/firefly/base_link"/>
      <param name="wait_for_transform_duration" type="double" value="$(arg wait_for_transform)"/>
      <param name="Reg/Force3DoF"               type="string" value="true"/>
      <param name="Vis/InlierDistance"          type="string" value="0.05"/>
      
      <remap from="rgb/image"       to="$(arg rgb_topic)"/>
      <remap from="depth/image"     to="$(arg depth_topic)"/>
      <remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
    </node>
    
    <!-- visualization with rtabmapviz -->
    <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="/firefly/base_link"/>
      <param name="wait_for_transform_duration" type="double" value="$(arg wait_for_transform)"/>
    
      <remap from="rgb/image"       to="$(arg rgb_topic)"/>
      <remap from="depth/image"     to="$(arg depth_topic)"/>
      <remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
      <remap from="scan"            to="/firefly/scan"/>
    </node>
    
  </group>
</launch>

Please find the output of rosrun tf view_frames in the following link: https://drive.google.com/file/d/1lbeyL7nKQlukbo5ngEoBwpC7PpODPePb/view

and the xacro macro I used for generating the lidar sensor is:

 <!-- Hokuyo Lidar Range Sensor -->
    <xacro:macro name="hokuyo_utm30lx" params="*origin update_rate ray_count min_angle max_angle">
      <link name="firefly/laser_lidar_link12">
	<inertial>
	  <mass value="0.001" />
	  <origin xyz="0 0 0" rpy="0 0 0" />
	  <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001" />
	</inertial>
	<visual>
          <geometry>
            <mesh filename="package://turtlebot_description/meshes/sensors/hokuyo_utm30lx/hokuyo_utm_30lx.dae"/>
          </geometry>
	</visual>
	<collision>
	  <origin xyz="0 0 -0.0115" rpy="0 0 0" />
          <geometry>
            <box size="0.058 0.058 0.087" />
            <!--<mesh filename="package://hector_sensors_description/meshes/hokuyo_utm30lx/hokuyo_utm_30lx.stl"/>-->
          </geometry>
	</collision>
      </link>
      <joint name="laser_lidar_joint" type="fixed">
        <origin xyz="0.0 0.0 0.12" rpy="3.14159 0.0 0.0" />
	<parent link="firefly/base_link"/>
	<child link="firefly/laser_lidar_link12"/>
      </joint>
      <gazebo reference="firefly/laser_lidar_link12">
        <sensor type="ray" name="firefly_laser_lidar">
            <pose>0 0 0 0 0 0</pose>
            <visualize>false</visualize>
            <update_rate>40</update_rate>
	    <ray>
		  <scan>
		    <horizontal>
		      <samples>720</samples>
		      <resolution>1</resolution>
		      <min_angle>-2.350796</min_angle>
		      <max_angle>2.350796</max_angle>
		    </horizontal>
		  </scan>
		  <range>
		    <min>0.10</min>
		    <max>20.0</max>
		    <resolution>0.01</resolution>
		  </range>
		  <noise>
		    <type>Gaussian</type>
		    <mean>0.0</mean>
		    <stddev>0.01</stddev>
		  </noise>
	    </ray>
	    <plugin name="gazebo_ros_lidar_controller" filename="libgazebo_ros_laser.so">
		  <topicName>/scan</topicName>
		  <frameName>firefly/laser_lidar_link12</frameName>
		  <!-- <interface:laser name="gazebo_ros_${laser_suffix}_iface" /> -->
            </plugin>
        </sensor>
      </gazebo>
    </xacro:macro>

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

The best way to do this is to open the created database (e.g., ~/.ros/rtabmap.db) with RTAB-Map standalone application: $ rtabmap ~/.ros/rtabmap.db

You can then do File->Export 3D clouds… (see here and here for examples of usage), you will see a lot of options to export the assembled point cloud, to generate a mesh and even apply texture on the mesh. The exported cloud/mesh will be in PLY or OBJ formats, which are quite common formats for 3D file exchange. For VR, you may open directly the PLY or OBJ file with a visualization application. If you need to convert the file, you can use MeshLab (or other 3D softwares) to do so. Some exported examples here.

cheers, Mathieu

Features for loop closure detection are taken just 4 meters in front of the robot, so they are taken only on the bottom of the image on the repetitive textured ground. Remove this parameter or set it to 0 (inf):

<param name="Kp/MaxDepth"                  type="string" value="4.0"/>

As the ground is identical everywhere, loop closures will be triggered often. To reject loop closures based on bad graph deformations, you should have valid covariances in the graph’s links. As your odometry doesn’t have any covariance set, you can fix it manually with those parameters under rtabmap node:

<param name="odom_tf_angular_variance" type="double" value="0.005"/>
<param name="odom_tf_linear_variance"  type="double" value="0.0001"/>

Those values are required so that parameter RGBD/OptimizeMaxError can be used to reject loop closures based on bad graph optimization:

$ rtabmap --params | grep RGBD/OptimizeMaxError
Param: RGBD/OptimizeMaxError = "1.0"                       
   [Reject loop closures if optimization error ratio is greater 
   than this value (0=disabled). Ratio is computed as absolute 
   error over standard deviation of each link. This will help to 
   detect when a wrong loop closure is added to the graph. 
   Not compatible with "Optimizer/Robust" if enabled.]

Hi,

can you show the header of /firefly/scan?

$ rostopic echo /firefly/scan/header

The frame used is taken from the topic, so if there is a frame name error, this may come from that topic. For the TF tree, /world frame may not exist. For example, if I look at the gazebo turtlebot example of this tutorial: screenshot_2018-08-03_15-09-05 only /odom -> /base_footprint is published from gazebo (when rgbd_odometry argument is true, /odom -> /base_footprint would be published by rgbd_odometry node). /map -> /odom would be published by rtabmap node.

For example in your case,

  • with rgbd_odometry:=true, the TF would look like this: /map -> /odom -> /firefly/base_link
  • with rgbd_odometry:=false, the TF would look like this: /map -> /firefly/odometry_sensor1 -> /firefly/base_link