This is my first post on the forum although I read Q&A posted here constantly. I haven´t seen a similar question so here it goes:
I am implementing an EKF for localization from scratch just for fun. I am using ROS and the device is the Turtlebot Burger. The idea is to develop my own benchmark between velocity and odometry based motion controls. I have implemented a class that handles all the data coming from the turtlebot (velocity, odometry, lidar, etc). The published velocity and lidar values measured have different frequencies.
Then I have implemented the two steps of the EKF (prediction and correction) as functions having this turtlebot object as argument.
The question here is how frequent should I call these functions. Every time I receive values would be a good state? For example, if I receive velocity values every 10Hz should I call the prediction at the same frequency?, so When the robot is not moving (stopped or just after booting) I am receiving zeros for the velocity. I guess calling the prediction step here would be an error, as I would be incrementing the covariance due to the noise matrix Q. Same scenario happens with the Lidar values, should I call the correction at the same frequencies as the read values? Same for when the robot is not moving.
And also while moving, what should be a good prediction/correction ratio?
Any help would be appreciated, Many thanks.