TF_OLD_DATA ignoring data from the past for frame base_link at time X
I know there are different questions with a similar topic, but I am not able to solve this following their advices, and I need to get this solved for my career project.
Here it is my launch file, where I launch the robotstate publisher to publish the tf2 transforms, and the jointstatebroadcaster to broadcast the joints position through the /jointstates topic, needed by the robotstatepublisher:
def generate_launch_description():
simulation_parameters_yaml = os.path.join(
get_package_share_directory('rm3_gazebo'),
'config',
'simulation_parameters.yaml'
)
with open(simulation_parameters_yaml, 'r') as file:
# The FullLoader parameter handles the conversion from YAML
# scalar values to Python the dictionary format
sim_params = yaml.load(file, Loader=yaml.FullLoader)
world_path = PathJoinSubstitution(
[FindPackageShare("rm3_gazebo"), "worlds", sim_params["world"] + ".world"]
)
steering_node = launch_ros.actions.Node(
package='robominer_locomotion_control',
executable='open_loop_steering',
name='open_loop_steering',
output='screen',
parameters=[{'on_robot': False},
{'which_sim': 'gazebo'},
]
)
rm3_gazebo_path = os.path.join(
get_package_share_directory('rm3_gazebo'))
xacro_file = os.path.join(rm3_gazebo_path,
'urdf',
'RM3_robot.xacro.urdf')
doc = xacro.parse(open(xacro_file))
xacro.process_doc(doc)
params = {'robot_description': doc.toxml()}
node_robot_state_publisher = Node(
package='robot_state_publisher',
executable='robot_state_publisher',
output='screen',
parameters=[params]
)
spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py',
arguments=['-topic', 'robot_description',
'-entity', 'RM3',
'-x', '-0.5',
'-y', '0.0',
'-z', '0.32',
],
output='screen')
load_joint_state_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'start',
'joint_state_broadcaster'],
output='screen',
)
load_joint_trajectory_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'start',
'velocity_controller'],
output='screen',
)
return LaunchDescription([
ExecuteProcess(
cmd=['gazebo', '--verbose', '-s', 'libgazebo_ros_factory.so', '-s', 'libgazebo_ros_init.so', world_path],
output='screen'
),
Node(
package='rm3_gazebo',
executable='motor_to_body_vel.py',
name='motor2bodyvel',
output='screen',
),
RegisterEventHandler(
event_handler=OnProcessExit(
target_action=spawn_entity,
on_exit=[load_joint_state_controller],
)
),
RegisterEventHandler(
event_handler=OnProcessExit(
target_action=load_joint_state_controller,
on_exit=[load_joint_trajectory_controller],
)
),
steering_node,
node_robot_state_publisher,
spawn_entity,
])
The problem is that just by launching Rviz2 using ros2 run rviz2 rviz2, although I am able to see my tf2 coordinate frames, I keep getting the warning of the title of this question.
By doing an echo of my /tf topic I am able to see the timestamps of the different transforms, and I realized that those timestamps are given in seconds from 1970, whereas the message I get from Rviz about the base_link frame gives the time in seconds since the moment I launched the simulation:
Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 8.860000 according to authority Authority undetectable
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
at line 332 in /tmp/binarydeb/ros-foxy-tf2-0.13.13/src/buffer_core.cpp
Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 8.910000 according to authority Authority undetectable
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
at line 332 in /tmp/binarydeb/ros-foxy-tf2-0.13.13/src/buffer_core.cpp
Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 8.960000 according to authority Authority undetectable
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
at line 332 in /tmp/binarydeb/ros-foxy-tf2-0.13.13/src/buffer_core.cpp
Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 9.010000 according to authority Authority undetectable
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
at line 332 in /tmp/binarydeb/ros-foxy-tf2-0.13.13/src/buffer_core.cpp
- header:
stamp:
sec: 1657302750
nanosec: 684168915
frame_id: base_link
child_frame_id: chassis
transform:
translation:
x: 0.0
y: 0.0
z: -0.32
rotation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
---
Moreover, If I do a ros2 run tf2ros tf2echo base_link chassis I get the following:
[INFO] [1657302849.850845530] [tf2_echo]: Waiting for transform base_link -> chassis: Invalid frame ID "base_link" passed to canTransform argument target_frame - frame does not exist
Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 2183.010000 according to authority Authority undetectable
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
at line 332 in /tmp/binarydeb/ros-foxy-tf2-0.13.13/src/buffer_core.cpp
Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 2183.060000 according to authority Authority undetectable
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
at line 332 in /tmp/binarydeb/ros-foxy-tf2-0.13.13/src/buffer_core.cpp
But after a while I do receive:
At time 0.0
- Translation: [0.000, 0.000, -0.320]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
I tried both, setting the usesimtime parameter to false and true in Rviz, but I still get the same error...
Thank you for your help, any hint or idea will be appreciated!
Asked by marpeja on 2022-07-08 12:40:37 UTC
Comments