0
$\begingroup$

Rosanswers logo

Greetings, I am using AMCL for localisation purposes, along with the lase scan matcher in order to use the robot's Hokuyo for odometry. When I run the LSM alone or with Hector mapping the results are satisfying, which means that I get real and precise odometry and localisation.

What I want is to load a map made with the above method and use AMCL to localise. So I need to have the local scan matcher working along with AMCL and the map server. The problem is that when AMCL begins its /amcl_pose topic will explode with impossible values such as :

header: 
  seq: 59
  stamp: 
    secs: 1383831717
    nsecs: 913606750
  frame_id: map
pose: 
  pose: 
    position: 
      x: -6544630.80033
      y: 3216474.76088
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.702181212802
      w: 0.711998275552
  covariance: [35307899258837.086, 3493650456763.3486, 0.0, 0.0, 0.0, 0.0, 3493650456763.3496, 26413591121546.38, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.113657631539715]

, and promptly crash.

The transforms provided can be seen in the following launch files: Firstly, the lase scan matcher launch file :

<launch>
    <!-- <node pkg="tf" type="static_transform_publisher" name="world_odom" args="0.10 0 0 0.0 0.0 0.0 /world /map 40"/> -->
    <node pkg="tf" type="static_transform_publisher" name="map_odom" args="0.10 0 0 0.0 0.0 0.0 /map /odom 100" />
    <node pkg="tf" type="static_transform_publisher" name="odom_bl" args="0.10 0 0 0.0 0.0 0.0 /odom /base_link 100" />
    <node pkg="tf" type="static_transform_publisher" name="bl_laser" args="0.0 0 0 0.0 0.0 0.0 /base_link /laser 100" />
    <node name="map_server" pkg="map_server" type="map_server" args="/home/****/test.yaml"/>
    <node pkg="laser_scan_matcher" type="laser_scan_matcher_node" name="laser_scan_matcher_node" output="screen">
        <!-- <param name="fixed_frame" value = "odom"/> -->
        <param name="base_frame" value = "/base_link"/>
        <param name="fixed_frame" value = "map"/>
        <param name="use_cloud_input" value="false"/>
        <param name="publish_tf" value="true"/>
        <param name="publish_odom" value="true"/>
        <param name="use_odom" value="false"/>
        <param name="use_imu" value="false"/>
        <param name="use_alpha_beta" value="true"/>
        <param name="max_iterations" value="10"/>
    </node>
    <node pkg="hokuyo_node" type="hokuyo_node" name="hokuyo_node"> 
        <param name="intensity" type="bool" value="true"/>
    </node>
    
</launch>

And secondly the AMCL launch file :

<launch>
<!--- Run AMCL -->
 <include file="/home/******/navigation-hydro-devel/amcl/examples/amcl_diff.launch" /> 

  <node pkg="sek_drive" type="drive_base" respawn="true" name="sek_drive" output="screen">
    <rosparam file="$(find sek_drive)/launch/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find sek_drive)/launch/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find sek_drive)/launch/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find sek_drive)/launch/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find sek_drive)/launch/base_local_planner_params.yaml" command="load" />
  </node>
</launch>

What I notice is that the odometry provided by LSM has always all-zero covariance. Could that be a problem. If so, is there any way to calculate covariance from laser scans ?

If you have any ideas or need more info, please respond and I will provide it. Thanks !


Originally posted by AndreasLydakis on ROS Answers with karma: 140 on 2013-11-07

Post score: 5

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

  1. Remove the static transforms from map -> odom and odom -> base_link. You want them dynamic from amcl and the laser_scan_matcher and not static.
  2. fixed_frame for the laser_scan_matcher has to be set to /odom and not map, since the node is responsible for your odom -> base_link transform and not the localization within your map.

Originally posted by Ben_S with karma: 2510 on 2013-11-07

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by AndreasLydakis on 2013-11-07:
That seems to have did the trick ! Thank you !

Comment by rui on 2018-11-16:
WAIT WAT? sry i m new to ros i have the same issue but i dun understand the solution...pls give hlp mi more...

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.