Copter EKF altitude estimation error due to heavy uart communication load

No, we do allow log writes in other threads. It’s just the startup
messagewriters we don’t allow to be run from other threads.

It might be that we need to add some time constraints in around the log
message writers. Each of the while() loops in each of the ::process
methods would need a check to see if we’re out of time for writing more
messages.

I think a bit of profiling might be a good idea first; we also open the
file in the main thread - that could also be causing the issue.

1 Like

I think a bit of profiling might be a good idea first; we also open the
file in the main thread - that could also be causing the issue.

Thank you for pointing me in the right direction. I will try to do it

Hi @James_Megariotis
I have a possible solution https://github.com/ArduPilot/ardupilot/pull/14030
It works well in my flight tests. Would you be able to test it? Thank you very much

3 Likes

@chobitsfan Awesome! I just saw this. I have been very busy lately but I am very happy to see that this issue has not been forgotten. I will pull this change into my code asap and test it over the next few days. Hopefully your work will solve this issue because this seemingly insignificant issue has caused me lots of trouble.

Thanks and I will let you know how it goes.

@chobitsfan Didn’t need long to determine that it works! Awesome job. No more altitude errors on arming! Thank you very much for your efforts. This has been incredibly helpful and much appreciated.

2 Likes

Hi @James_Megariotis Thank you for helping testing.

I have had trouble in Rover for some time where the first arming after boot fails due to excess main loop time. I have coded around this by extending the maximum delay within a set time after boot but I suspect that the root cause is the same as discussed here. I will test this tomorrow - thanks @chobitsfan!