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
Use vel.xy().length()
instead of norm(vel.x,vel.y)
#18647
Changes from all commits
80ce6fe
1c6ddb3
f87faa6
787c0d8
76ae039
e0da062
a029e19
430f206
9f02c73
07bf9a4
0ec5c13
2c869b4
08d52b2
d4e5767
6e75841
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1427,7 +1427,7 @@ void NavEKF3_core::alignMagStateDeclination() | |
|
||
// rotate the NE values so that the declination matches the published value | ||
Vector3F initMagNED = stateStruct.earth_magfield; | ||
ftype magLengthNE = norm(initMagNED.x,initMagNED.y); | ||
ftype magLengthNE = initMagNED.xy().length(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess there's no difference between norm and length() even for ftype? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will plead a little ignorance here. I was surprised by the savings. From what I can see in debugger and via inspection, T length(void) calls ftype norm(void) each function of so there is output type narrowing that is possible if the inputs are floats and ftype -> is double? |
||
stateStruct.earth_magfield.x = magLengthNE * cosF(magDecAng); | ||
stateStruct.earth_magfield.y = magLengthNE * sinF(magDecAng); | ||
|
||
|
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.
Unrelated change. But a good one anyway.