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

feat(imu_corrector): changed GyroBiasEstimator to use ndt pose instead of twist #5259

Conversation

SakodaShintaro
Copy link
Contributor

@SakodaShintaro SakodaShintaro commented Oct 10, 2023

Description

Before : Use twist to determine whether ego-vehicle is stopping, and calculate imu bias by comparing it to 0 while it is stopping.

After: Use ndt pose to determine whether ego-vehicle is curving, and calculate imu bias by comparing it to ndt pose while it is not curving.

Related link

Tests performed

It has been confirmed that it works as expected with sample rosbag.

The red dashed line indicates the range extended from the orange line, which is the calibration value, by gyro_bias_threshold.

If it is within the red dashed line range, the IMU bias is considered normal.

For TIER IV's internal rosbags, the result of the IMU bias variation detection function for data taken on a day not long after calibration is as follows.

For data taken on a day when more time has passed since calibration, the result is as follows.

Effects on system behavior

Improves performance of IMU bias variation detection.

Pre-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.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) labels Oct 10, 2023
@SakodaShintaro SakodaShintaro marked this pull request as ready for review October 11, 2023 00:18
@kminoda
Copy link
Contributor

kminoda commented Oct 11, 2023

Thank you very much! Let me review until tomorrow 🙏

@kminoda kminoda added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 11, 2023
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Attention: 83 lines in your changes are missing coverage. Please review.

Comparison is base (c508aa7) 14.78% compared to head (9babe99) 14.78%.
Report is 50 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5259   +/-   ##
=======================================
  Coverage   14.78%   14.78%           
=======================================
  Files        1644     1644           
  Lines      113948   114020   +72     
  Branches    35160    35179   +19     
=======================================
+ Hits        16850    16862   +12     
- Misses      78143    78181   +38     
- Partials    18955    18977   +22     
Flag Coverage Δ *Carryforward flag
differential 21.94% <35.65%> (?)
total 14.76% <ø> (-0.03%) ⬇️ Carriedforward from f669c20

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
.../imu_corrector/src/gyro_bias_estimation_module.hpp 0.00% <ø> (ø)
.../imu_corrector/src/gyro_bias_estimation_module.cpp 75.55% <74.41%> (-13.74%) ⬇️
...orrector/test/test_gyro_bias_estimation_module.cpp 51.28% <42.42%> (-26.00%) ⬇️
sensing/imu_corrector/src/gyro_bias_estimator.cpp 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@kminoda kminoda left a comment

Choose a reason for hiding this comment

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

Thank you! I left some comments 🙏

@kminoda kminoda self-requested a review October 12, 2023 02:49
@kminoda
Copy link
Contributor

kminoda commented Oct 12, 2023

Would you create a PR for other sensor kit packages as well? (e.g. aip_launcher)

@SakodaShintaro
Copy link
Contributor Author

Would you create a PR for other sensor kit packages as well? (e.g. aip_launcher)

I have also created this pull request.
tier4/aip_launcher#180

@kminoda kminoda self-requested a review October 12, 2023 07:30
Copy link
Contributor

@kminoda kminoda left a comment

Choose a reason for hiding this comment

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

One final comment 🙏

| Name | Type | Description |
| ----------------- | ----------------------------------------------- | ---------------- |
| `~/input/imu_raw` | `sensor_msgs::msg::Imu` | **raw** imu data |
| `~/input/pose` | `geometry_msgs::msg::PoseWithCovarianceStamped` | ndt pose |
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you state here something like as follows as a side note below?

Note that the input pose is assumed to be accurate enough. For example when using NDT, we assume that the NDT is appropriately converged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a very good. In fact, one needs to be careful when using a pose other than NDT, or when using NDT in an environment where its accuracy will be low.
Currently, it is only output to diagnostics, so there may not be a need to be overly cautious. However, caution is needed when changing the IMU value based on the estimate obtained here for online calibration.

Fixed in f669c20

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! But what I meant was to put it as a side note maybe as a footer. The description ndt pose itself was OK.

So something like

### Input

| Name              | Type                                            | Description      |
| ----------------- | ----------------------------------------------- | ---------------- |
| `~/input/imu_raw` | `sensor_msgs::msg::Imu`                         | **raw** imu data |
| `~/input/pose`    | `geometry_msgs::msg::PoseWithCovarianceStamped` | ndt pose         |

Note that the input pose is assumed to be accurate enough. For example when using NDT, we assume that the NDT is appropriately converged.

Copy link
Contributor

Choose a reason for hiding this comment

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

However, caution is needed when changing the IMU value based on the estimate obtained here for online calibration.

Correct. That's one of the main concern for using NDT for estimation, which makes some kind of a new closed loop in Autoware. So would like to add some warnings for future developers.

Signed-off-by: Shintaro Sakoda <[email protected]>
@SakodaShintaro
Copy link
Contributor Author

I created a pull request to launch gyro_bias_estimator in pose mode in AWSIM as well, but I can not seem to add reviewers.

tier4/awsim_sensor_kit_launch#10

This reverts commit f669c20.
Signed-off-by: Shintaro Sakoda <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
Copy link
Contributor

@kminoda kminoda left a comment

Choose a reason for hiding this comment

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

LGTM!

@SakodaShintaro SakodaShintaro merged commit 3a1d480 into autowarefoundation:main Oct 17, 2023
22 of 24 checks passed
@SakodaShintaro SakodaShintaro deleted the feat/use_pose_in_gyro_bias_estimator branch October 17, 2023 04:36
kminoda pushed a commit to kminoda/autoware.universe that referenced this pull request Oct 17, 2023
…d of twist (autowarefoundation#5259)

* Implemented ndt pose based GyroBiasEstimator

Signed-off-by: Shintaro Sakoda <[email protected]>

* style(pre-commit): autofix

* Added missing includes

Signed-off-by: Shintaro Sakoda <[email protected]>

* FIxed default gyro_bias_threshold

Signed-off-by: Shintaro Sakoda <[email protected]>

* Restored gyro_bias_pub_, which had been deleted due to a mistake

Signed-off-by: Shintaro Sakoda <[email protected]>

* removed get_bias_std and anything else that is no longer needed as a result of remove

Signed-off-by: Shintaro Sakoda <[email protected]>

* Updated README.md

Signed-off-by: Shintaro Sakoda <[email protected]>

* Revert "Updated README.md"

This reverts commit f669c20.

* Updated README.md

Signed-off-by: Shintaro Sakoda <[email protected]>

* Added notes to README.md

Signed-off-by: Shintaro Sakoda <[email protected]>

---------

Signed-off-by: Shintaro Sakoda <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
kminoda added a commit to tier4/autoware.universe that referenced this pull request Oct 19, 2023
…d of twist (#956)

feat(imu_corrector): changed GyroBiasEstimator to use ndt pose instead of twist (autowarefoundation#5259)

* Implemented ndt pose based GyroBiasEstimator



* style(pre-commit): autofix

* Added missing includes



* FIxed default gyro_bias_threshold



* Restored gyro_bias_pub_, which had been deleted due to a mistake



* removed get_bias_std and anything else that is no longer needed as a result of remove



* Updated README.md



* Revert "Updated README.md"

This reverts commit f669c20.

* Updated README.md



* Added notes to README.md



---------

Signed-off-by: Shintaro Sakoda <[email protected]>
Co-authored-by: SakodaShintaro <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants