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

fix(ndt_scan_matcher): improved tpe #6990

Merged

Conversation

SakodaShintaro
Copy link
Contributor

@SakodaShintaro SakodaShintaro commented May 13, 2024

Description

Context

The current ndt_scan_matcher uses Tree-Structured Parzen Estimator (TPE) for initial pose estimation. However, this implementation is not very good and often searches far away positions on the square.

In the image below, the search is being performed at a position far from the correct position on the upper and left sides.

One of the reasons for this is that TPE is designed as a general-purpose optimization class and is formulated as sampling for a uniform distribution. ndt_scan_matcher performs sampling based on normal distribution, so we introduce mutual conversion between uniform distribution and normal distribution, but it seems that this is not working as expected.

Changes

First, since TPE is only used in ndt_scan_matcher, we changed it to an implementation specialized for optimization in NDT. For example, we changed the sampling inside the TPE to a normal distribution, and changed the standard deviation value used in Parzen Estimator to a value that corresponds to the convergence ability of NDT.

Next, change the default number of initial random searches in TPE from 20 to 100. The larger this value is, the closer it gets to a complete random search, so in this case it gets closer to a normal distribution.

As a result of these changes, the distribution became more natural and the initial pose estimation performance improved slightly.

Related PR

Tests performed

Regarding the AWSIM data, we gave ndt_scan_matcher a total of 100 initial positions, 5x5 at 1m intervals for x and y, and 4 at 90 degrees each for yaw, from the correct initial position, and experimented to see if it could converge to the correct pose.

The results of 100 trials were plotted in a boxplot using the Transformation Probability (TP) value as an indicator.

Although it still sometimes converges to a bad score, the results are better than completely random.

awsim_nishishinjuku_score

We also verified the data of about 20 other points that TIER IV holds internally, and found that the data generally improved, and even in other cases, the performance remained almost the same.

Effects on system behavior

The performance of initial pose estimation is slightly improved.

Interface changes

No interface changes

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.

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
@github-actions github-actions bot added the component:localization Vehicle's position determination in its environment. (auto-assigned) label May 13, 2024
@SakodaShintaro SakodaShintaro self-assigned this May 13, 2024
@SakodaShintaro SakodaShintaro added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label May 13, 2024
Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
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 think this PR is basically approval 👍

@YamatoAndo
Copy link
Contributor

I tested this PR, and it seems to be improved compared to before.
I think it's okay to merge this after addressing Yabuuchi-san's feedback.

SakodaShintaro and others added 2 commits May 14, 2024 10:04
Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
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.

👍

@SakodaShintaro SakodaShintaro merged commit ac5190b into autowarefoundation:main May 14, 2024
25 of 26 checks passed
@SakodaShintaro SakodaShintaro deleted the fix/improve_tpe branch May 14, 2024 04:35
vividf pushed a commit to vividf/autoware.universe that referenced this pull request May 16, 2024
* Improved tpe

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>

* Added name in TODO

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>

* Fixed tpe test

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>

* style(pre-commit): autofix

---------

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
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) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants