Another explanation for the error. `[INFO] [1647531775.937463391] [rviz]: Message Filter dropping message: frame 'camera_bot_base_link' at time 2936.389 for a reason 'the time stamp on the message is earlier than all the data in the transform cache.'

I think I can give another explanation for the error:
`[INFO] [1647531775.937463391] [rviz]: Message Filter dropping message: frame ‘camera_bot_base_link’ at time 2936.389 for a reason ‘the time stamp on the message is earlier than all the data in the transform cache.’

If I am wrong, please correct me.

We can print the current time and the time stamp of the odometry with the following code.

def _callback_cam_bot_odom(self, msg: Odometry):
    self.cam_bot_odom = msg
    self.get_logger().info(
       f"Current time is: {self.get_clock().now().to_msg()}.")
    self.get_logger().info(
       f"Time stamp in odometry is: {self.cam_bot_odom.header.stamp}.")

As shown in the above figure, the current time is T1 =1659319692; however, the time stamp of the odometry T2 is 2930.

Time T1 is so big because a lot of time has passed from the beginning of the time to this moment. I have heard a lot of stories about the beginning of the time. Some stories consider it the birthday of a great god that leads humans to reason and light (If I’m wrong, please forgive my ignorance). In a country with a high percentage of atheists, the beginning of the time is the birthday of a great leader and scientist. In another story, it may be a provision of international treaties.

Which story of the beginning of the time is used in ROS2?

Time T2 is so small because its time is counted from the beginning of the simulation. The Gazebo told all the nodes involved in the simulation should use this time.

Directly comparing T1 and T2 without transformation will be wrong because the beginning of time is different. If we consider T1 and T2 are time stamps of two pieces of the message, T1 is very young; however, T2 is too old.

When we chose the frame World as the fixed frame on the rviz2, the rviz2 starts to calculate where the frame rgb_camera_link_frame is. It calculates camera_bot_base_link, then chassis, then rgb_camera_link_frame.

It finds we have given the information between the Frame World and the Frame camera_bot_base_link through TransformStamped(), which is quite new with stamp T1. However, the calculation cannot go through because the information about camera_bot_base_link and chassis is too old with stamp T2. The chassis may be long gone. The information in the TF cache, which takes time stamp T2, comes too early and becomes too old. So here comes the error.

Hi @bluebird, I think everything you said makes sense. This usually is controlled by the variable use_sim_time in a lot of launch files.

Are you only launching a simulation and visualizing the data in rviz?

What is publishing the frame camera_bot_base_link, and what time is it using?

And finally, do you get any messages from camera_bot_base_link? i.e. an image or something? or none at all? sometimes when I have to move fast, I note that get those messages dropped but since it is still publishing the topic I want, I don’t pay much attention to it unless it is preventing me from advancing.

This is not what I am discussing.
The error is used as a guide to lecture tf2_monitor. However, the high delay measured by tf2_monitor is not because the transform is static. It is because the beginning of time is different.
If I am right, it may mislead the student.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.