Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

add pcd map hash generator #745

Merged
merged 4 commits into from
Dec 2, 2021
Merged

Conversation

taichiH
Copy link
Contributor

@taichiH taichiH commented Nov 29, 2021

Description

update map_hash_generator to publish pcd map hash.

tier4/autoware_launch-old#142
https://github.com/tier4/autoware_api_msgs/pull/42
tier4/AutowareArchitectureProposal_api_msgs#1

Review Procedure

Remarks

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • Code follows coding guidelines
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets
  • Write release notes

CI Checks

  • Build and test for PR / build-and-test-pr: Required to pass before the merge.
  • Build and test for PR / clang-tidy-pr: NOT required to pass before the merge. It is up to the reviewer(s). Found false positives? See the guidelines.
  • Check spelling: NOT required to pass before the merge. It is up to the reviewer(s). See here if you want to add some words to the spell check dictionary.

@taichiH
Copy link
Contributor Author

taichiH commented Nov 29, 2021

Here is test result.

input path

$ pwd
/path/to/map_dir/pcd

$ for f in `ls | xargs`; do sha256sum $f; done
8695ee46ed912fa4d2f3ee035bfa873784cfec6792269f20f5bd0dc6e3cfda22  pointcloud_map0.pcd
8695ee46ed912fa4d2f3ee035bfa873784cfec6792269f20f5bd0dc6e3cfda22  pointcloud_map1.pcd
8695ee46ed912fa4d2f3ee035bfa873784cfec6792269f20f5bd0dc6e3cfda22  pointcloud_map2.pcd

result

ros2 launch map_launch map.launch.py pointcloud_map_path:=/path/to/map_dir/pcd map_path:=/path/to/map_dir
$ ros2 topic echo /api/autoware/get/map/info/hash --qos-reliability reliable --qos-durability transient_local
lanelet: 66fddaeb8589a91beab34e56dd90420ba61bcd2e2b2193b318ed091e2df090d1
pcd: 6b6c38b3514a563b992fb801508001243665549ebfc0a93c638478bc494eefcf

test

In [28]: text = '8695ee46ed912fa4d2f3ee035bfa873784cfec6792269f20f5bd0dc6e3cfda22'                                                 

In [29]: hashlib.sha256((text + text + text).encode()).hexdigest() == '6b6c38b3514a563b992fb801508001243665549ebfc0a93c638478bc494eefcf'                                                                                                                              
Out[29]: True

@isamu-takagi
Copy link
Contributor

@taichiH The hashing will be executed twice If it is a file. Is that OK?

pcd: b05738ae46dcd374628d21c05d24da3ac99e90c722fb53b108f313afd10f8d9e
$ sha256sum pointcloud_map.pcd 
6ac84b21103b32ae43ac387d4905285442d250657f5ea100b12dfb59a1c758da  pointcloud_map.pcd
$ echo -n 6ac84b21103b32ae43ac387d4905285442d250657f5ea100b12dfb59a1c758da | sha256sum -
b05738ae46dcd374628d21c05d24da3ac99e90c722fb53b108f313afd10f8d9e  -

@taichiH
Copy link
Contributor Author

taichiH commented Dec 1, 2021

@isamu-takagi
Yes as expected. I thought the hash generation method should be the same for a single file and multiple files, so I did so.

But I just changed my mind because it's necessary to generate hash in the same way on the application side for example fms, and it feels strange.

Is it better to change the hash generation method for a single file?

@isamu-takagi
Copy link
Contributor

@taichiH I think it is easier to understand.

@taichiH
Copy link
Contributor Author

taichiH commented Dec 2, 2021

@isamu-takagi I fixed point you've reviewed.

Copy link
Contributor

@isamu-takagi isamu-takagi left a comment

Choose a reason for hiding this comment

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

LGTM

@taichiH taichiH merged commit 23896d1 into use-autoware-auto-msgs Dec 2, 2021
@taichiH taichiH deleted the add-pcd-hash-genarator branch December 2, 2021 06:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants