-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
AP_ExternalAHRS: Actualize handler and simulator of the Inertial Labs EAHRS #27850
Conversation
Hello guys, we also tested this changes in the real flight. |
CHECK_SIZE(u.gnss_time_ms); | ||
nav_ins_data.ms_tow = u.gnss_time_ms; |
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.
I mean, yes, this is a correct change.
But it also occludes the history of the file content.
Do we really need this change?
I'll take note to try to stop this creeping in in the future....
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.
Sorry, you mean this shift about switch-case or something else?
I returned it back to avoid this big diff
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.
Sorry, you mean this shift about switch-case or something else? I returned it back to avoid this big diff
Yes, minimising the diff is important. It makes review much faster, and if a PR needs reviewing multiple times it can be very frustrating.
In this case you appear to have changed 'gps' to 'gnss' - and while I understand that's a correct change, it's also unnecessary as the two are often used interchangably.
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.
Oh, now I understood, sorry. I renamed this because other structures related to GNSS were added to the processor and to the simulator.
And in order to keep all the names consistent with the documentation, I decided to use GNSS everywhere. To make it easier to find in documentation in the future.
Given this moment, will it better to rename all gnss (including new variables and structures) to gps?
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.
Please remove the renames from gps to gnss. New stuff in this PR can use gnss, for now we treat them synonymously in ArduPilot.
This and the whitespace change significantly reduced my enthusiasm to review this PR!
If you want to come back and do a separate PR just to rename things in this new driver for consistency, I think I'd merge it. The code in here is very young, and such a change is provably correct by ensuring compiler output is identical before/after.
Don't bother reverting the simulator changes - I'm happy enough merging those.
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.
Done, I removed all renaming changes
This PR is actually looking pretty good. I'm really just arguing about the shape of the patches, not the additions and fixes you're making! |
bc69c5c
to
47eb259
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.
Commit with whitespace changes was removed
Should I resolve conversations after fixing or conversation starter will make it if it's done?
47ceea2
to
680b727
Compare
Thanks.
We don't have a solid attitude on this. I like to resolve the conversations that I've started, but I've seen plenty of people close them as they're done. |
@@ -129,6 +129,7 @@ class AP_ExternalAHRS { | |||
uint8_t instance; | |||
float pressure_pa; | |||
float temperature; | |||
float altitude; |
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.
What frame is this in? Above geoid? AMSL?
Comment if nothing else
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.
Done, I added a comment
CHECK_SIZE(u.gnss_time_ms); | ||
nav_ins_data.ms_tow = u.gnss_time_ms; |
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.
Please remove the renames from gps to gnss. New stuff in this PR can use gnss, for now we treat them synonymously in ArduPilot.
This and the whitespace change significantly reduced my enthusiasm to review this PR!
If you want to come back and do a separate PR just to rename things in this new driver for consistency, I think I'd merge it. The code in here is very young, and such a change is provably correct by ensuring compiler output is identical before/after.
Don't bother reverting the simulator changes - I'm happy enough merging those.
case MessageType::GNSS_ANGLES: { | ||
CHECK_SIZE(u.gnss_angles); | ||
gnss_data.heading = u.gnss_angles.heading*0.01; // deg | ||
gnss_data.pitch = u.gnss_angles.pitch*0.01; // deg |
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.
pitch
in gnss_data
?!
I think there might be a reason it was generically called state2
?
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.
Done, I removed all renaming changes |
417d048
to
0f38a42
Compare
That's a lot of extra bytes. That's not necessarily a show-stopper, but for reference that's about 20% of the remaining flash space on our most popular board's bdshot build. |
The comments appear to have been corrected. |
I've marked it for discussion at our DevCall meeting this-evening. |
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.
i think we should move this to custom build server only
@@ -129,6 +129,7 @@ class AP_ExternalAHRS { | |||
uint8_t instance; | |||
float pressure_pa; | |||
float temperature; | |||
float altitude; // m, above geoid |
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.
barometers don't measure altitude, they measure pressure
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.
I removed this changes
baro_data.pressure_pa = u.baro_data.pressure_pa2*2; | ||
baro_data.pressure_pa = u.baro_data.pressure_pa2*2; // Pa | ||
state2.baro_alt = u.baro_data.baro_alt*0.01; // m | ||
baro_data.altitude = state2.baro_alt; // m |
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 remove this
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.
Done, I removed this changes
We have an intent to make all ExternalAHRS drivers not built into ArduPilot by default in ArduPilot 4.7. That would require users to use custom.ardupilot.org to include any ExternalAHRS driver. |
We can merge this once the API change to the EXternalAHRS library has been removed |
Merged, thanks! |
Thanks for revirew! |
Fix bugs and add the new data handling