How to output the position estimate value as a number instead of an arrow

Hello …
I am currently learning ROS Navigation and robot_localization.

In Navigation, I did an exercise where I used PoseArray to estimate the robot’s position using arrows.

My question is, how can I estimate the robot’s self-position using numbers instead of arrows?

For example, let’s say we want the robot to move 10m straight from a certain point. In this case, it is possible to estimate the robot’s position from the starting point using a PoseArray based on the information from the sensors mounted on the robot (e.g., IMU and wheel odometry). I would like to confirm this information.

Is there an effective way to make such a numerical estimate? If it should have already been mentioned, I would like to know where I am missing information.
Also, if I lack a basic understanding of ROS, I would appreciate it if you could point that out to me.

Thank you very much.

Yes, this is certainly possible the PoseArray is just and array of Pose’s as the name implies each Pose contains a Point for position and Quaternion for orientation from there you would just need to extract the numbers that define it’s position/orientation and write a class the moves the robot in the direction and distance you want.

The point of the navigation stack is to avoid having to do this it is much easier to use the navigation packages and let the robot move from it’s current position to one you want and let it move their using it’s sensors to avoid obstacles and find a path to the given destination. As you proceed through the course you will see that there are several packages that can accomplish this. The most common one and the one I use most frequently is AMCL which you will learn about in this course.

Hope this helps.

1 Like

Thank you for your appropriate advice. @hskramer
I am currently starting a university research project on improving the self-positioning accuracy of a mechanam-wheel robot in outdoor environments.

So I am rebuilding the system with ROS (especially for sensor fusion), which is an evolution from the previous system.

My research is not about making the robot run autonomously, but more about comparing the actual distance traveled with the information about how far the robot has traveled.

For this reason, I thought it would be useful to have a preset that calculates the distance traveled from the information sent by the sensors using the existing ROS package or the Navigation Stack function.
However, this function needs to be created by the user.

If you have any suggestions on packages or things to learn about quantifying location estimation, I’d love to hear them.

I’m currently learning about AMCL!

Translated with www.DeepL.com/Translator (free version)

1 Like

If that’s the case then your on the right track sensor fusion is the correct approach from there it comes down to filtering the noise out the most common are based of Kalman filters. The Husarion ROSbot’s have you install the EKF package right away it’s the Extended Kalman Filter. You can start by looking into the mathematics behind these filters and also the actual implementation you can find many examples on github search localization with Extended Kalman Filters (EKF). Also Bayesian filters these can be separate or part of an EKF and can be implemented in python or C++ or a mixture of the two. To see some examples of calculating the distance move there are several youtube videos this one in particular was done by Ricardo Tellez the founder of this site and uses Odometry and there are several more.

Distance moved Odometry

From there I would determine the theoretical limit of the algorithm. Then run tests comparing the actual distance moved with what the robot’s filtered sensors show (see if you can have your filter keep track of the distance moved using the filtered fused sensors) If not write a simple program to determine the distance moved after the filter has been applied.

They have recursive versions it would be really interesting to see one implemented with dynamic programming this an optimization on recursive methods it removes duplicate calculations and makes the program run faster. So a recursive EKF or any other recursive filtering method written using a dynamic algorithm would be very nice. I hope this is what are asking. If not post again and I will help as much as possible. I would like to see what you develop I hope you can share it on github. This is going to be a large and demanding project but you will learn a lot.

2 Likes