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

Revision history [back]

You can't guarantee that the filter is receiving the exact same messages in every run. I'm guessing you are seeing something like this:

Run 1

  • Node begins initializing
  • Bag starts playing
  • Node finishes subscribing to topics after 0.10 seconds
  • First messages received in callbacks

Run 2

  • Node begins initializing
  • Bag starts playing
  • Node finishes subscribing to topics after 0.15 seconds
  • First messages received in callbacks. These messages are not the same as in Run 1.

The timing of the messages coming in, combined with when the node actually completes initialization, will mean that you will definitely see some variation from run to run. Moreover, an EKF's prediction step involves linearizing its transfer function around the current state. That linearization process introduces small errors (it's the price you pay for nonlinear state estimation in this case), so if you aren't linearizing around the _exact_ same state between two runs, you'll see some small differences there as well.

Anyway, the short version is that there's going to be variability in each run, just owing to small differences in timing between each run. If you could guarantee that the exact same callbacks would fire in the exact same order with the exact same messages between every run, you might be able to get the exact same output between runs. But I don't think you should expect to achieve that with this setup.