ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Low frequency with robot_localization package

asked 2022-06-23 11:14:05 -0500

Gilberto gravatar image

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!

edit retag flag offensive close merge delete

Comments

Did you build this from source, or installed .debs? 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.

gvdhoorn gravatar image gvdhoorn  ( 2022-06-27 03:46:57 -0500 )edit

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?

Gilberto gravatar image Gilberto  ( 2022-06-27 09:54:56 -0500 )edit

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 the catkin_make or catkin build command line (or RelWithDebInfo if you'd still like debug info to be added to the binary).

gvdhoorn gravatar image gvdhoorn  ( 2022-06-27 10:24:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-23 18:28:56 -0500

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.

edit flag offensive delete link more

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

Gilberto gravatar image Gilberto  ( 2022-06-25 05:13:39 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-06-23 11:14:05 -0500

Seen: 273 times

Last updated: Jun 23 '22