localization problem when turning
hi,
i'm trying to use the navigation stack but i think that i have trouble with amcl , i have a two wheel mobile robot like a big version of turtlebot with 0.5 m radius equiped with Hokuyo laser , and since my wheel encoder gives a bad odometry to correct it i bought an imu sensor " Sparkfun Razor IMU 9DOF " and i used ekf localization to combine the odometry from encoder and the imu data , i had also remap the odom topic of the amcl to the new odometry topic provided by ekf
my problem is that sometimes the laserscan don't match with map specially when the robot stop , here is an example shown on the video you can see that when i'm rotating the robot the scan matches with the map but when i stop it there is a delay between scans and the map , i'm losing my mind i tried every thing i found on ros but it's still not working can you tell what's wrong with my configuration ?
here is the video : video
here is my amcl configuration :
<launch>
<arg name="use_map_topic" default="false"/>
<arg name="scan_topic" default="scan"/>
<arg name="initial_pose_x" default="0.0"/>
<arg name="initial_pose_y" default="0.0"/>
<arg name="initial_pose_a" default="0.0"/>
<arg name="odom_frame_id" default="odom"/>
<arg name="base_frame_id" default="base_link"/>
<arg name="global_frame_id" default="map"/>
<node pkg="amcl" type="amcl" name="amcl">
<param name="use_map_topic" value="$(arg use_map_topic)"/>
<remap from="/odom" to="/odometry/filtered"/>
<!-- Publish scans from best pose at a max of 10 Hz -->
<param name="odom_model_type" value="diff"/>
<param name="odom_alpha5" value="0.1"/>
<param name="gui_publish_rate" value="10.0"/>
<param name="laser_max_beams" value="60"/>
<param name="laser_max_range" value="4.0"/>
<param name="min_particles" value="500"/>
<param name="max_particles" value="2000"/>
<param name="kld_err" value="0.05"/>
<param name="kld_z" value="0.99"/>
<param name="odom_alpha1" value="0.2"/>
<param name="odom_alpha2" value="0.2"/>
<!-- translation std dev, m -->
<param name="odom_alpha3" value="0.2"/>
<param name="odom_alpha4" value="0.2"/>
<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_model_type" value="beam"/> -->
<param name="laser_likelihood_max_dist" value="2.0"/>
<param name="update_min_d" value="0.25"/>
<param name="update_min_a" value="0.2"/>
<param name="odom_frame_id" value="$(arg odom_frame_id)"/>
<param name="base_frame_id" value="$(arg base_frame_id)"/>
<param name="global_frame_id" value="$(arg global_frame_id)"/>
<param name="resample_interval" value="1"/>
<!-- Increase tolerance because the computer can get quite busy -->
<param name="transform_tolerance" value="1.0"/>
<param name="recovery_alpha_slow" value="0.0"/>
<param name="recovery_alpha_fast" value="0.0"/>
<param name="initial_pose_x" value="$(arg initial_pose_x)"/>
<param name="initial_pose_y" value="$(arg initial_pose_y)"/>
<param name="initial_pose_a" value="$(arg initial_pose_a)"/>
<remap from="scan" to="$(arg scan_topic)"/>
</node>
</launch>
and here is the ekf yaml file i used :
frequency: 30
sensor_timeout: 0.1
two_d_mode: true
# Whether to broadcast the transformation ...
What happens if you rotate the other direction? I suspect that the LIDAR isn't aligned correctly and you simply got lucky that it looks correct when rotating. I would expect the LIDAR to lag while rotating. Other direction probably much worse. Test and reply back.
thanks for answering , i tried what you said and it's the same result , i cheked that the LIDAR is aligned so i don't understand what's happennig it's like as if the amcl calculate the position late compared to the motion of the robot
Does this also happen without amcl? (Use odom as fixed frame in rviz)
when i put odom as fixed frame it's the same result , i know that the odometry i'm getting from encoder is poor that's why i added an imu but i dont know it's the odom that causes trouble
If I read your configuration file correctly you totally ignored the rotation from your wheels for odometry which is a good thing. So now we know the error comes from the IMU alone, correct? I suggest to calibrate the IMU and try again. Your problem might also come from magnetic interference.
Btw personally since I replaced my Razor IMU with a Bosch BNO055 based one (Tinkerforge IMU2) my navigation experience improved a lot.
@Humpelstilzchen i forget to calibrate it , i don't know if it will solve the problem but i will try it now
@kesuke have you solved this problem? I am facing something similar