Low frequency with robot_localization package
Hey, I've started to work with the robot localization package. My sensors are imu which is running at 100Hz Lidar at 10 Hz and a velocity sensor which is running at 20 Hz.
I want to run the EKF at a low frequency (1-5Hz) in order to save computation time. but I see that even if I'm lowering the frequency there is a queue that holds all my measurements and does to all of them the predict and update stages.
I'm looking for an efficient way to lower my frequency and save the computations. 1) Am I missing something? Is there a way to lower the EKF computations without damaging the filter performance? even if my sensors are running at high frequency? 2) Do you think that there is an efficient way to prepare my data in order to send it at a low frequency before I'm publishing it to the robot localization node?
Thanks!
Asked by Gilberto on 2022-06-23 11:14:05 UTC
Answers
You should increase the [source]_queue_size
so that you don't drop messages.
Though, Robot Localization is possibly the single smallest run-time computation on a standard mobile robot platform, accounting for ~1% of all compute. Some background processes on Linux are using more on steady-state. I'd think there would be better places to look for optimizing performance than there.
Asked by stevemacenski on 2022-06-23 18:28:56 UTC
Comments
Thanks for the answer, the [source]_queue_size
is relevant only for the queue size of the subscriber of each sensor. The queue I was speaking about is holding all the measurements (After all of them have been subscribed and received)so it doesn't really affect the number of Kalman iterations.
I'm running it on a raspberry pi4 and I experience a significant slow down when it's running.
and get also the "Failed to meet update rate! Try decreasing the rate, limiting sensor output frequency, or limiting the number of sensors."
Error message
Asked by Gilberto on 2022-06-25 05:13:39 UTC
Comments
Did you build this from source, or installed
.deb
s? If the former: were compiler optimisations enabled? They aren't by default in most cases. Math-heavy code tends to benefit quite heavily from optimisations.Asked by gvdhoorn on 2022-06-27 03:46:57 UTC
Thanks, Yes, I'm building it from the source. What kind of compiler optimizations do I have to enable? for now, I have
add_compile_options(-Wall -Wextra -Wpedantic)
should I add more?Asked by Gilberto on 2022-06-27 09:54:56 UTC
Those are flags that enable compiler diagnostics (ie: warnings and errors). They do not influence optimisation.
To build a ROS CMake-based package with optimisations, it should be enough to add
-DCMAKE_BUILD_TYPE=Release
to thecatkin_make
orcatkin build
command line (orRelWithDebInfo
if you'd still like debug info to be added to the binary).Asked by gvdhoorn on 2022-06-27 10:24:16 UTC