Robotics StackExchange | Archived questions

hector_mapping: No transform between frames /map and /base_link

(See EDIT 1 for new information)

Hello.

Running ROS Kinetic Ubuntu 16.04.6 LTS kernel version: Linux 4.15.0-72-generic x86_64

I have been following a tutorial for implementing SLAM without odometry using hectorslam and hectormapping: https://archit0994.wixsite.com/architshah/post/manage-your-blog-from-your-live-site The launch file that I am using is the same as what this tutorial states, and as a result, I haven't been making changes to the mapping_default.launch file.

<?xml version="1.0"?>

 <node name="ydlidar_node" pkg="ydlidar" type="ydlidar_node" output="screen" respawn="false" >

  <param name="port" type="string" value="/dev/ydlidar"/>

  <param name="baudrate" type="int" value="128000"/>

  <param name="frame_id" type="string" value="laser_frame"/>

  <param name="low_exposure" type="bool" value="false"/>

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

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

  <param name="reversion" type="bool" value="false"/>

  <param name="angle_min" type="double" value="-180" />

  <param name="angle_max" type="double" value="180" />

  <param name="range_min" type="double" value="0.1" />

  <param name="range_max" type="double" value="16.0" />

  <param name="ignore_array" type="string" value="" />

  <param name="samp_rate" type="int" value="9"/>

  <param name="frequency" type="double" value="30"/>

 </node>

 <node pkg ="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0.0 0.0 0.0 /map /nav 30"/>

 <node pkg ="tf" type="static_transform_publisher" name="odom_to_base_link" args="0.0 0.0 0.0 0.0 0.0 0.0 /nav /base_footprint 30"/>

 <node pkg="tf" type="static_transform_publisher" name="base_link_to_laser" args="0.2245 0.0 0.2 0.0 0.0 0.0 /base_footprint /laser_frame 30" />

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

 <node pkg="rviz" name="rviz" type="rviz" args="-d $(find ydlidar)/launch/lidar.rviz" />

 <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch" />

The hardware that I am using matches the tutorial and is the YDLidar X4 (Firmware version: 1.0.5), a 2D lidar scanner. I have gone through all the steps in the tutorial up to this section, where hector_mapping is used to build a map of the environment.

When I run this file using:

roslaunch ydlidar all_nodes.launch

Everything starts fine in rviz, but it is unable to display the map when it is added. The error to the command line seems to be a common one on this forum:

[YDLidar]: [YDLIDAR INFO] Now YDLIDAR is scanning ......

[ WARN] [1576498958.250710491]: No transform between frames /map and /base_link available after 20.002579 seconds of waiting. This warning only prints once.

What is it in the launch file that is causing this error that I can fix?

From roswtf I have:

roswtf Loaded plugin tf.tfwtf

No package or stack in context

Static checks summary:

No errors or warnings

Beginning tests of your ROS graph. These may take awhile... analyzing graph... ... done analyzing graph running graph rules... ... done running graph rules running tf checks, this will take a second... ... tf checks complete

Online checks summary:

Found 1 warning(s). Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:

And from tf_monitor I have:

rosrun tf tf_monitor

RESULTS: for all Frames

Frames:

All Broadcasters:

RESULTS: for all Frames

Frames:

Frame: /basefootprint published by unknownpublisher Average Delay: -0.0396048 Max Delay: 0

Frame: /laserframe published by unknownpublisher Average Delay: -0.0395909 Max Delay: 0

Frame: /nav published by unknown_publisher Average Delay: -0.0395914 Max Delay: 0

Frame: nav published by unknown_publisher Average Delay: -0.00482404 Max Delay: 0

Frame: scanmatcherframe published by unknownpublisher Average Delay: -0.00481506 Max Delay: 0

(this prints over and over again)

And from tf view_frames my frames pdf is:

https://drive.google.com/open?id=1DQnZxB3Y7fzb2MY-QeQiGxu70qGhOBrw

I've tried changing the allnodes.launch file to alter the basefootprint and baselink, doing the things mentioned in the ROS hectormapping setup guide, but that didn't change anything: http://wiki.ros.org/hector_slam/Tutorials/SettingUpForYourRobot

(these were added to the launch file with no change)

<param name="pub_map_odom_transform" value="true"/>
<param name="map_frame" value="map" />
<param name="base_frame" value="base_frame" />
<param name="odom_frame" value="base_frame" />

So these changes didn't fix anything, or making those changes in the default_mapping.launch file.

Please let me know what I can do to fix my launch file.

Thank you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EDIT 1!!!

I managed to get tfecho running and these were the outputs. It seems like scanmatcherframe and map are correctly transforming, but after that it seems rather strange.

1) rosrun tf tfecho scanmatcherframe map

At time 1576514133.466

At time 1576514134.120

2) rosrun tf tf_echo nav map

At time 1576514258.673

At time 1576514259.428

At time 1576514260.432

(this is then repeated, no more of the first echo that had actual data, which was very strange)

3) rosrun tf tfecho nav basefootprint

At time 1576514452.349

At time 1576514453.112

4) rosrun tf tfecho basefootprint laser_frame At time 1576514481.886

At time 1576514482.609

These "empty" frame transformations seem to match the all_nodes.launch file that I am using (to my eye anyway).

I'm still not sure how I can use this information to edit my launch file. Should I be making a connection between scanmatcherframe and nav (which is odometry frame btw)? or scanmatcherframe and base_footprint?

Thank you for help! I hope this edit is useful to others trying to fix their problems!

Asked by ydlidar_question on 2019-12-16 10:40:26 UTC

Comments

Answers

Answer! I found another person doing quite similar work, and combining some of their launch file and the answer's launch file.. I have a new launch file that works (although it refreshes VERY slowly!)

Sourced from: https://answers.ros.org/question/305298/how-to-map-with-hector_mapping-and-just-a-lidar/

Asked by ydlidar_question on 2019-12-17 05:38:32 UTC

Comments