-
Notifications
You must be signed in to change notification settings - Fork 659
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
feat(imu_corrector): changed publication algorithm and content of /diagnostics in gyro_bias_estimator #6139
feat(imu_corrector): changed publication algorithm and content of /diagnostics in gyro_bias_estimator #6139
Conversation
Signed-off-by: TaikiYamada4 <[email protected]>
…ot updated. Fixed typo. Signed-off-by: TaikiYamada4 <[email protected]>
…utomatically. Set the update peirod of diagnostics to be same to the timer_callback. Changed words of the diagnostics message a bit. Signed-off-by: TaikiYamada4 <[email protected]>
Thank you for the pull request! (1) I think it would be good to be able to set separate values for the processing timer callback period and the diagnostics period. (2) How about calculating the values output by the diagnostics in the timer callback and organizing them into a struct? (3) I think it would be good if the summary statuses in the diagnostics clearly corresponded to the branches of the if statement in (4) It would be good to execute force_update at the end of the process timer callback. (5) Please ensure that |
Let update_diagnostics to be simple. Signed-off-by: TaikiYamada4 <[email protected]>
Signed-off-by: TaikiYamada4 <[email protected]>
…:TaikiYamada4/autoware.universe into feat/gyro_bias_estimator-periodical_diag Signed-off-by: TaikiYamada4 <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6139 +/- ##
==========================================
- Coverage 14.58% 14.58% -0.01%
==========================================
Files 1878 1879 +1
Lines 128023 128052 +29
Branches 37468 37468
==========================================
Hits 18673 18673
- Misses 88376 88405 +29
Partials 20974 20974
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Then, there will be no duplicates of diagnostics. Signed-off-by: TaikiYamada4 <[email protected]>
Regarding to the reviewers feedbacks, I've made these additional changes.
I believe this will satisfy the requirements. One minor problem is that update_diagnostics() function can be set to |
|
||
stat.add("estimated_gyro_bias_x", diagnostics_info_.estimated_gyro_bias_x); | ||
stat.add("estimated_gyro_bias_y", diagnostics_info_.estimated_gyro_bias_y); | ||
stat.add("estimated_gyro_bias_z", diagnostics_info_.estimated_gyro_bias_z); |
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.
To improve visibility when viewing with rqt_runtime_monitor, consider making the following two changes:
- Use
std::fixed
- Display threshold value
For example, it looks like the following
void GyroBiasEstimator::update_diagnostics(diagnostic_updater::DiagnosticStatusWrapper & stat)
{
auto f = [](const double & value) {
std::stringstream ss;
ss << std::fixed << value;
return ss.str();
};
stat.summary(diagnostics_info_.level, diagnostics_info_.summary_message);
stat.add("gyro_bias_x_for_imu_corrector", f(diagnostics_info_.gyro_bias_x_for_imu_corrector));
stat.add("gyro_bias_y_for_imu_corrector", f(diagnostics_info_.gyro_bias_y_for_imu_corrector));
stat.add("gyro_bias_z_for_imu_corrector", f(diagnostics_info_.gyro_bias_z_for_imu_corrector));
stat.add("estimated_gyro_bias_x", f(diagnostics_info_.estimated_gyro_bias_x));
stat.add("estimated_gyro_bias_y", f(diagnostics_info_.estimated_gyro_bias_y));
stat.add("estimated_gyro_bias_z", f(diagnostics_info_.estimated_gyro_bias_z));
stat.add("gyro_bias_threshold", f(gyro_bias_threshold_));
}
When I tried to keep it within the character limit, I ended up with a very short function name :(
If you have any opposing opinions, please let me know.
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.
Thank you for the comment!
I followed your recommendation and add the following commit. 👍
Added gyro_bias_threshold_ to the diagnostics Signed-off-by: TaikiYamada4 <[email protected]>
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.
Looks Good To Me
…agnostics in gyro_bias_estimator (autowarefoundation#6139) * Let diagnostics be updated even if expections occur in timer_callback Signed-off-by: TaikiYamada4 <[email protected]> * Fixed the summary message to be "Not updated" when the gyro bias is not updated. Fixed typo. Signed-off-by: TaikiYamada4 <[email protected]> * Removed force_update() since updater_ originaly updates diagnostics automatically. Set the update peirod of diagnostics to be same to the timer_callback. Changed words of the diagnostics message a bit. Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Let the period of diagnostics publication independent to timer. Let update_diagnostics to be simple. Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Fixed typo Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Added setPeriod after force_update to reset the timer of updater_. Then, there will be no duplicates of diagnostics. Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Set diagnostics values to have the same precision Added gyro_bias_threshold_ to the diagnostics Signed-off-by: TaikiYamada4 <[email protected]> * Updated README.md to match the paramters in gyro_bias_estimator Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: TaikiYamada4 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…agnostics in gyro_bias_estimator (autowarefoundation#6139) * Let diagnostics be updated even if expections occur in timer_callback Signed-off-by: TaikiYamada4 <[email protected]> * Fixed the summary message to be "Not updated" when the gyro bias is not updated. Fixed typo. Signed-off-by: TaikiYamada4 <[email protected]> * Removed force_update() since updater_ originaly updates diagnostics automatically. Set the update peirod of diagnostics to be same to the timer_callback. Changed words of the diagnostics message a bit. Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Let the period of diagnostics publication independent to timer. Let update_diagnostics to be simple. Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Fixed typo Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Added setPeriod after force_update to reset the timer of updater_. Then, there will be no duplicates of diagnostics. Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Set diagnostics values to have the same precision Added gyro_bias_threshold_ to the diagnostics Signed-off-by: TaikiYamada4 <[email protected]> * Updated README.md to match the paramters in gyro_bias_estimator Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: TaikiYamada4 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…agnostics in gyro_bias_estimator (autowarefoundation#6139) * Let diagnostics be updated even if expections occur in timer_callback Signed-off-by: TaikiYamada4 <[email protected]> * Fixed the summary message to be "Not updated" when the gyro bias is not updated. Fixed typo. Signed-off-by: TaikiYamada4 <[email protected]> * Removed force_update() since updater_ originaly updates diagnostics automatically. Set the update peirod of diagnostics to be same to the timer_callback. Changed words of the diagnostics message a bit. Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Let the period of diagnostics publication independent to timer. Let update_diagnostics to be simple. Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Fixed typo Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Added setPeriod after force_update to reset the timer of updater_. Then, there will be no duplicates of diagnostics. Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix * Set diagnostics values to have the same precision Added gyro_bias_threshold_ to the diagnostics Signed-off-by: TaikiYamada4 <[email protected]> * Updated README.md to match the paramters in gyro_bias_estimator Signed-off-by: TaikiYamada4 <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: TaikiYamada4 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
Change of publication algorithm
gyro_bias_estimator has been publishing
/diagnostics
topic through DiagnosticsUpdater.However, there is also a publication of
/diagnostics
byforce_update()
in thetimer_callback
that makes extra publication.In addition, this
force_update()
will be prevented if specific conditions match intimer_callback
which leads to inconsistency on publication of/diagnostics
.To solve this problem, I implemented gyro_bias_estimator to publish
/diagnostics
only through DiagnosticsUpdater.Plus, since the publication period set to the
updater_
had been default (1.0 second), I revised it to be the same to the period of timer_callback.Change of diagnostic content
I have modified the content of the diagnostic to satisfy the following.
/diagnostics
./diagnostics
by setting the bias values as NaN when it is not initialized.The rqt_runtime_monitor will be like this
Related links
None
Tests performed
I've test this code via rosbag replay simulation tutorial.
Notes for reviewers
I've just set the publication period of
/diagnostics
same to the timer callback period.If this doesn't suit the purpose please tell me.
Interface changes
None
Effects on system behavior
/diagnostics
from gyro_bias_estimator should be more periodical than before/diagnostics
will be changed as mentioned in Change of diagnostic contentPre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.