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(compare_map_segmentation): add dynamic map loading for voxel_based_compare_map_filter #3087

Merged

Conversation

badai-nguyen
Copy link
Contributor

@badai-nguyen badai-nguyen commented Mar 16, 2023

Description

This PR to solve this issue 3085 for voxel_based_compare_map_filter nodelete.

The PR utilize the dynamic map loading interface to update current utilize pointcloud map cells.

Related links

TIERIV COMPANY INTERNAL LINK
autowarefoundation/autoware_launch#257

Tests performed

I tested on sample rosbag from Autoware tutorial using split map here: sample-map-rosbag_split.zip

  • I have comfirmed that the performance is the same as current Autoware when use_dynamic_map_loading is set as false
  • I have confirmed that when use_dynamic_map_loading is set as true: the performance is almost the same with current Autoware, with very small degradation. The reason is:
    。This PR storing voxel grid information of each current surrounding map cells + map cell position and size. However, the precise map cell region and position still cannot receive from map loader interface yet. It is still discussed here: https://github.com/orgs/autowarefoundation/discussions/3328. So map cell position and region are calculate by searching max and min pointcloud.
    。So some input poincloud located between calculated map cell region will be passed through filter. However, this issue occurrs mostly around map cells with sparse pointcloud which far from lanelet and which should not have significant effect to the vehicle behavior.
    This will be fixed after map loader interface is updated.
    image

Current Autoware result:
rviz pc rendering, pink:filter output
image
Poincloud number:
red: filter input, blue: filter output
image

Updated Autoware:
rviz pc rendering, pink:filter output
image

Poincloud number:
red: filter input, blue: filter output
image

Notes for reviewers

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.

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
@github-actions github-actions bot added component:launch Launch files, scripts and initialization tools. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) labels Mar 16, 2023
@codecov
Copy link

codecov bot commented Mar 16, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.03 ⚠️

Comparison is base (873666f) 11.78% compared to head (04c468e) 11.76%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3087      +/-   ##
==========================================
- Coverage   11.78%   11.76%   -0.03%     
==========================================
  Files        1324     1327       +3     
  Lines       92855    93074     +219     
  Branches    25011    25011              
==========================================
  Hits        10946    10946              
- Misses      70434    70653     +219     
  Partials    11475    11475              
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 11.80% <ø> (+0.01%) ⬆️ Carriedforward from 9b086e4

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

Impacted Files Coverage Δ
...e_map_segmentation/multi_voxel_grid_map_update.hpp 0.00% <0.00%> (ø)
...compare_map_segmentation/voxel_grid_map_loader.hpp 0.00% <0.00%> (ø)
...ion/src/voxel_based_compare_map_filter_nodelet.cpp 0.00% <0.00%> (ø)
...are_map_segmentation/src/voxel_grid_map_loader.cpp 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@badai-nguyen badai-nguyen force-pushed the fix/compare_map_for_dml branch from 3ff3871 to c854759 Compare March 16, 2023 07:10
@badai-nguyen badai-nguyen requested a review from YoshiRi March 16, 2023 08:29
@badai-nguyen badai-nguyen force-pushed the fix/compare_map_for_dml branch from c854759 to b8cb39d Compare March 17, 2023 00:40
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Mar 17, 2023
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
@badai-nguyen badai-nguyen marked this pull request as ready for review March 17, 2023 02:17
@badai-nguyen badai-nguyen requested review from amc-nu, yukkysaito, a team and miursh as code owners March 17, 2023 02:17
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
@badai-nguyen badai-nguyen force-pushed the fix/compare_map_for_dml branch from fbdb896 to a57d707 Compare March 19, 2023 23:26
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
@badai-nguyen badai-nguyen force-pushed the fix/compare_map_for_dml branch from a57d707 to 9c6b6a9 Compare March 20, 2023 02:26
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Copy link
Contributor

@yukkysaito yukkysaito left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Copy link
Contributor

@miursh miursh left a comment

Choose a reason for hiding this comment

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

LGTM

@badai-nguyen badai-nguyen merged commit e00c636 into autowarefoundation:main Mar 28, 2023
kminoda pushed a commit to kminoda/autoware.universe that referenced this pull request Mar 29, 2023
…ed_compare_map_filter (autowarefoundation#3087)

* feat: add interface to dynamic loader

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* docs: update readme

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: add default param and todo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: remove unnecessary neighbor voxels calculation

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add neighbor map_cell checking

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: neighbor map grid check

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
swiftfile pushed a commit to swiftfile/autoware.universe that referenced this pull request Mar 29, 2023
…ed_compare_map_filter (autowarefoundation#3087)

* feat: add interface to dynamic loader

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* docs: update readme

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: add default param and todo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: remove unnecessary neighbor voxels calculation

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add neighbor map_cell checking

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: neighbor map grid check

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Signed-off-by: Yusuke Mizoguchi <sky.y.m.318@gmail.com>
badai-nguyen added a commit to badai-nguyen/autoware.universe that referenced this pull request Apr 3, 2023
…ed_compare_map_filter (autowarefoundation#3087)

* feat: add interface to dynamic loader

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* docs: update readme

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: add default param and todo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: remove unnecessary neighbor voxels calculation

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add neighbor map_cell checking

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: neighbor map grid check

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
xianglunkai pushed a commit to xianglunkai/autoware.universe that referenced this pull request Apr 3, 2023
* ci: refactor workflows

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* fixup

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
xianglunkai pushed a commit to xianglunkai/autoware.universe that referenced this pull request Apr 3, 2023
…ation#3087 (autowarefoundation#3092)

* ci: refactor workflows to be OS/distro independent like autowarefoundation#3087

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* add needs

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* add outputs

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
badai-nguyen added a commit to badai-nguyen/autoware.universe that referenced this pull request Apr 4, 2023
…ed_compare_map_filter (autowarefoundation#3087)

* feat: add interface to dynamic loader

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* docs: update readme

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: add default param and todo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: remove unnecessary neighbor voxels calculation

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add neighbor map_cell checking

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: neighbor map grid check

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
badai-nguyen added a commit to badai-nguyen/autoware.universe that referenced this pull request Apr 4, 2023
…ed_compare_map_filter (autowarefoundation#3087)

* feat: add interface to dynamic loader

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* docs: update readme

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: add default param and todo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: remove unnecessary neighbor voxels calculation

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add neighbor map_cell checking

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: neighbor map grid check

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
ktro2828 pushed a commit to ktro2828/autoware.universe that referenced this pull request Apr 7, 2023
…ed_compare_map_filter (autowarefoundation#3087)

* feat: add interface to dynamic loader

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: refactoring

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* docs: update readme

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: add default param and todo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: remove unnecessary neighbor voxels calculation

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add neighbor map_cell checking

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: neighbor map grid check

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
@badai-nguyen badai-nguyen deleted the fix/compare_map_for_dml branch June 1, 2023 14:20
@veqcc
Copy link
Contributor

veqcc commented Oct 15, 2024

@badai-nguyen
Hi, could you explain what does mutex_ptr_ protect?

I can see from your code that current_voxel_grid_dict_ is modified while mutex_ptr_ is locked, but reading of it is not protected.
I encountered a race condition bug at addMapCellAndFilter in the latest Autoware, but I cannot reproduce the race condition bug any more (that is what race condition bugs are :(.

pthread_mutex_lock.c:94: _pthread_mutex_lock: Assertion `mutex->data.__owner == 0' failed.

@badai-nguyen
Copy link
Contributor Author

badai-nguyen commented Oct 17, 2024

I can see from your code that current_voxel_grid_dict_ is modified while mutex_ptr_ is locked, but reading of it is not protected.

@veqcc Thank you a lot for your pointing out my mistake.
Yes you are correct, some reads of current_voxel_grid_dict_ are missing the lock on mutex_ptr_.
Let me fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:launch Launch files, scripts and initialization tools. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants