-
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
Multi-EKF support #14650
Multi-EKF support #14650
Conversation
Awesome! I like the proposed architecture very much. Some thoughts on the architecture: Regarding ORB instances, would not it be sufficient to add the ability to "--force" an instance number at the publish site? |
That's worth thinking about. I didn't get into it above, but
I'd like to explore that, and it's actually what I was trying to get at here #14379 (comment). Instead of independent downsampling (hard coded filter update period) within each ecl/EKF backend we could simply update it with every new IMU. Configuring the IMU integration would be configuring the corresponding filter update period. We could update the attitude separately from buffered IMU (pre-integration).
The (potential) issue is something else coming in earlier and claiming that instance first. We can be careful to avoid that in practice, but I'd rather the potential hole didn't exist. Each ekf2 instance has up to 15 different publications. It would be a nice simplification if we can trivially map a particular message instance back to each estimator rather than every single message carrying metadata. I think this could be a good excuse to add a bit of hierarchy to uORB, but that alone might be a rabbit hole. |
Super nice to see this! |
2c0b564
to
4ea93d5
Compare
The (potential) orb instance ordering issue has been resolved. With some uORB::Publication changes now in master at Ekf2 construction we advertise all topics at once. |
5a2742e
to
20f7d06
Compare
When performing EKF selection, how do we plan to solve the state jump? |
The selector handles the jump and we already have the reset mechanisms in place (messages and controllers). This is also used to pass through any actual resets from the active instance. |
We've hit the fmu-v2 flash limit again. EDIT: #15994 should give us enough. |
Real test logs thanks to @mcsauder. https://review.px4.io/plot_app?log=f21e4e44-8d77-4758-b2db-091669e7bf71 In the second log you can see an estimator switch midflight with a large uncommanded change in yaw setpoint. I don't see a problem with the logic in the estimator selector (the delta isn't wrong), I suspect this is a problem with the existing reset logic in the muticopter attitude controller (mc_att_control) and stabilized mode. |
I've fixed the delta_q_reset in the EKF2 selector. e336dae |
- add lockstep progress in HIL_SENSOR handling
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.
This is off by default so safe to merge. Items to look at post merge include:
MAVSDK needs to be updated to support the failure of a single sensor instance and auto tests updated.
EKF replay with multiple instances if possible. Single instance appears to work.
Thanks Paul. Next steps from my perspective.
|
TODO:
|
WORK IN PROGRESS
Multi-EKF will be a focus of the v1.12 release cycle. I’m opening this early so we can begin to identify and address the architectural changes that will need to be in place to make this viable.
Multi-EKF Background/Motivation
WIP
Currently in PX4 most commonly supported boards have 2 or 3 IMUs that are typically different models, sometimes with wildly different output data rates, and often on the same bus, or with no synchronization mechanism. As a result our sensor hub module isn't able to effectively compare raw sensor data and "vote", so it simply selects a highest priority sensor based on a simple set of fault metrics (timeouts, stale data, etc) and passes that on to the estimator. This allows the system to continue operating if a sensor is completely lost (a hard fault), but this is actually quite rare in operation. In reality most problems encountered in typical usage are soft faults that impact navigation like high vibration (aliasing, clipping) or erratic sensor problems that still produce output.
To effectively utilize the current suite of heterogeneous IMUs to mitigate the most common real world pain points I'm proposing moving to an architecture of running (at least) one estimator per IMU.
-
estimator_attitude
(vehicle_attitude)-
estimator_local_position
(vehicle_local_position)-
estimator_global_position
(vehicle_global_position)ekf2_selector
module consumes all estimator_* messages, selects a primary (latching), and republishes vehicle_attitude, vehicle_local_position, vehicle_global_positionekf2_selector
handles resets and deltas when switching between estimator instancesSENS_IMU_MODE
to configure IMU outputTODO:
EKF2_*
parametersestimator_status0 -> estimator/0/status
Future