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

AMCL wont search for its position

asked 2015-03-18 10:02:02 -0600

davidb gravatar image

updated 2015-03-19 02:42:39 -0600

I've a problem with getting AMCL working.
I used hector_mapping for creating a map. during the hectormapping i recorded the /scan topic in a .bag file. The main goal is playing the bagfile with the /scan topic and then let ACML locate its position in the created map.

I know i need odometry data but i doenst have that yet. So for now the "odom_frame_id" == base_link. does that suggest there is no movement?

Can someone help me finding the problem? ACML is not finding its position so i dont get a pose.

Capture from rviz, laser data is coming in and map is loaded successfully: capture rviz

My launchfile is as following:

<param name="/use_sim_time" value="true"/>ros

<node pkg="rviz" type="rviz" name="rviz" />

<node pkg="tf" type="static_transform_publisher" name="base_link_to_sick"      args="0 0 0 0 0 0 base_link sicks300_expert_scan_frame 100" />
<node pkg="tf" type="static_transform_publisher" name="base_link_to_odom"      args="0 0 0 0 0 0 base_link odom 100" />

<arg name="map_file" default="$(find SickS300)/maps/mymap.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

<!-- AMCL -->
<node name="amcl" pkg="amcl" type="amcl" output="screen" >
<remap from="scan" to="scan" />

        <!-- Overall filter parameters -->
        <param name="min_particles" value="500"/>
        <param name="max_particles" value="5000"/>
        <param name="kld_err" value="0.05"/>
        <param name="kld_z" value="0.99"/>
        <param name="update_min_d" value="0.2"/>
        <param name="update_min_a" value="0.2"/>
        <param name="resample_interval" value="1"/>
        <param name="transform_tolerance" value="0.2"/>
        <param name="recovery_alpha_slow" value="0.0"/>
        <param name="recovery_alpha_fast" value="0.0"/>
        <param name="gui_publish_rate" value="10.0"/>

        <!-- Laser model parameters -->
        <param name="laser_max_beams" value="30"/>
        <param name="laser_z_hit" value="0.5"/>
        <param name="laser_z_short" value="0.05"/>
        <param name="laser_z_max" value="0.05"/>
        <param name="laser_z_rand" value="0.5"/>
        <param name="laser_sigma_hit" value="0.2"/>
        <param name="laser_lambda_short" value="0.1"/>
        <param name="laser_model_type" value="likelihood_field"/>
        <param name="laser_likelihood_max_dist" value="2.0"/>

        <!-- Odometery model parameters -->
        <param name="odom_model_type" value="diff"/>
        <param name="odom_alpha1" value="0.2"/>
        <param name="odom_alpha2" value="0.2"/>
        <param name="odom_alpha3" value="0.8"/>
        <param name="odom_alpha4" value="0.2"/>

    <!--param name="odom_model_type" value="omni"/>
    <param name="odom_alpha1" value="0.2"/>
    <param name="odom_alpha2" value="0.2"/>
    <param name="odom_alpha3" value="0.8"/>
    <param name="odom_alpha4" value="0.2"/>
    <param name="odom_alpha5" value="0.1"/-->

        <param name="odom_frame_id" value="base_link"/>
        <param name="base_frame_id" value="base_link"/>
        <param name="global_frame_id" value="map"/>

        <param name="initial_pose_x" value="0"/>
        <param name="initial_pose_y" value="0"/>

Also if i turn on pose in rviz i get this image. the pose does'nt update. pose works once, no update

it is also broadcasting the tf transformation between the map and the base link, only the tf is not right. tf-map-to-base

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-05-04 05:34:09 -0600

felixwatzlawik gravatar image

Your TF tree is wrong, map has to be tf-ed to odom and odom to base_link like in this picture.

map -> odom -> base_link -> laser_scanner (camera_link in the picture below, it is a s300 aswell)

image description

The TF from map to odom is normally done by hector_mapping, when you did your map you have to do this transform by your own or use amcl which tf's it.

Hope I could help

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-03-18 10:02:02 -0600

Seen: 909 times

Last updated: May 04 '15