-
Notifications
You must be signed in to change notification settings - Fork 47
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
Removed outlier filters and artifacts #427
Conversation
avtoku
commented
Jul 9, 2024
- Removed outlier filters. This affects the airspeed, barometer, and sonar.
- Removed the (redundant) check for valid data in the comm_manager because those functions are not called unless the data is valid. This affects all send_* functions that have this redundancy.
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.
Just a few formatting comments. If you run the clang-format script that uses the .clang-format file in the rosflight_firmware repository, then it should fix the spacing errors for you.
include/sensors.h
Outdated
@@ -149,12 +149,12 @@ class Sensors : public ParamListenerInterface | |||
float diff_pressure_velocity = 0; | |||
float diff_pressure = 0; | |||
float diff_pressure_temp = 0; | |||
bool diff_pressure_valid = false; | |||
// bool diff_pressure_valid = false; |
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.
Could you remove this line instead of just comment it out?
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.
updated.
include/sensors.h
Outdated
|
||
float baro_altitude = 0; | ||
float baro_pressure = 0; | ||
float baro_temperature = 0; | ||
bool baro_valid = false; | ||
// bool baro_valid = false; |
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.
Same as above
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.
updated
src/comm_manager.cpp
Outdated
|
||
void CommManager::send_mag(void) | ||
{ | ||
if (RF_.sensors_.data().mag_present) comm_link_.send_mag(sysid_, RF_.sensors_.data().mag); | ||
comm_link_.send_mag(sysid_, RF_.sensors_.data().mag); |
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.
This has tabs instead of spaces. The ROS style guide directs to use spaces instead of tabs, and mixing them makes for very messy formatting. clang-format can fix this for you if you'd like.
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.
ran clang-tools on that file.
src/comm_manager.cpp
Outdated
@@ -397,37 +397,30 @@ void CommManager::send_rc_raw(void) | |||
|
|||
void CommManager::send_diff_pressure(void) | |||
{ | |||
if (RF_.sensors_.data().diff_pressure_valid) { | |||
comm_link_.send_diff_pressure(sysid_, RF_.sensors_.data().diff_pressure_velocity, | |||
RF_.sensors_.data().diff_pressure, | |||
RF_.sensors_.data().diff_pressure_temp); | |||
} |
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 you have some misaligned brackets and spacing in this file
One other question, you mention that these functions are not called unless the data is valid so check if the data is valid is redundant. Where is the other validity check specifically? Is that in the rosflight_firmware code or the board implementation code? |
Most of the checks that were removed were of the form "if(RF_.sensors_.data().mag_present)" and has been replaced with the if "if(got.mag) send_mag();" check in CommManager::stream(got_flags got). Baro, Pitot, and Sonar were also blocked from sending if there were outliers which we are not checking anymore. In addition, board drivers don't report data if the self-status indicates an error. The BMI088 is an exception because it doesn't have a good status to check, and valid GPS packets get sent including status in data packet. |
579a014
to
4485f7c
Compare