ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

hector slam

asked 2015-04-01 03:51:11 -0500

HELPME gravatar image

updated 2015-04-07 22:22:26 -0500

hi guys, i tried to run the hector_slam with my bagfile .however the rviz doesn't show anything. instead it come out this at the terminal.i have tried the SettingUpForYourRobot tutorial but it does not seem to work at all.

im rather new here,so please help me.thanks :D

[ WARN] [1427877911.218559354, 1378884604.791841348]: No transform between frames /map and scanmatcher_frame available after 20.001779 seconds of waiting. This warning only prints once.
[ INFO] [1427877911.716060193, 1378884605.295818198]: lookupTransform base_footprint to /laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1427877912.220115826, 1378884605.799589257]: lookupTransform base_footprint to /laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1427877912.723062304, 1378884606.302934693]: lookupTransform base_footprint to /laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1427877913.227183889, 1378884606.806661066]: lookupTransform base_footprint to /laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1427877913.730203378, 1378884607.310326008]: lookupTransform base_footprint to /laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1427877914.233894742, 1378884607.813616032]: lookupTransform base_footprint to /laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1427877914.737839807, 1378884608.317104749]: lookupTransform base_footprint to /laser timed out. Could not transform laser scan into base_frame.
edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

answered 2015-04-01 04:50:27 -0500

updated 2015-04-08 10:56:38 -0500

Probably the required transformation are not broadcasted or you mismatch frame names. Run

 rosrun tf view_frames

to check broadcasted frames and compare result with used Hector slam configuration. If you not solve you problem please post the view_frame result and your Hector slam configuration.

UPDATE

Sorry, I was not clear: the output from

rosrun tf view_frames

is the generated pdf file that contains the TF tree. You should post this file!

About Hector Slam configuration: the file you posted IS NOT the Hector Slam configuration: you have to post the parameters passed to hector slam node when you run it!

UPDATE for amsoufari

The LaserScan message contains an header which include the reference frame for scan data. In your bag file the LaserScan messages published with /robot0/laser_0 topic use robot0_laser_0 as frame and you are not broadcasting this frame. Try to change laser_link robot0_laser_0 in last tf in your launch file, it should work!

edit flag offensive delete link more

Comments

hi, thanks for helping me out. i have edited and post the view_frame result and hector slam configuration

HELPME gravatar image HELPME  ( 2015-04-01 20:23:33 -0500 )edit

For 20.04 ros noetic, use:

rosrun tf2_tools view_frames.py
amjack gravatar image amjack  ( 2021-12-03 07:27:14 -0500 )edit
0

answered 2015-04-07 11:06:36 -0500

amsoufari gravatar image

updated 2015-04-08 01:09:17 -0500

Hello,

Unfortunately I encounter the same problem, I think it's the same problem (from new ROS users). Please could you help us?

Error

[ INFO] [1428421244.571458994]: lookupTransform base_footprint to robot0_laser_0 timed out. Could not transform laser scan into base_frame.

Launch file

<!-- Name of topics -->
<arg name="scan_topic" default="/robot0/laser_0" />
<arg name="map_topic" default="/SaveMap/map" />

<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
<param name="/use_sim_time" value="true" />

<param name="scan_topic" value="$(arg scan_topic)" />
<param name="base_frame" value="base_footprint" />
<param name="odom_frame" value="base_frame" />

<param name="output_timing" value="false"/>
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="true"/>

<remap from="map" to="$(arg map_topic)" />
</node>

<!-- TF publish-->
<node pkg="tf" type="static_transform_publisher" name="world_2_map" args="0 0 0 0 0 0  /world /map 100" />
<node pkg="tf" type="static_transform_publisher" name="map_2_base_footprint" args="0 0 0 0 0 0 /map /base_footprint 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_footprint_2_base_link" args="0 0 0 0 0 0 /base_footprint /base_link 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_link_2_base_stabilized_link" args="0 0 0 0 0 0 /base_link /base_stabilized 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_stablized_2_base_frame" args="0 0 0 0 0 0 /base_stabilized /base_frame 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_2_nav_link" args="0 0 0 0 0 0 /base_frame /nav 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_frame_2_laser_link" args="0 0 0 0 0 0 /base_frame /laser_link 100"/>

Bagfile info

rosbag play output2.bag --clock

  • path: output2.bag
  • version: 2.0
  • duration: 57.1s
  • start: Mar 27 2015 10:59:16.20 (1427450356.20)
  • end: Mar 27 2015 11:00:13.34 (1427450413.34)
  • size: 6.2 MB
  • messages: 2858
  • compression: none [9/9 chunks]
  • types: sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369]
  • topics: /robot0/laser_0 2858 msgs : sensor_msgs/LaserScan

tf view_frames

(Unfortunately I need >5 points to upload the file )

https://drive.google.com/file/d/0B43c...

RQT_graph

https://drive.google.com/file/d/0B43c...

Thanks you in advance

edit flag offensive delete link more

Comments

1

Please read latest update in my answer.

afranceson gravatar image afranceson  ( 2015-04-08 10:58:09 -0500 )edit

Amazing! It works. Thank you.

amsoufari gravatar image amsoufari  ( 2015-04-23 09:32:31 -0500 )edit
0

answered 2015-04-09 10:54:18 -0500

felixwatzlawik gravatar image

may I ask for your Launch Files Gentlemen?

edit flag offensive delete link more
0

answered 2017-12-21 13:56:43 -0500

BrusAngel gravatar image

Hello,... no sure if this is the right way to do it, but here I go... I'm having a fairly similar problem... my error messages says:

[ INFO] [1513946503.671288116]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1513946504.178969028]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1513946504.687717843]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1513946505.195699788]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1513946505.704076349]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.

: my frames.pdf here

using a slightly modified version from the default launch files provided: mapping_default.launch

<launch> <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/> <arg name="base_frame" default="base_frame"/> <arg name="odom_frame" default="base_frame"/> <arg name="pub_map_odom_transform" default="true"/> <arg name="scan_subscriber_queue_size" default="5"/> <arg name="scan_topic" default="scan"/> <arg name="map_size" default="2048"/>

<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">

<!-- Frame names -->
<param name="map_frame" value="map" />
<param name="base_frame" value="base_link" />  <!--  original : $(arg base_frame) -->
<param name="odom_frame" value="odom" />  <!-- original : $(arg odom_frame) -->

<!-- Tf use -->
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>
<param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>

<!-- Map size / start point -->
<param name="map_resolution" value="0.050"/>
<param name="map_size" value="$(arg map_size)"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="map_multi_res_levels" value="2" />

<!-- Map update parameters -->
<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.9" />    
<param name="map_update_distance_thresh" value="0.4"/>
<param name="map_update_angle_thresh" value="0.06" />
<param name="laser_z_min_value" value = "-1.0" />
<param name="laser_z_max_value" value = "1.0" />

<!-- Advertising config --> 
<param name="advertise_map_service" value="true"/>

<param name="scan_subscriber_queue_size" value="$(arg scan_subscriber_queue_size)"/>
<param name="scan_topic" value="$(arg scan_topic)"/>

<!-- Debug parameters -->
<!--
  <param name="output_timing" value="false"/>
  <param name="pub_drawings" value="true"/>
  <param name="pub_debug_output" value="true"/>
-->
<param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />

</node>

<node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 /base_link /laser 100"/> <node pkg="tf" type="static_transform_publisher" name="base_link_2_laser_link" args="0 0 0 0 0 0 /base_link /laser 100"/>

</launch>

and tutorial.launch

<?xml version="1.0"?>

<launch>

<arg name="geotiff_map_file_path" default="$(find hector_geotiff)/maps"/>

<node pkg="rviz" type="rviz" name="rviz" args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>

<include file="$(find hector_mapping)/launch/mapping_default.launch"/>

<include file="$(find hector_geotiff)/launch/geotiff_mapper.launch"> <arg name="trajectory_source_frame_name" value="scanmatcher_frame"/> <arg name="map_file_path" value="$(arg geotiff_map_file_path)"/> </include>

</launch>

my hardware: 1. iRobot_create using the drivers provided by: https://github.com/AutonomyLab/create... 2. Hokuyo URG Lidar using hokuyo_node 3. Kinetic distribution

any help will really appreciated as I'm going crazy with this trying to make it work.

thanks!

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-04-01 03:51:11 -0500

Seen: 5,896 times

Last updated: Apr 08 '15