Unexpected imprecise attitude in SITL

Hello there,

I am running into a peculiar behavior with a copter in SITL.

The setup looks like this:

Docker container rosmachine:

  • Ubuntu 24
  • Gazebo Harmonic
  • Creates world and spawns drone (copy of x500 example drone)

Docker container PX4:

  • Ubuntu 22
  • Gazebo Harmonic
  • Runs PX4 SITL

The containers are connected via host.

I start everything up, and it behaves as expected like the x500 example. However, when I try flying a simple pattern, planned with QGC, the copter cannot follow a basic trajectory. The estimated position is even jumping in QGC at random, sometimes up approx. 50m.

Even when hovering, the copter experiences extreme drifts, which is very unusual for a simulation without wind or any special environment factors.

I checked if it’s a timing issue, but when I inspect MAVLink, the time_boot_ms matches the iterations in Gazebo.

I assume either the GPS or the EKF might be the issue, but I have no clear idea of what it could be.

Startup looks good to me, except for the negative notify info, which is concerning.

Screenshot from 2024-09-11 16-00-46

When the copter lands the position is updated correctly again.

Screenshot from 2024-09-11 16-08-36

What I don’t understand is why is the Groundtruth so weird and what does it express?

another thing what brought me to the time issue thought was this:

But since it looks the same if I run an x500 example and plan a similar pattern, I assume this isn’t an issue.

I start px4 with:
PX4_GZ_STANDALONE=1 PX4_SYS_AUTOSTART=4001 PX4_GZ_WORLD=flat_lands PX4_GZ_MODEL_NAME=drone ./build/px4_sitl_default/bin/px4

Does anyone have any tips on how to fix this or where to look for the mistake? I would appreciate any help or hints.

Let me know if any other data would be helpful

cheers

Ok, figured it out…

It seems it’s not a good idea to have old plugins from Ignition in a Gazebo Harmonic world — seems obvious I know
If anybody experiences the same or similar issues with jumping GPS signals or general inconsistencies in a copter’s ability to follow a trajectory, make sure your plugins and Gazebo versions are from the same version.

Cheers