-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: apply astyle formatting and enforce #23369
Conversation
src/modules/ekf2/EKF/common.h
Outdated
bool vision_data_stopped : 1; ///< 9 - true when the vision system data has stopped for a significant time period | ||
bool emergency_yaw_reset_mag_stopped : 1; ///< 10 - true when the filter has detected bad magnetometer data, has reset the yaw to anothter source of data and has stopped further use of the magnetometer data | ||
bool emergency_yaw_reset_gps_yaw_stopped: 1; ///< 11 - true when the filter has detected bad GNSS yaw data, has reset the yaw to anothter source of data and has stopped further use of the GNSS yaw data | ||
bool gps_data_stopped_using_alternate : |
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.
Some of these warning flags aren't even being used, and most of the rest we can figure out from other sources.
Rather than cleaning this up I propose we get rid of these, it saves about 500 bytes of flash in message field strings.
1187150
to
1f6d69d
Compare
@@ -85,7 +87,8 @@ bool Ekf::fuseMag(const Vector3f &mag, const float R_MAG, VectorState &H, estima | |||
sym::ComputeMagZInnovVarAndH(state_vector, P, R_MAG, FLT_EPSILON, &aid_src.innovation_variance[index], &H); | |||
|
|||
// recalculate innovation using the updated state | |||
aid_src.innovation[index] = _state.quat_nominal.rotateVectorInverse(_state.mag_I)(index) + _state.mag_B(index) - mag(index); | |||
aid_src.innovation[index] = _state.quat_nominal.rotateVectorInverse(_state.mag_I)(index) + _state.mag_B(index) - mag( | |||
index); |
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.
that's a strange way to break a long line...
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.
Yes, I was going to do some manual adjusting as a follow up, splitting these long lines with readability in mind.
@@ -281,7 +289,7 @@ struct parameters { | |||
float initial_tilt_err{0.1f}; ///< 1-sigma tilt error after initial alignment using gravity vector (rad) | |||
|
|||
#if defined(CONFIG_EKF2_BAROMETER) | |||
int32_t baro_ctrl{1}; | |||
int32_t baro_ctrl {1}; |
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.
why do we need a space here and not on the other variables?
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 don't think we do, but at the moment it's a compromise to let astyle do the rest automatically.
We could try and fix this particular little annoyance, but I don't think that should block the change for now.
https://astyle.sourceforge.net/astyle.html
@@ -345,7 +353,7 @@ struct parameters { | |||
float mag_heading_noise{3.0e-1f}; ///< measurement noise used for simple heading fusion (rad) | |||
|
|||
#if defined(CONFIG_EKF2_MAGNETOMETER) | |||
float mag_delay_ms{0.0f}; ///< magnetometer measurement delay relative to the IMU (mSec) | |||
float mag_delay_ms {0.0f}; ///< magnetometer measurement delay relative to the IMU (mSec) |
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.
is it always the first one after a #if defined
that needs an extra space?
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.
Newer astyle may have fixed it, I'd like to get the container updated soon and shift the default CI environment to Ubuntu 24.04 (latest LTS).
1f6d69d
to
49cf9dd
Compare
- some of these warning flags aren't even being used, and most of the rest we can figure out from other sources
49cf9dd
to
9eed970
Compare
Now that all the generated code is cleanly separated we can start enforcing astyle like the rest of the code base. There are a few areas with very long lines that astyle has kind of made a mess of, but we can get that under control.