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

chore(map_loader): rework parameters of map_loader #6199

Merged

Conversation

anhnv3991
Copy link
Contributor

Description

In the map_loader module

  • Added lanelet2_map_loader.schema.json and pointcloud_map_loader.schema.json that describe parameters of map_loader in the json format
  • Moved the parameter lanelet2_map_path from lanelet2_map_loader.launch.xml to lanelet2_map_loader.param.yaml
  • Moved the parameters pcd_paths_or_directory and pcd_metadata_path from pointcloud_map_loader.launch.xml to pointcloud_map_loader.param.yaml
  • Modified README.md to refer to json schema files in the Parameters sections

Tests performed

Parameters of pointcloud map loader
screenshot_pointcloud_map_loader_param
Parameters of lanelet2 map loader
screenshot_lanelet2_map_loader_param

Effects on system behavior

None

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.

@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:map Map creation, storage, and loading. (auto-assigned) labels Jan 29, 2024
@anhnv3991 anhnv3991 changed the title chore(map_loader): Rework parameters of map_loader chore(map_loader): rework parameters of map_loader Jan 29, 2024
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jan 29, 2024
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.

Thank you for the pull request.
Please wait a little longer while we decide what to do with parameters such as pcd_paths_or_directory and pcd_metadata_path.

@SakodaShintaro
Copy link
Contributor

For arguments like file paths, we decided to use the following notation to maintain the previous behavior.
It should be given from the argument.
autowarefoundation/autoware-github-actions#232 (comment)

@YamatoAndo
Copy link
Contributor

@anhnv3991 Could you please submit this commit as a separate pull request?

@anhnv3991
Copy link
Contributor Author

@YamatoAndo If I does not add that commit , one of the CLI checks will fail.

@anhnv3991
Copy link
Contributor Author

@anhnv3991 Since we need to change the autoware_launch parameter at the same time, could you please create a pull request for that repository as well?

autoware_launch/config/map/lanelet2_map_loader.param.yaml and autoware_launch/config/map/pointcloud_map_loader.param.yaml must be changed.

https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/config/map/lanelet2_map_loader.param.yaml https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/config/map/pointcloud_map_loader.param.yaml

@SakodaShintaro How can I test those files after I made changes?

@SakodaShintaro
Copy link
Contributor

@anhnv3991

  • set autoware.universe to this branch (anhnv3991:chore/rework_param_map_loader)
  • set autoware_launch to a branch where you changed

Then, run autoware to check if it works properly. (logging_simulator in sample rosbag is often used)

If you submit a pull request to autoware_launch and paste the URL (draft is ok), I will check it. 😃

@github-actions github-actions bot removed the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Feb 1, 2024
@SakodaShintaro
Copy link
Contributor

SakodaShintaro commented Feb 2, 2024

@anhnv3991
I apologize for pointing this out in detail, but we have now decided to stop setting default values in declare_parameter. (This is because it becomes difficult to understand where the actual value is set.)

https://github.com/autowarefoundation/autoware.universe/blob/e2a5f4aed880b746b76c4c5d51927fb441ce4b3e/map/map_loader/src/lanelet2_map_loader/lanelet2_map_loader_node.cpp
I would appreciate it if you could fix this.

from

  declare_parameter("lanelet2_map_path", "");
  declare_parameter("center_line_resolution", 5.0);

to

  declare_parameter<std::string>("lanelet2_map_path");
  declare_parameter<double>("center_line_resolution");

And there is a parameter in lanelet2_map_visualization_node.

viz_lanelets_centerline_ = this->declare_parameter("viz_lanelets_centerline", true);

However, it is not a good idea to add a new param file and json file for this one parameter, so why not try writing true directly instead of using this value as a parameter?

from

  viz_lanelets_centerline_ = this->declare_parameter("viz_lanelets_centerline", true);

to

  viz_lanelets_centerline_ = true;

@YamatoAndo
What about the above changes? Is it better to create config and json properly?

@YamatoAndo
Copy link
Contributor

However, it is not a good idea to add a new param file and json file for this one parameter, so why not try writing true directly instead of using this value as a parameter?

from

viz_lanelets_centerline_ = this->declare_parameter("viz_lanelets_centerline", true);
to

viz_lanelets_centerline_ = true;

I agree with this proposal!

@SakodaShintaro SakodaShintaro added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Feb 7, 2024
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.

Thank you for the correction.
It has been confirmed that the logging_simulator runs with the same accuracy as before on AWSIM data with GT.
Looks Good To Me

When merging, please press the merge button at the same time as below
autowarefoundation/autoware_launch#843
(Strictly speaking, there is no problem even if PR at autoware_launch is merged first, so I think it would be a good idea to press the merge button of the PR at autoware_launch first.)

@anhnv3991 anhnv3991 enabled auto-merge (squash) February 7, 2024 04:27
@SakodaShintaro
Copy link
Contributor

@anhnv3991
Sorry, I forgot to check the map_loader test.

build-and-test-differential is failed. https://github.com/autowarefoundation/autoware.universe/actions/runs/7809902259/job/21302469469?pr=6199

I think it is good to fix a test code.

https://github.com/autowarefoundation/autoware.universe/blob/main/map/map_loader/test/lanelet2_map_loader_launch.test.py#L37

from

        parameters=[{"lanelet2_map_path": lanelet2_map_path}],

to

        parameters=[{
            "lanelet2_map_path": lanelet2_map_path,
            "center_line_resolution": 5.0,
        }],

The test can be confirmed by following commands.

cd ~/autoware
colcon build --symlink-install \
  --cmake-args \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_TESTING=ON \
    -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage' \
    -DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage' \
  --packages-select map_loader
colcon test --return-code-on-test-failure --packages-select map_loader
colcon test-result --all --verbose | grep map_loader

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (7e53f30) 14.86% compared to head (c0f23f7) 14.87%.
Report is 3 commits behind head on main.

Files Patch % Lines
...c/lanelet2_map_loader/lanelet2_map_loader_node.cpp 0.00% 0 Missing and 2 partials ⚠️
...et2_map_loader/lanelet2_map_visualization_node.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6199   +/-   ##
=======================================
  Coverage   14.86%   14.87%           
=======================================
  Files        1845     1845           
  Lines      126638   126613   -25     
  Branches    37878    37860   -18     
=======================================
  Hits        18828    18828           
+ Misses      86647    86624   -23     
+ Partials    21163    21161    -2     
Flag Coverage Δ *Carryforward flag
differential 26.60% <0.00%> (?)
total 14.87% <ø> (+<0.01%) ⬆️ Carriedforward from 7e53f30

*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.

@anhnv3991 anhnv3991 merged commit 9df0ff9 into autowarefoundation:main Feb 7, 2024
21 of 24 checks passed
StepTurtle pushed a commit to StepTurtle/autoware.universe that referenced this pull request Feb 28, 2024
…n#6199)

* Rework parameters of map_loader

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

* style(pre-commit): autofix

* Fixed typo in name of map_based_pediction.schema.json, which cause json-schema-check failed

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

* Move path variables back to launch files

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

* Update README.md

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

* Undo the change in perception

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

* Remove default values of declare_parameter from map_loader

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

---------

Signed-off-by: anhnv3991 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…n#6199)

* Rework parameters of map_loader

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

* style(pre-commit): autofix

* Fixed typo in name of map_based_pediction.schema.json, which cause json-schema-check failed

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

* Move path variables back to launch files

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

* Update README.md

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

* Undo the change in perception

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

* Remove default values of declare_parameter from map_loader

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

---------

Signed-off-by: anhnv3991 <[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:map Map creation, storage, and loading. (auto-assigned) tag: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