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

[Bug] Time jump detected. Resetting time synchronizer #22522

Closed
frede791 opened this issue Dec 12, 2023 · 3 comments
Closed

[Bug] Time jump detected. Resetting time synchronizer #22522

frede791 opened this issue Dec 12, 2023 · 3 comments

Comments

@frede791
Copy link
Contributor

Describe the bug

When running gazebo simulation with uxrce_dds_client enabled, the following error appears: ERROR [timesync] Time jump detected. Resetting time synchroniser.

To Reproduce

On current main branch (commit: ece60b6) run:
make px4_sitl gz_x500
In a separate terminal start the uxrce_dds_client with: MicroXRCEAgent udp4 -p 8888
After a couple of seconds, the error will appear in the command line

Expected behavior

No error should appear at all. While it doesn't break simulation, it is still unsightly.

Screenshot / Media

image

Flight Log

NA

Software Version

Current PX4 main branch.

Flight controller

It's in simulation.

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

Reference previously by @PerFrivik and supposedly fixed in PR #22463. The belief is that the bug originated from this PR.

@PerFrivik
Copy link
Contributor

PerFrivik commented Dec 12, 2023

I also still have the bug, tested on the newest main state.

Also it is not only exclusive to make px4_sitl gz_x500, any SITL I believe has this issue.

@beniaminopozzan
Copy link
Member

I experienced this issue with gazebo simulation running close but not close enougth to real time factor 1.
PX4 takes the clock from Gazebo, XRCE-DDS agent uses the wall clock. Therefore agent and client runs with two different time paces and the synchronizer resets when the accumulated drift gets too large.

You should stop the time synchronizer of XRCE-DDS and bind ROS2 to the Gazebo clock too
https://docs.px4.io/main/en/ros/ros2_comm.html#ros-gazebo-and-px4-time-synchronization

you can verify this worsening the gazebo real time factor, you should see the ERROR [timesync] Time jump detected. Resetting time synchroniser appear more frequently

@DronecodeBot
Copy link

This issue has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/microdds-agent-causing-weird-behavior-gazebo/41719/2

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

No branches or pull requests

4 participants