Any method to solve navigation initial state pose estimation?

Dear @staff and ros player,

I have been experimenting with a live car after taking the ros navigation course and have found a problem that I would like to ask you about.

Every time I finish building a map and prepare to start navigation, I have to manually put the cart back to the starting point of the build, otherwise, the cart cannot accurately estimate its initial position during navigation. So, my question is: Is there any way to eliminate the “manually put the cart back to the starting point” step, after all, it seems a bit redundant.

I look forward to hearing you!

Thank you,

Hi @zlwnge,

You definitely shouldn’t have to put the car back to the initial position each time you start the Navigation system.

When you open RViz, just by clicking the 2D Pose Estimate and setting the location and orientation on the map should be enough:

After clicking 2D Pose Estimate, you click on the map just in the same way as you do when setting a 2D Nav Goal.

Please let me know if I misunderstand your question.

Mr. @ralves ,

Thank you for your reply, first.
And Maybe I haven’t expressed my meaning clear in the above.
What I want to express is that I would like to know if is there a way to let the car initialize the navigation position by itself with the data obtained from its own sensors. Instead of manually or through the rviz tool putting it back.

Thank you,

You can localize your robot programmatically. For that you have two options (for ROS1):

  1. Call the global_localization service. If you call that service, the particles will be distributed over the whole map and then, as the robot moves, it may localize at the proper location. This option is used when you need to localize the robot but you have no idea where it is (every time that the robot starts, it is in a different location and your program cannot identify where it will be)
  2. Publish a position in the initalpose topic. If you know where the robot starts every time you switch it on (like for example, it starts at the charging station), you can publish that position on that topic and the AMCL will localize at that position. This is used when you know where the robot starts.

Usually, the global_localization works quite well (if the environment is not very large or very symmetrical).

We explain both methods on the ROS Navigation in 5 days course (for ROS1), and on the ROS2 Navigation (Galactic) course (for ROS2).

Also, check the AMCL documentation for more details.

1 Like

Thank you for your help. I’ll try it later.

This topic was automatically closed after 7 days. New replies are no longer allowed.