robot starts drifiting/rotating in RVIZ, issues with odometry data or amcl
Hi all,
I have a mobile robot and I would like it to navigate around the building and I already have a map of the building. I am using wheel encoders to generate odometry message, robot_pose_ekf to fuse data from IMU and wheel_encoders, amcl for localization and move_base for planning. I am using hokuyo laser for navigation. The transformations and tf tree seems to be correct.
Once I start the robot (initial pose of the robot is specified using the parameters of amcl), everything looks good, I have attached the RVIZ image below:
Now, when I rotate the robot at its initial position manually just to see whether the odometry data and localization is working properly, say I rotate the robot by 90 degrees in clockwise direction and then again 90 degrees in anticlockwise direction manually to bring it to the original position, it seems to be working at first but after some time, the robot in RVIZ starts drifting although the actual robot is stationary. It will keep on drifting and will stop at some random and wrong position. I have attached images below (the actual position of the robot is same as the above image):
Also, when I give a goal to the robot, it is able to go towards the goal position but once it is close to the goal position, it again starts behaving in a weird manner (starts rotating in a random way which messes up the localization of the robot).
I am not able to figure out whether the problem lies in the odometry data or amcl localization. If anyone has any idea about how to solve such an issue, any help will be greatly appreciated. Let me know if you need more information from my side.
Thanks in advance.
Naman Kumar
Did you solve it?
Maybe you can decrease the orientation covariance and increase the acceleration and gyro of the IMU message in order to increase the believe of the magnetometer reading and avoid in this way the vehicle drift.