PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.4k stars 13.46k forks source link

Flight Speed control doesn't always work #13671

Open mwiatt opened 4 years ago

mwiatt commented 4 years ago

Describe the bug When a "Flight Speed" is attached to a waypoint in QGC, the speed is not always used. This behavior is intermittent but happens more often than not.

image

To Reproduce This behavior is intermittent.

Steps to reproduce the behavior:

Expected behavior New speed is used.

Log Files and Screenshots

Drone (please complete the following information):

Additional context This feels very similar to this bug https://github.com/PX4/Firmware/issues/13474 In fact, I had an ROI waypoint in the plan and speed control and both were sometimes ignored. If one worked, the other seemed to usually work. If the ROI failed, the speed control would typically fail also. It seems like the messages from the piece of the firmware that processes the mission items are often ignored.

mwiatt commented 4 years ago

Below is a log from a flight a few minutes earlier than the one above.

https://logs.px4.io/plot_app?log=a8662dfc-e6f1-453a-9c9d-8ca576b93340

This uses the same exact plan file. You can see that the 3 m/s speed is obeyed this time (half way through the log file, look at X velocity).

image

From the previous flight where the 3 m/s was ignored:

image

stale[bot] commented 4 years ago

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

bresch commented 4 years ago

@julianoes IIRC you are testing different velocities in the MAVSDK test. Have you spotted this issue as well?

julianoes commented 4 years ago

@bresch yes there are tests for that, and I think they are passing.

https://github.com/mavlink/MAVSDK/blob/4d8d4b3836a2bc46c01b89bfd523306ef7c851a7/src/integration_tests/mission_change_speed.cpp#L62-L64

dayjaby commented 4 years ago

Probably the same cause as https://github.com/PX4/Firmware/issues/13474, where the navigator_main is not able to handle too many vehicle_commands at once on real hardware.

In the above logfile, the command is surrounded by other commands:

... lots of other gimbal commands
346654899,0.0,0.0,2.0,0.0,0.0,0.0,0.0,204,1,154,0,0,0,0
346654909,0.0,0.0,-0.0,0.0,-0.0,0.0,2.0,205,1,154,0,0,0,0
346661539,34.23981475830078,-119.05514526367188,0.0,0.0,0.0,0.0,69.73837,195,1,1,1,1,0,0
346678523,0.0,0.0,2.0,0.0,0.0,0.0,0.0,204,1,154,0,0,0,0
346678927,0.0,0.0,-0.0,0.0,-0.0,0.0,2.0,205,1,154,0,0,0,0
... lots of other gimbal commands

so the navigator_main.cpp has only a very short timeframe to read this particular command, making it very likely that the command got overwritten in the meantime.

stale[bot] commented 4 years ago

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