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

EKF2 Optical Flow Interface #2779

Merged
merged 86 commits into from Sep 15, 2021

Conversation

pcampolucci
Copy link
Contributor

@pcampolucci pcampolucci commented Sep 11, 2021

This pull request mainly concerns the extension of the EKF2 state estimation capabilities through optical flow input. The branch has been extensively tested and validated successfully. During the development also other modules have been improved. In total, this PR brings improvements on:

  • ins_ekf2 module: new optical flow interface
  • mateksys_3901_l0x: added rotation compensation for height + calibration strategy
  • gps_datalink: used to get fake gps, now gives also fake magnetometer if selected by the user
  • Nederquad: new airframe for quadrotor used at TUDelft

Added wiki on flow sensor: https://wiki.paparazziuav.org/wiki/Module/Mateksys_3901_l0x
Added wiki on ins_ekf2: https://wiki.paparazziuav.org/wiki/Subsystem/ins#ekf2 (to be finished)

Copy link
Member

@gautierhattenberger gautierhattenberger left a comment

Choose a reason for hiding this comment

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

It seems that this branch is not based on the latest master and are changing the references on pprzlink and eigen while it shouldn't be the case.
Please rebase or merge with master first.

conf/modules/ins_ekf2.xml Outdated Show resolved Hide resolved
sw/airborne/subsystems/gps/gps_datalink.c Outdated Show resolved Hide resolved
sw/airborne/subsystems/gps/gps_datalink.c Outdated Show resolved Hide resolved
sw/airborne/subsystems/gps/gps_datalink.c Outdated Show resolved Hide resolved
sw/airborne/subsystems/ins/ins_ekf2.cpp Outdated Show resolved Hide resolved
sw/airborne/subsystems/ins/ins_ekf2.cpp Outdated Show resolved Hide resolved
sw/airborne/subsystems/ins/ins_ekf2.cpp Outdated Show resolved Hide resolved
@pcampolucci
Copy link
Contributor Author

Dear @gautierhattenberger . Thank you a lot for the precious comments, I have implemented all of them but the IMU telemetry update, on which I asked you some more info about.

Regarding the merge, I did the following:

  1. set upstream paparazzi/paparazzi
  2. git fetch upstream
  3. git merge upstream/master

Updates were available and I therefore merged, but that didnt seem to solve the issue.

I tried git rebase on a backup branch but it was cancelling most of my updates.

Any idea on what I might be doing wrong here with submodules? (only pprzlink has been actually modified)

Copy link
Member

@gautierhattenberger gautierhattenberger left a comment

Choose a reason for hiding this comment

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

Sometimes merging submodules is a bit complicated. I only way I know is that you should manually reset each submodules to the correct revision. For example, enter the folder sw/ext/pprzlink, checkout the same revision than in master branch, go back to the root of the project and commit the submodule.

Regarding imu data. The normal way would be to copy the raw data in imu.mag_unscaled then call imu_scale_mag function (see https://github.com/paparazzi/paparazzi/blob/master/sw/airborne/modules/sensors/mag_hmc58xx.c#L110).
In this case, raw data are always scaled, so you can directly copy the datalink mag values to imu.mag_unscaled and imu.mag.

sw/airborne/subsystems/gps/gps_datalink.c Outdated Show resolved Hide resolved
@pcampolucci
Copy link
Contributor Author

@gautierhattenberger everything should be now ok. I made changes in pprzlink for the message of optical flow and the one of INS_EKF2. I am making a pull request on pprzlink now to have that edit merged in master.

@gautierhattenberger
Copy link
Member

gautierhattenberger commented Sep 15, 2021

@pcampolucci I have merged the PR in pprzlink, so you can update the reference here and fix the small comment in px4flow modules. Beside that it looks okay to me.

fixed indentation
@pcampolucci
Copy link
Contributor Author

@gautierhattenberger everything should be now in place. On my machine compiles without warnings, not sure why it doesn't pass the test.

Copy link
Member

@gautierhattenberger gautierhattenberger left a comment

Choose a reason for hiding this comment

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

looks fine, CI build fail is not related

@gautierhattenberger gautierhattenberger merged commit 69c55a0 into paparazzi:master Sep 15, 2021
@pcampolucci pcampolucci deleted the optical_flow_ekf2_PR branch January 14, 2022 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants