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(pose_instability_detector): change validation algorithm #7042

Conversation

TaikiYamada4
Copy link
Contributor

@TaikiYamada4 TaikiYamada4 commented May 17, 2024

Description

Change of instability detection

Currently, pose_instability_detector compares the EKF pose and dead reckoning (DR) pose with a constant threshold defined in the pose_instability_detector.param.yaml file.

However, since the instability definition should change by the timer period and the vehicle twist, I made a framework for the pose_instability_detector to calculate the threshold of instability by itself, using the characteristics of the localization component. Note that this PR only puts timer period on consideration.

Hence, the pose_instability_detector.param.yaml drastically changed so that the parameters for calculation has been required but not the threshold itself.

Read the README.md for more information.

Screenshot from 2024-06-03 14-37-49

Change of DR algorithm

Since there was a lack of time span for twist integration, I revised the algorithm so that the twist integration is fully done from the previous EKF pose to the current EKF pose.

Related links

The following link shows the test results using actual driving data (For TIER IV people only)
TIER IV INTERNAL LINK

Tests performed

I have tested this module with several driving data in TIER IV, and check that the /diagnostics seems to output proper values. (For TIER IV people, see the link above.)
I also check that the rqt_runtime_monitor works well.

Currently, pose_instability_detector have output WARNs because of "large twist variance" and "angular twist error due to wrong gyro bias settings" even in normal environments but they appear very rare and only when the angular twist has a large perturbation.

Notes for reviewers

Interface changes

ROS Topic Changes

None

ROS Parameter Changes

Discarded all parameters, and added the following instead.

Name Default Value Description
timer_period 0.5 The period of timer_callback (sec).
heading_velocity_maximum 16.667 The maximum of heading velocity (m/s).
heading_velocity_scale_factor_tolerance 3.0 The tolerance of heading velocity scale factor (%).
angular_velocity_maximum 0.523 The maximum of angular velocity (rad/s).
angular_velocity_standard_deviation 0.00175 The standard deviation of angular velocity (rad/s).
angular_velocity_scale_factor_tolerance 0.2 The tolerance of angular velocity scale factor (%).
angular_velocity_bias_tolerance 0.00698 The tolerance of angular velocity bias (rad/s).
pose_estimator_longitudinal_tolerance 0.11 The tolerance of longitudinal position of pose estimator (m).
pose_estimator_lateral_tolerance 0.11 The tolerance of lateral position of pose estimator (m).
pose_estimator_vertical_tolerance 0.11 The tolerance of vertical position of pose estimator (m).
pose_estimator_angular_tolerance 0.00631 The tolerance of roll angle of pose estimator (rad).

Effects on system behavior

This PR should not change the system behavior. However, since the current pose_instability_detector has optimistic threshold values and this PR makes it low, WARN diagnostics from this node may appear respectively more frequently (but yet with low possibility).

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

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.
  • The PR is ready for merge.

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

@github-actions github-actions bot added the component:localization Vehicle's position determination in its environment. (auto-assigned) label May 17, 2024
pre-commit-ci bot and others added 3 commits May 17, 2024 04:18
Rewrite json schema.
Refactor some variables.

Signed-off-by: TaikiYamada4 <[email protected]>
@TaikiYamada4 TaikiYamada4 self-assigned this May 20, 2024
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label May 31, 2024
@TaikiYamada4 TaikiYamada4 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jun 3, 2024
@TaikiYamada4 TaikiYamada4 marked this pull request as ready for review June 3, 2024 06:17
Copy link
Contributor

@KYabuuchi KYabuuchi left a comment

Choose a reason for hiding this comment

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

I have not yet reviewed the detailed implementation, but I left some comments on what I noticed quickly.

@TaikiYamada4 TaikiYamada4 added the run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) label Jun 4, 2024
@TaikiYamada4
Copy link
Contributor Author

@KYabuuchi
Thank you so much for your reviewing.
I believe I've fixed the dead reckoning algorithm when updating the orientation.

Anyways, I will revert this PR to draft since I have to evaluate this PR by myself since many changes have happened. Plus, I am to remove the consideration of the process noise in dead reckoning and I have to check that out too.

@TaikiYamada4 TaikiYamada4 marked this pull request as draft June 4, 2024 08:17
@TaikiYamada4 TaikiYamada4 marked this pull request as ready for review June 5, 2024 04:06
Copy link
Contributor

@KYabuuchi KYabuuchi left a comment

Choose a reason for hiding this comment

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

At first, please fix the failing test. Currently, diagnostics are not published unless both odometry and twist are subscribed to, so it seems the test cannot exit the while loop.

But, I think the current implementation is basically fine. 🙆‍♂️
I will approve once the issues I pointed out are resolved.

localization/pose_instability_detector/package.xml Outdated Show resolved Hide resolved
localization/pose_instability_detector/README.md Outdated Show resolved Hide resolved
@TaikiYamada4 TaikiYamada4 removed the run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) label Jun 6, 2024
TaikiYamada4 and others added 4 commits June 6, 2024 20:25
Signed-off-by: TaikiYamada4 <[email protected]>
…ages can use the methods in pose_instability_detector

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

I've changed calculate_threshold method and dead_reckon method to public so that it can be used by other modules.
With this change, I also changed calculate_threshold to output the threshold values explicitly w/o changing the private variables.

Copy link
Contributor

@KYabuuchi KYabuuchi left a 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 🙆‍♂️
Thank you for patiently responding to my many requests.

@TaikiYamada4 TaikiYamada4 merged commit 2b7c0db into autowarefoundation:main Jun 7, 2024
22 of 23 checks passed
@TaikiYamada4 TaikiYamada4 deleted the feat/pose_instability_detector/sophisticate_threshold_values branch June 7, 2024 07:45
KhalilSelyan pushed a commit that referenced this pull request Jul 22, 2024
* Create define_static_threshold()

Signed-off-by: TaikiYamada4 <[email protected]>

* Revised dead reckoning methodology

Signed-off-by: TaikiYamada4 <[email protected]>

* style(pre-commit): autofix

* Change threshold calculation to use the online time difference

Signed-off-by: TaikiYamada4 <[email protected]>

* Simplify threshold calculation.
Rewrite json schema.
Refactor some variables.

Signed-off-by: TaikiYamada4 <[email protected]>

* style(pre-commit): autofix

* Rewrite lateral_threshold and vertical threshold

Signed-off-by: TaikiYamada4 <[email protected]>

* Consider dead reckoning noise, update README.md.

Signed-off-by: TaikiYamada4 <[email protected]>

* Added sentences to README.md

Signed-off-by: TaikiYamada4 <[email protected]>

* Filled README.md
Revert lateral threshold calculation.

Signed-off-by: TaikiYamada4 <[email protected]>

* style(pre-commit): autofix

* Add #include <algorithm>

Signed-off-by: TaikiYamada4 <[email protected]>

* style(pre-commit): autofix

* Fixed pose_instability_detector.schema.json

Signed-off-by: TaikiYamada4 <[email protected]>

* Revised calculation of the process noise of dead reckoning.

Signed-off-by: TaikiYamada4 <[email protected]>

* style(pre-commit): autofix

* Fixed typo and lack of information

Signed-off-by: TaikiYamada4 <[email protected]>

* Revised redundant time substitutions

Signed-off-by: TaikiYamada4 <[email protected]>

* Revised dead reckoning algorithm for orientation.

Signed-off-by: TaikiYamada4 <[email protected]>

* style(pre-commit): autofix

* Added information about lateral thresholld calculation in README.md

Signed-off-by: TaikiYamada4 <[email protected]>

* Removed all dead reckoning related process noise stuff

Signed-off-by: TaikiYamada4 <[email protected]>

* Removed parameters and desciprtion of dead reckoning process noise stuff

Signed-off-by: TaikiYamada4 <[email protected]>

* style(pre-commit): autofix

* Fixed integration logic for angular twist

Signed-off-by: TaikiYamada4 <[email protected]>

* Let the hpp file be exportable, and follow the guidelines when exporting hpp files

Signed-off-by: TaikiYamada4 <[email protected]>

* style(pre-commit): autofix

* Fix typo

Signed-off-by: TaikiYamada4 <[email protected]>

* Delete include from package.xml

Signed-off-by: TaikiYamada4 <[email protected]>

* Make test codes work. Create a threshold structure so that other packages can use the methods in pose_instability_detector

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:localization Vehicle's position determination in its environment. (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.

3 participants