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

Removed outlier filters and artifacts #427

Merged
merged 5 commits into from
Jul 10, 2024
Merged

Conversation

avtoku
Copy link
Contributor

@avtoku avtoku commented Jul 9, 2024

  1. Removed outlier filters. This affects the airspeed, barometer, and sonar.
  2. 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.

Copy link
Contributor

@bsutherland333 bsutherland333 left a 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.

@@ -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;
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.


float baro_altitude = 0;
float baro_pressure = 0;
float baro_temperature = 0;
bool baro_valid = false;
// bool baro_valid = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated


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);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@@ -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);
}
Copy link
Contributor

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

@bsutherland333
Copy link
Contributor

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?

@avtoku
Copy link
Contributor Author

avtoku commented Jul 10, 2024

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.

@bsutherland333 bsutherland333 force-pushed the PTT/remove_outlier_filter branch from 579a014 to 4485f7c Compare July 10, 2024 18:41
@bsutherland333 bsutherland333 merged commit 7119082 into main Jul 10, 2024
2 checks passed
@bsutherland333 bsutherland333 deleted the PTT/remove_outlier_filter branch July 10, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants