Problem with subscribe_laserScan
Hi,
I tried following this tutorial [http://wiki.ros.org/rtabmap_ros/Tutorials/SetupOnYourRobot] to setup rtabmap on my clearpath husky robot. The launch file is pasted below:
<!-- rtabmap arguments -->
<arg name="rtabmap_args" default="delete_db_on_start" />
<arg name="visual_odometry" default="false" />
<arg name="rgb_topic" default="/camera/rgb/image_rect_color" />
<arg name="frame_id" default="base_link" />
<arg name="scan_topic" default="/scan" />
<arg name="depth_registered_topic" default="/camera/depth_registered/image_raw" />
<arg name="camera_info_topic" default="/camera/rgb/camera_info" />
<!-- rtabmapviz arguments -->
<arg name="rtabmapviz" default="false" />
<arg name="rtabmapviz_cfg" default="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" />
<!-- rviz arguments -->
<arg name="rviz" default="false" />
<arg name="rviz_cfg" default="-d $(find coffeebot)/launch/config/cbrc.rviz" />
<!-- Use this for localizing in an established database -->
<!-- <arg name="database_path" default="~/.ros/rtabmap.db" /> -->
<!-- ######## Initialize Nodes ######## -->
<!-- Launch husky base -->
<include file="$(find husky_base)/launch/base.launch" />
<!-- Start static transform publishers to attach the laser and kinect to the husky -->
<node pkg="tf" type="static_transform_publisher"
name="kinect_tf_publisher" args="-0.5 0 0.8 0 0 0 /user_rail_link /camera_link 100" />
<node pkg="tf" type="static_transform_publisher"
name="laser_tf_publisher" args="-0.5 0 0.5 0 0 3.14 /user_rail_link /laser 40" />
<!-- Start Kinect sensor -->
<include file="$(find freenect_launch)/launch/freenect.launch">
<arg name="depth_registration" value="true" />
</include>
<!-- Start laser scanner -->
<node name="hokuyo" pkg="hokuyo_node" type="hokuyo_node" respawn="false" output="screen" >
<param name="calibrate_time" type="bool" value="true" />
<param name="port" type="string" value="/dev/ttyACM0" />
</node>
<!-- Start rtabmap and vizualization -->
<group ns="rtabmap">
<!-- remaps for rtabmap nodes -->
<remap from="rgb/image" to="$(arg rgb_topic)" />
<remap from="depth/image" to="$(arg depth_registered_topic)" />
<remap from="rgb/camera_info" to="$(arg camera_info_topic)" />
<!-- start the rtabmap node -->
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
<!-- rtabmap parameters (http://wiki.ros.org/rtabmap_ros#rtabmap) -->
<param name="frame_id" type="string" value="$(arg frame_id)" />
<param name="subscribe_depth" type="bool" value="true" />
<param name="subscribe_laserScan" type="bool" value="true" />
<param name="RGBD/PoseScanMatching" type="string" value="true"/>
<param name="RGBD/LocalLoopDetectionSpace" type="string" value="true"/>
<param name="LccIcp/Type" type="string" value="2"/> <!-- 2=ICP 2D -->
<param name="LccBow/MinInliers" type="string" value="5"/>
<param name="LccBow/InlierDistance" type="string" value="0.1"/>
<param name="RGBD/AngularUpdate" type="string" value="0.01"/>
<param name="RGBD/LinearUpdate" type="string" value="0.01"/>
<param name="Rtabmap/TimeThr" type="string" value="700"/>
<param name="Mem/RehearsalSimilarity" type="string" value="0.45"/>
<param name="RGBD/OptimizeFromGraphEnd" type="string" value="true"/>
<remap from="odom" to="$(arg odom_topic)" />
<remap from="scan" to="/scan" />
</node>
<!-- Visualization rtabmapviz -->
<node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="$(arg rtabmapviz_cfg)" output="screen">
<param name="subscribe_depth" type="bool" value="true"/>
<param name="subscribe_laserScan" type="bool" value="$(arg use_laser_scanner)"/>
<param name="subscribe_odom_info" type="bool" value="$(arg visual_odometry)"/>
<param name="frame_id" type="string" value="$(arg frame_id)"/>
<param name="wait_for_transform_duration" type="double" value="0.1"/>
<!--<remap from="scan" to="$(arg scan_topic)"/>-->
<remap unless="$(arg visual_odometry)" from="odom" to="$(arg odom_topic)"/>
</node>
</group>
<!-- Start rviz and associated rtabmap nodelets (http://wiki.ros.org/rtabmap_ros#Nodelets) -->
<group ns="rviz">
<!-- Visualization RVIZ -->
<node if="$(arg rviz)" pkg="rviz" type="rviz" name="rviz" args="$(arg rviz_cfg)"/>
<!-- sync cloud with odometry and voxelize the point cloud (for fast visualization in rviz) -->
<node if="$(arg rviz)" pkg="nodelet" type="nodelet" name="standalone_nodelet" args="manager" output="screen"/>
<node if="$(arg rviz)" pkg="nodelet" type="nodelet" name="data_odom_sync" args="load rtabmap_ros/data_odom_sync standalone_nodelet">
<remap from="rgb/image_in" to="$(arg rgb_topic)"/>
<remap from="depth/image_in" to="$(arg depth_registered_topic)"/>
<remap from="rgb/camera_info_in" to="$(arg camera_info_topic)"/>
<remap if="$(arg visual_odometry)" from="odom_in" to="rtabmap/odom"/>
<remap unless="$(arg visual_odometry)" from="odom_in" to="$(arg odom_topic)"/>
<remap from="rgb/image_out" to="data_odom_sync/image"/>
<remap from="depth/image_out" to="data_odom_sync/depth"/>
<remap from="rgb/camera_info_out" to="data_odom_sync/camera_info"/>
<remap from="odom_out" to="odom_sync"/>
</node>
<node if="$(arg rviz)" pkg="nodelet" type="nodelet" name="points_xyzrgb" args="load rtabmap_ros/point_cloud_xyzrgb standalone_nodelet">
<remap from="rgb/image" to="data_odom_sync/image"/>
<remap from="depth/image" to="data_odom_sync/depth"/>
<remap from="rgb/camera_info" to="data_odom_sync/camera_info"/>
<remap from="cloud" to="voxel_cloud" />
<param name="decimation" type="double" value="2"/>
<param name="voxel_size" type="double" value="0.02"/>
</node>
</group>
This launch file runs fine as long as I dont use the hokuyo laser scanner. The moment I change 'uselaserscanner' to true, it runs for a few seconds and I then get this error message. For frame [laser]: No transform to fixed frame [map]. TF error: [Lookup would require extrapolation into the future. Requested time 1457726743.222074750 but the latest data is at time 1457726737.724745749, when looking up transform from frame [laser] to frame [map]] I have tried to solve this for a few days now but with no success. Im new to ROS so please excuse the easy errors if any. Thanks for the help.
Asked by jrebello on 2016-03-15 22:32:13 UTC
Comments
Can you add the TF tree in your question when the laser is used? using
$ rosrun tf view_frames
. Also which node is publishing this error (you can userqt_console
for convenience)?Asked by matlabbe on 2016-03-16 13:14:10 UTC
I managed to solve it by reinstalling rtabmap and rtabmap_ros from source. I think the project is being actively developed so there might have been a problem from the developers side that got fixed.
Asked by jrebello on 2016-03-17 21:58:20 UTC