Skip to content
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

Add EKF3 feature for optflow fusion #22895

Merged

Conversation

peterbarker
Copy link
Contributor

@peterbarker peterbarker commented Feb 10, 2023

This should automatically remove the EKF3 Optical fusion code based on the presence of OpticalFlow sensors.

The builds looks like this:

Board              AP_Periph  blimp   bootloader  copter  heli    iofirmware  plane   rover   sub
Durandal                      *       *           *       *                   *       *       *
Hitec-Airspeed     0                                                                          
KakuteH7-bdshot               *       *           *       *                   *       *       *
MatekF405                     -10392  *           -10384  -10392              -10384  -10336  -10392
Pixhawk1-1M                   *       *           *       *                   *       *       *
f103-QiotekPeriph  *                                                                          
f303-Universal     0                                                                          
iomcu                                                             *                           
revo-mini                     *       *           *       *                   *       *       *
skyviper-v2450                                    -10400                                      

I believe that means we should test-fly this on a board OpticalFlow is not included on - on a vehicle with a rangefinder attached (RangeFinder and OpticalFlow are intertwined a little in EKF3). Should test with everybody's least favorite height source.

Copy link
Contributor

@khancyr khancyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one.
The issue on CI is right, you need to add this to AP_DAL too as this using some EKF functions!

@peterbarker peterbarker force-pushed the pr/EK3_FEATURE_OPTFLOW_FUSION branch from 3527893 to 71d6bd5 Compare February 10, 2023 23:33
@peterbarker
Copy link
Contributor Author

nice one. The issue on CI is right, you need to add this to AP_DAL too as this using some EKF functions!

Thanks, I've pushed a patch for the DAL up.

Interestingly I couldn't run the CI test which failed locally - even on master (./Tools/scripts/build_ci.sh MatekF405-Wing)

@khancyr khancyr added the EKF label Feb 17, 2023
Copy link
Contributor

@khancyr khancyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for me. doesn't change behavoir.

@peterbarker peterbarker force-pushed the pr/EK3_FEATURE_OPTFLOW_FUSION branch 2 times, most recently from dd90c88 to 3b2cb9b Compare May 9, 2023 02:55
@rmackay9
Copy link
Contributor

rmackay9 commented May 9, 2023

From a casual review this looks good to me.

@peterbarker
Copy link
Contributor Author

I've built all branches and it all seems correct - boards without optflow save a bunch of bytes.

@peterbarker
Copy link
Contributor Author

I've flown this on a SkyViper without incident

@@ -73,7 +74,7 @@ void AP_DAL::start_frame(AP_DAL::FrameType frametype)
_RFRN.ahrs_airspeed_sensor_enabled = ahrs.airspeed_sensor_enabled(ahrs.get_active_airspeed_index());
_RFRN.available_memory = hal.util->available_memory();
_RFRN.ahrs_trim = ahrs.get_trim();
#if AP_OPTICALFLOW_ENABLED
#if EK3_FEATURE_OPTFLOW_FUSION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would break flow on EKF2 or other estimators

@peterbarker peterbarker force-pushed the pr/EK3_FEATURE_OPTFLOW_FUSION branch 4 times, most recently from 93ea2c8 to 29fae25 Compare September 1, 2024 00:05
recent additions of CAN things to hwdef, and the lack of a hardware / lower-level dependency means we need to use something with CAN for now
otherwise someone can explicity ebable it but not have a blended instance ID
@peterbarker peterbarker force-pushed the pr/EK3_FEATURE_OPTFLOW_FUSION branch from 29fae25 to 67d029f Compare September 1, 2024 03:40
@peterbarker
Copy link
Contributor Author

I've run this through the test-features build and fixed unrelated bugs in this PR now

@peterbarker peterbarker merged commit a0c5729 into ArduPilot:master Sep 2, 2024
93 checks passed
@peterbarker peterbarker deleted the pr/EK3_FEATURE_OPTFLOW_FUSION branch September 2, 2024 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

5 participants