Runtime error using ekf_localization ros2
Hello everyone,
I'm looking for help on configurating the ekf_localization node from robot_localization package.
I made localization.yaml with the data that robot_localization is asking for.
ekf_filter_node:
ros__parameters:
use_control: true
control_config: [true, false, false,
false, false, true]
acceleration_limits: [1.4, 0.0, 0.0,
0.0, 0.0, 1.4]
acceleration_gains: [1.0, 0.0, 0.0,
0.0, 0.0, 1.0]
frequency: 50.0
two_d_mode: true
publish_tf: false
odom_frame: odom # Defaults to "odom" if unspecified
base_link_frame: base_link # Defaults to "base_link" if unspecified
world_frame: odom # Defaults to the value of odom_frame if unspecified
twist0: /stub/noisy_odom
twist0_config: [false, false, false,
false, false, false,
true, false, false,
false, false, true,
false, false, false]
twist0_differential: false
process_noise_covariance: [*covariance table*]
initial_estimate_covariance: [*covariance table*]
As asked i send some twistWithCovarianceStamped message formated as follow:
---
header:
stamp:
sec: 1583936818
nanosec: 3618035857
frame_id: base_link
twist:
twist:
linear:
x: 0.4805634756224154
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.4047970894918236
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
But with all my effort i got an error but with some random in execution for example some time i got no answer from robot_localization (instant error) but some other time i got 1 or multiple answer and then get this error.
[ekf_node-4] terminate called after throwing an instance of 'std::runtime_error'
[ekf_node-4] what(): can't subtract times with different time sources
[ERROR] [ekf_node-4]: process has died [pid 3999, exit code -6, cmd '/XXX/robot_localization/lib/robot_localization/ekf_node __params:=/XXX/install/data_fusion/share/data_fusion/config/localization.yaml'].
Working on ubuntu 18.04 LTS with ros2 dashing