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(ekf_localizer): input ekf_dt to simple1dfilter #8622

Conversation

YamatoAndo
Copy link
Contributor

Description

Instead of calculating dt within Simple1DFilter, I modified it to pass ekf_dt_ as an argument.

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
@github-actions github-actions bot added the component:localization Vehicle's position determination in its environment. (auto-assigned) label Aug 26, 2024
Copy link

github-actions bot commented Aug 26, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@YamatoAndo
Copy link
Contributor Author

@reviewers I'm not confident that this fix is correct.
So, I would like everyone to consider what the correct approach should be.

Copy link
Contributor

@SakodaShintaro SakodaShintaro left a comment

Choose a reason for hiding this comment

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

This change makes the "Simple1DFilter" class a ROS-free implementation. I think it's admirable from the view point about readability.

Are you concerned that ekf_dt_ is not equal to pose.header.stamp - latest_time_?

@YamatoAndo
Copy link
Contributor Author

I’m more concerned about potential issues when there are two pose sources, such as NDT and GNSS.
Depending on the output timing of NDT and GNSS poses, the calculation of pose.header.stamp - latest_time_ could result in a negative value, which seems like an incorrect implementation.
In this case, I'm not confident that ekf_dt_ is correct.

@TaikiYamada4
Copy link
Contributor

TaikiYamada4 commented Aug 27, 2024

@YamatoAndo
I believe there is nothing wrong with using ekf_dt_ in the update function. I understand that dt in the update function determines the "variance of prediction." This variance should be larger as the timer period increases, because the longer the time, the more difficult the prediction becomes. In a traditional Kalman filter, the variance of prediction doesn’t need to be affected by the observation, regardless of how the observation appears.

In terms of multiple pose sources, it still seems natural to me that ekf_dt_ is used in the update function, and it doesn't significantly affect the system, even if multiple pose observations are stacked in the queue. If the timer period becomes longer for some reason, all the pose observations in the queue should have a larger impact.

Perhaps the concern arises from the fact that current 1D filters don't update the variance during delay compensation. If the observations in the queue are too old and the variance doesn’t increase during delay compensation, unexpected results may occur.

@TaikiYamada4 TaikiYamada4 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Aug 28, 2024
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 24.10%. Comparing base (bda8706) to head (79e5249).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
localization/ekf_localizer/src/ekf_localizer.cpp 40.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8622   +/-   ##
=======================================
  Coverage   24.10%   24.10%           
=======================================
  Files        1399     1399           
  Lines      102337   102334    -3     
  Branches    38870    38868    -2     
=======================================
  Hits        24668    24668           
+ Misses      75141    75138    -3     
  Partials     2528     2528           
Flag Coverage Δ *Carryforward flag
differential 31.20% <40.00%> (?)
total 24.10% <ø> (-0.01%) ⬇️ Carriedforward from bda8706

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

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

@SakodaShintaro
Copy link
Contributor

I'll perform the performance tests for all data.

TIER IV INTERNAL LINK

Copy link
Contributor

@SakodaShintaro SakodaShintaro 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 compared the new code with the old code using 30 data points. Since there is some randomness in the logging_simulator, the results may have some deviation, but it can be interpreted that the performance is almost the same as before.

compare_result

LGTM

@YamatoAndo YamatoAndo merged commit 09eda62 into autowarefoundation:main Aug 29, 2024
41 checks passed
a-maumau pushed a commit to a-maumau/autoware.universe that referenced this pull request Sep 2, 2024
…on#8622)

input ekf_dt to simple1dfilter

Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Co-authored-by: TaikiYamada4 <129915538+TaikiYamada4@users.noreply.github.com>
ktro2828 pushed a commit to ktro2828/autoware.universe that referenced this pull request Sep 18, 2024
…on#8622)

input ekf_dt to simple1dfilter

Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Co-authored-by: TaikiYamada4 <129915538+TaikiYamada4@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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants