Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robot_Localization_Demo: problem with rviz2 and ekf_node Warning: TF_OLD_DATA ignoring data from the past #64

Open
wongearth opened this issue Nov 18, 2022 · 6 comments

Comments

@wongearth
Copy link

I am trying to follow the sam_bot tutorial but got stuck at the robot_localization demo using ekf_node. Below is the error/warning when running

ros2 launch sam_bot_description display.launch.py

By running "ros2 run tf2_ros tf2_echo odom base_link", similar errors/warning occured. In rviz the odom franme seems to drift. I reinstalled ros2, navigation2 both binary and build from source...no luck. Anyone know what the problem is?... Thanks

[rviz2-6] Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[rviz2-6] at line 292 in /home/xxx/ros2_humble/src/ros2/geometry2/tf2/src/buffer_core.cpp
[ekf_node-5] Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_l_link at time 755.451000 according to authority Authority undetectable
[ekf_node-5] Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[ekf_node-5] at line 292 in /home/xxx/ros2_humble/src/ros2/geometry2/tf2/src/buffer_core.cpp
[rviz2-6] Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_l_link at time 755.451000 according to authority Authority undetectable
[rviz2-6] Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[rviz2-6] at line 292 in /home/xxx/ros2_humble/src/ros2/geometry2/tf2/src/buffer_core.cpp
[ekf_node-5] Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_r_link at time 755.461000 according to authority Authority undetectable
[ekf_node-5] Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[ekf_node-5] at line 292 in /home/xxx/ros2_humble/src/ros2/geometry2/tf2/src/buffer_core.cpp
[rviz2-6] Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_r_link at time 755.461000 according to authority Authority undetectable

@Sraobot
Copy link

Sraobot commented Nov 18, 2022

I am also getting this warning in "Adding Gazebo Plugins to a URDF" tutorial from Setting Up Odometry.

@Wellington-Noberto
Copy link

Wellington-Noberto commented Mar 15, 2023

Could you check if any Node definition ends with a comma?
Especially the 'joint_state_publisher'

If you forgot the comma this could lead to an error in the joint state publisher node

For instance

`
joint_state_publisher_node = Node(

    package='joint_state_publisher',

    executable='joint_state_publisher',

    name='joint_state_publisher',

    condition=UnlessCondition(LaunchConfiguration('gui')),
)

`

@TanJunKiat
Copy link

The issue is the the joint_state_publisher is not publishing in sim_time

I managed to resolve this issue with the following code:

joint_state_publisher_node = launch_ros.actions.Node(
        package='joint_state_publisher',
        executable='joint_state_publisher',
        name='joint_state_publisher',
        parameters=[{'use_sim_time': LaunchConfiguration('use_sim_time')}],
    )

which adds the use_sim_time parameter to the joint_state_publisher node.

@Jason-Lee0
Copy link

@TanJunKiat Sorry to bother you. I updated the command (use_sim_time) in Joint_state_publisher_node , but it still showed the same warning log .

Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_l_link at time 419.418000 according to authority Authority undetectable

Is there any other way to avoid this ?
Thanks for your help.

Have a nice day!!

@TanJunKiat
Copy link

TanJunKiat commented Sep 15, 2023

@Jason-Lee0 Hello Jason.

Have you tried checking your SDF?

<gazebo>
  <plugin name='diff_drive' filename='libgazebo_ros_diff_drive.so'>
    <ros>
      <namespace>/demo</namespace>
    </ros>
    <!-- Update rate in Hz -->
    <update_rate>60</update_rate>
    
    <!-- input -->
    <command_topic>cmd_vel</command_topic>

    <!-- wheels -->
    <left_joint>drivewhl_l_joint</left_joint>
    <right_joint>drivewhl_r_joint</right_joint>

    <!-- kinematics -->
    <wheel_separation>0.4</wheel_separation>
    <wheel_diameter>0.2</wheel_diameter>

    <!-- limits -->
    <max_wheel_torque>40</max_wheel_torque>
    <max_wheel_acceleration>2.0</max_wheel_acceleration>

    <!-- output -->
    <publish_odom>true</publish_odom>
    <publish_odom_tf>true</publish_odom_tf>
    <publish_wheel_tf>true</publish_wheel_tf>

    <odometry_topic>odom</odometry_topic>
    <odometry_frame>odom</odometry_frame>
    <robot_base_frame>base_link</robot_base_frame>
  </plugin>
</gazebo>

It may be the lack of definition of the tf for the wheels.

@Charifou
Copy link

Charifou commented Feb 20, 2024

I confirm that you should add 'use_sim_time': True to all your nodes inside your launch file and its included launch files using:

parameters=[{'use_sim_time': True}, config_ekf_yaml].

Here it comes from ekf_node and rviz2.
If you have nodes which share a yaml file you can directly add 'use_sim_time' in the parameters list and use /** instead of node names.

/**:
ros__parameters:
use_sim_time : True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants