-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
EKF2 split output predictor and publish attitude immediately #9832
Conversation
@bkueng @RomanBapst Would be great if you could review & quickly flight-test. |
This lowers EKF2 cpu usage as well as other modules like position controllers driven by position publications. |
5250b07
to
bf58ed4
Compare
src/modules/ekf2/ekf2_main.cpp
Outdated
_ekf.get_control_mode(&control_status.value); | ||
|
||
// only publish position after successful alignment | ||
if (control_status.flags.tilt_align && control_status.flags.yaw_align) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should only be gated on tilt align. yaw alignment can momentarily go false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I'll change it. Currently it's both in master. https://github.com/PX4/ecl/blob/b26c2d62b80d6bee148fbfe01eb36809bfa721ea/EKF/ekf.cpp#L134
Replay testing is showing PX4/PX4-ECL#471 giving larger logged output observer tracking errors than ecl master so I will investigate further. |
@dagar has fixed the difference so it should now be good to flight test provided we use PX4/PX4-ECL#471 at commit aaff047e5852761f8d15bc695c7a1ca70beeeeb1 |
@priseborough @dagar px4/ecl commit aaff047e5852761f8d15bc695c7a1ca70beeeeb1 hasn't been merged yet, do we need to wait for that commit to be merged or can we test this pull request as it is right now? we use to download the firmware from Jenkins artifacts. |
Yes in this case it's okay to use the artifacts directly from Jenkins, but it was a good thing to check when other submodules are involved. |
0356846
to
3080af6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review complete.
Awaiting flight test
a few flights on a pixracer (V4) full auto from take-off to landing stable flights; didn't run into any issues |
For reference here's a close comparison from master (same vehicle, same flightplan, same day). |
Wow! |
Few flights with pixhawk 4 (V5). Good flights, no issues. few flights with pixhawk 2.1 (v3). Good flights, no issues. |
test flight = pixhawk mini good flight pixhawk pro v4 good flight pixhack v5 great flight |
* EKF2 split output predictor and publish attitude immediately * ecl: incorporate magic number tidy up
Requires PX4/PX4-ECL#471
The EKF is updated to run the output predictor immediately after receiving new IMU data. Then PX4 side we publish vehicle_attitude immediately, and only publish positions at the EKF predication rate (every 8 milliseconds).