Ask Your Question
0

How to configure hector slam to generate usable maps?

asked 2020-06-23 11:32:12 -0500

omgrobot gravatar image

updated 2020-06-23 15:05:03 -0500

First off, the issue that prompted this question is illustrated by the these images. The map generated by hector_mapping is reasonable if the robot is left untouched however if the the robot is rotated, even slowly, then the map becomes increasingly distorted and ultimately useless. I have searched previously asked questions for hints as to how to solve this but nothing I have tried has alleviated the distortion in the maps. There are no error or warnings being printed by the nodes to the console. I have tried reducing the map size, map update angle threshold and adding IMU data with no success. Is there some configuration that is leading to the distortion or is the hardware I am trying to use not able to support hector_mapping?

The link now includes images of the TF tree.

Hardware setup: - BeagleBone Blue - SlamTec RPLIDAR A1M8

Software Setup: - Ubuntu 18.04 - ROS Melodic - hector_slam package (bionic_armhf)

ROS Launch Files:

  • LIDAR and transforms:

    <launch>

    <arg name="frame_id" default="imu_link"/> <arg name="linear_acceleration_stddev" default="0.04"/> <arg name="angular_velocity_stddev" default="0.02"/> <arg name="orientation_stddev" default="0.0025"/> <arg name="magnetometer_stddev" default="0.04"/>

    <node name="imu_pub_node" pkg="bbblue_drivers" type="imu_pub_node" respawn="true"> </node>

    <node name="rplidarNode" pkg="rplidar_ros" type="rplidarNode" output="screen"> </node>

    <node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0 0 0.0 /map /odom 100"/> <node pkg="tf" type="static_transform_publisher" name="odom_to_basefootprint" args="0.0 0.0 0.0 0 0 0.0 /odom /base_footprint 100"/> <node pkg="tf" type="static_transform_publisher" name="base_footprint_to_base_link" args="0.0 0.0 0.01 0 0 0.0 /base_footprint /base_link 100"/> <node pkg="tf" type="static_transform_publisher" name="base_link_to_base_stab" args="0.0 0.0 0.0 0 0 0.0 /base_footprint /base_stabilized 100"/> <node pkg="tf" type="static_transform_publisher" name="base_stab_to_laser" args="0.0 0.0 0.15 0 0 0 /base_stabilized /laser 100"/>

    </launch>

  • Hector Mapping:

<launch> <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/> <arg name="base_frame" default="base_link"/> <arg name="odom_frame" default="odom"/> <arg name="pub_map_odom_transform" default="true"/> <arg name="scan_subscriber_queue_size" default="10"/> <arg name="scan_topic" default="scan"/> <arg name="map_size" default="256"/>

<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="$(arg base_frame)" />
<param name="odom_frame" value="$(arg odom_frame)" />

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

<!-- 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.7" />    
<param name="map_update_distance_thresh" value ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-06-24 01:23:16 -0500

Pay attention to these two lines:

<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0 0 0.0 /map /odom 100" /> 
<node pkg="tf" type="static_transform_publisher" name="odom_to_basefootprint" args="0.0
    0.0 0.0 0 0 0.0 /odom /base_footprint 100" />

Map to Odom should be published by hectorSLAM in your case.

Odom to base_footprint should be published by the robot base, which is a dead-reckoning calculation.

If a transformation is published by two different publishers, The static transform publisher won't give you an error message but result in an unusable map.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-06-23 11:29:58 -0500

Seen: 153 times

Last updated: Jun 24 '20