The x,y values move strangely

Hello, I’m a beginner in drones.
I flew the drone and gave the command to the offboard(position).
I’m going to the place I ordered and it moves near the value.
Why does the price keep shaking?
Please help me.

Have you done some tuning to make sure attitude and then position control is working smoothly?

And if so, what sort of offboard control setpoints are you setting? Maybe you can share some code.

I don’t know much about px4
So the PID tuning has not been touched yet.
It keeps moving even when the value is constant, is it a PID tuning problem?

offboard_msg.position = True
offboard_msg.velocity = False
offboard_msg.acceleration = False

I set it to position mode like this.
I’m also using fake gps, optical flow, lidar.

What sort of fake GPS are you using?

You will have to take really small steps.

  1. First tune attitude and make sure controls are solid.
  2. Then make sure position control works well, probably easiest with GPS but you can try with flow too.
  3. Then you’d add in whatever fake GPS you’re using. And carefully test again.
  4. Only then I’d even consider trying offboard control.

If you jump straight to 4, you have way too many uncertainties and if things don’t work perfectly, you have no idea which step along the way is the problem.

Thank you for your advice, my response was late because I was doing 1 and 2.
I flew the drone while doing position control with the controller.
The x,y values are still weird.
Is the sensor the problem?

I don’t know the sort of fake gps, so I’m posting it as a picture. (some code)