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

move GPS aggregation and blending to sensors #13584

Closed
wants to merge 2 commits into from

Conversation

dagar
Copy link
Member

@dagar dagar commented Nov 24, 2019

This moves the multi-GPS handling (and optional blending) from the EKF2 frontend (ekf2_main) to the sensors hub module.

The new module within sensors consumes all sensor_gps messages (formerly vehicle_gps_position) from the GPS driver or UAVCAN, etc. Then based on configuration either passes on the first or blends multiple to create a single vehicle_gps_position that the rest of the system consumes.

Although technically in the sensors module, this is a separate work queue item that's scheduled by any sensor_gps publication.

Changes

  • GPS producers now publish sensor_gps
  • all GPS consumers now get the selected primary or blended GPS state vehicle_gps_position
  • Parameter EKF2_GPS_MASK -> SENS_GPS_MASK
  • Parameter EKF2_GPS_TAU -> SENS_GPS_TAU

@@ -1,19 +1,36 @@
# EKF blended position in WGS84 coordinates.
# GPS position in WGS84 coordinates.
Copy link
Member

Choose a reason for hiding this comment

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

Let's fix the things brought up in #6275 now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this would probably be the time.

@dagar
Copy link
Member Author

dagar commented Nov 24, 2019

This should also make it easier to add unit tests for GPS blending.

@dagar dagar force-pushed the pr-sensors__vehicle_gps_position branch from d3328d1 to 3eb0a8d Compare November 24, 2019 18:06
@dagar dagar requested a review from bresch November 26, 2019 14:28
@dagar dagar changed the title [WIP]: move GPS aggregation and blending to sensors move GPS aggregation and blending to sensors Dec 23, 2019
@dagar dagar force-pushed the pr-sensors__vehicle_gps_position branch from 3eb0a8d to a050979 Compare December 23, 2019 16:21
@dagar dagar marked this pull request as ready for review December 23, 2019 16:21
Copy link
Member

@bresch bresch left a comment

Choose a reason for hiding this comment

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

763 less lines in ekf2_main.cpp, I say "YES!".

// clear flag to avoid re-use of the same data
_gps_new_output_data = false;
if (_vehicle_gps_position_sub.copy(&gps)) {
gps_message gps_msg{};
Copy link
Member

Choose a reason for hiding this comment

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

I would still like to use a function such as fillGpsMsgWithVehicleGpsPosData (that you forgot to remove) to reduce the amount of code in this massive function.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I need to take another look. I believe this PR predates that ekf2 refactor.

@dakejahl
Copy link
Contributor

Continued in
#14447

@dakejahl dakejahl closed this Mar 21, 2020
@julianoes julianoes deleted the pr-sensors__vehicle_gps_position branch March 26, 2020 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants