Px4-autopilot: Add position lock to resolve quadcopter sinking in offboard mode

Created on 7 Jun 2019  路  16Comments  路  Source: PX4/PX4-Autopilot

Describe the bug
I have noticed that the IRIS quadcopter have tendency to lose altitude in gazebo when pitching or rolling in some direction. The problem have been reported and well discussed
on Slack you can follow using this thread:
https://px4.slack.com/archives/C68J8H32A/p1559816218007600

Log Files and Screenshots
https://logs.px4.io/plot_app?log=97830f7e-5bce-4649-8704-e5d0ffc8ea5b

enhancement multicopter offboard stale

Most helpful comment

I'm shifting towards having reusable logic of the flight tasks in libraries anyways and we can just reuse the position lock from manual position mode which locks the altitude/position when the velocity is constantly zero. The start for this library can be found here: https://github.com/PX4/Firmware/pull/12072/files#diff-cd11905871652d5f1467db1dfc9cecd2R47

All 16 comments

Since (free) Slack deletes all conversation after some time, let me give some more context to this.

This is using velocity offboard control in MAVSDK. The problem is that the drone will try to hold the z velocity but does not correct drift over time.

A possible fix would be to lock the z position if z velocity is set to 0.

I had done something like that a while ago before position control received flight tasks:
https://github.com/PX4/Firmware/pull/5868/commits/642e65cffc5a7199d3847a09bf06814b1f153a90

I'm shifting towards having reusable logic of the flight tasks in libraries anyways and we can just reuse the position lock from manual position mode which locks the altitude/position when the velocity is constantly zero. The start for this library can be found here: https://github.com/PX4/Firmware/pull/12072/files#diff-cd11905871652d5f1467db1dfc9cecd2R47

Nice! Can we have this perform braking? It would be ideal if <0,0,0> velocity setpoints caused the vehicle to brake and then lock into a position hold after coming to a stop.

I am imagining the aggressiveness of the braking could be controlled via a parameter.

Just to add some more details: After monitoring several flights of the quadcopter. I have noticed that sometimes the quadcopter do not just sink, but gain some altitude. For example: a quadcopter might gain up to 5 meters up when it is going forward, and then it starts to sink gradually.

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

Keep open

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

Keep open

@MaEtUgR is this still ongoing?

@Pedro-Roque Yes, it still open.

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

Keep open

@shrit Why would you use attitude setpoints if you want to control the attitude? Why is using velocity setpoints / position setpoints not an option?

@Jaeyoung-Lim I use only velocity setpoints. In this case, I was using the velocity setpoints to set the velocity of quadrotor every 50 milliseconds (In order to simulate the behavior of a joystick for example)

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings