-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor position estimation code. Add support for optic flow for position estimation #3350
Conversation
3f903c6
to
6369b94
Compare
Rebased, seems to build correctly. Test pending for next days. |
Based on what I see in the code transition from optic flow in dead-reckoning mode to GPS will result in drastic position change. |
trivia:
|
@stronnag thanks, I mentioned that as well. Needs fixing obviously 😄 |
@stronnag if you are going to test this on existing setups - use caution, @YGlamazdin did a pretty massive change to position estimation code, something might be broken. |
Sole reason for building it. I'll be careful (famous last words). One needs a little drama from time to time. |
A PR that touches almost entire position estimation seems a valid possibility to have some drama. Good luck @stronnag 👍 |
I briefly flew this today (tested would be too grand a claim). A bit like December 2015 revisited, without the cold; working but not unexpected there was a regression against current capability. Generally, it was OK navigating in a straight line at constant altitude; ask to change altitude (and to a lesser degree, direction) and it would deviate significantly from the required course. The test machine is pretty much a throw together from the spares box, not (well / at all) tuned. There are two logs attached, with a link to a video rendition. In each case:
Blackbox logs attached (apologies if not useful resolution due to 2Mb SPI Flash on QVF4 board --- if necessary can be repeated with higher logging rate). Videos are from mwp logs as this provides more context (e.g. WP numbers). Note that due to an error by the mission drafter there are some coincident WPs). Test 1: New PosEst branch:
https://vimeo.com/274549508 Test 2: Mainline (dev) PosEst branch:
https://vimeo.com/274548859 For both flights there was an unstable / gusty 15 kph wind from NE / E. The same settings where applied for each test, in particular, default 1.9+ |
@stronnag thanks for testing. I wouldn't expect it to be bug-free. Now things are finally getting interesting 😄 |
Interesting how the eye deceives; in the field, omg!!!! it's oscillating wildly over a 10m radius; we're doomed for sure, crash is inevitable, take cover. On replay, it's more like 2m (still not so good). |
@stronnag found a really stupid typo in the code. Explains what you've seen - extreme position deviation when changing altitude. |
Excellent, that explains it. I'll try the same crash dummy again, probably on Wednesday. |
I put 20 flights or more on this branch today, PH, RTH, WP, all excellent, at least as good as the extant position estimator, and remarkably good (now) holding course during rapid altitude change. It also flew (autonomously) through a couple of 15 satellites - 0 satellites - 15 satellites dropouts (over 1 possibly 2 seconds) without much excitement, maybe a 2-3m position jump --- I need to review the logs to see exactly what happened. Bottom line: I'm content to fly this pos estimator for navigation modes. It goes on the 'precious tricopter' on Friday; I cannot place more trust in the code. |
Good to know, thanks a lot @stronnag! |
For completeness, I flew this on the 'precious tricopter' and nothing out of the ordinary occurred (which is a sort of complement). |
Thanks @stronnag, I believe this is safe to merge now. |
It seems that in this commit a60e9f6 lots of code has been removed and added new better. position estimate history code is one of them so then gps history has been removed . gps sample rate is at 10Hz , accelerometer sample rate is at 1000Hz. and TASK_GYROPID is running at 1000hz . so are we using same gps reading for calculation ? since gps is at slow rate . how accelerometer sample rate is matching with gps sample rate in estimation calculation . |
Supersedes #3253, requires some cleanup