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

Runtime error using ekf_localization ros2

asked 2020-03-11 10:19:47 -0500

akrbdx gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-03-11 11:00:54 -0500

Try setting sim time in the config file. When in simulation, all nodes must be running on the same clock.

edit flag offensive delete link more

Comments

Actually I'm using a launch file and I set up parameters=[{"use_sim_time": True}] inside (for all nodes) but the same error occurs. I'm working with gazebo (maybe it's something different to do)

-- EDIT --

Using parameters works it was some other problems

Thanks for the answer !

akrbdx gravatar image akrbdx  ( 2020-03-12 04:24:52 -0500 )edit

@gvdhoorn can you move my answer to answers so it can be marked accepted? I expected more followup ;-)

stevemacenski gravatar image stevemacenski  ( 2020-03-12 14:12:35 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-03-11 10:19:47 -0500

Seen: 354 times

Last updated: Mar 11 '20