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

refactor(costmap_generator): rework parameters #4695

Conversation

yuntianyi-chen
Copy link
Contributor

@yuntianyi-chen yuntianyi-chen commented Aug 22, 2023

Description

Refactor the ROS Node configuration layout for the costmap_generator package according to the guideline.

  • Create the schema and parameter files.
  • Remove the default values from the source code to avoid duplication.
  • Update the README.md file as to how to launch the node.

Related links

None

Tests performed

The refactored node was successfully built and tested by launching this node individually.

The running result is shown below:
costmap_generator_test_results

tier4 internal scenarios
https://evaluation.tier4.jp/evaluation/reports/9477bdda-3c75-5953-9554-e9191df8f9d7?project_id=prd_jt
1680/1683

Notes for reviewers

It seems like the planning/costmap_generator/config/costmap_generator.param.yaml file cannot be automatically copied to the autoware/install/costmap_generator/share/config directory after building the package. Since we use find-pkg-share in the costmap_generator.launch.xml file to link the costmap_generator.param.yaml file, I have to manually copy the .param.yaml file to the share/config directory to make it work. I think we need to modify the CMakeLists.txt file to implement the copying, which I discussed here.

Interface changes

  • Create two configuration files planning/costmap_generator/config/costmap_generator.param.yaml and planning/costmap_generator/schema/costmap_generator.schema.json
  • Parameter values are now required to be passed to the node when launched.

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.

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

yuntianyi-chen and others added 5 commits August 21, 2023 01:24
…ing to the new ROS node config guideline

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
…m:yuntianyi-chen/autoware.universe into 3239-refactor-ros-cofig-costmap_generator
@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:planning Route planning, decision-making, and navigation. (auto-assigned) labels Aug 22, 2023
…en building the package.

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
vehicle_frame: "base_link"
map_frame: "map"
update_rate: 10.0
activate_by_scenario: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I was not finding activate_by_scenario in the parameters removed from the launch file, so I was wondering how a declare_parameter on this option could work without a default value. I suppose this launch file was getting used exclusively through the parking pipeline at

.

I expect that way of setting the parameters won't have any effect anymore, right? In which case the parking.launch.py file should probably also be updated as part of this PR.

Additionally, because this was the only place where activate_by_scenario was set, should false be kept as the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the description ("if true, activate by scenario = parking. Otherwise, activate if vehicle is inside parking lot."), I think the default value should be set by the current scenario the vehicle is in.

I set it to True according to the default values of the previous .cpp file, which was already deleted.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see. Makes sense.

What about updating autoware.universe/launch/tier4_planning_launch/launch/scenario_planning/parking.launch.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we need to update the autoware.universe/launch/tier4_planning_launch/launch/scenario_planning/parking.launch.py as well.

I've modified that .py file. Shall we still keep the activate_by_scenario = true in the launch.xml/schema.json/param.yaml of the planning/costmap_generator directory?

Copy link
Contributor

Choose a reason for hiding this comment

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

The default in the schema is an annotation. It will be used eventually to render the documentation from it, but it doesn't enforce anything in software. So it doesn't matter so much, true is fine.

Actually, for the modification in parking.launch.py I had in mind of replacing the list of parameters with a reference to the config file of this package instead, in the same way you do for this package's launch file. Not just replacing the value of activate_by_scenario.

Copy link
Contributor

@ambroise-arm ambroise-arm Aug 31, 2023

Choose a reason for hiding this comment

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

On second thought, I don't know if the tier4 package will want to use the defaults from another package that it doesn't control. Not sure what the best solution is.

@satoshi-ota I think it relates to the point you raise at #4699 (comment). Except here it (probably) doesn't break the launch of anything if we leave it as it currently is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we'd better keep only one configuration file that controls the node. Having the same set of parameters in two different places would cause some biases or inconsistencies.

Copy link
Contributor

Choose a reason for hiding this comment

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

The configuration file in the package's source directory is just a default one, it doesn't have to be used by other packages. They can define their own. Which is what happens with the tier4 package here (except the values are in their launch file, not in a dedicated file). So before changing it, I'd like to know what tier4 code owners think of it.

Copy link
Contributor

@kosuke55 kosuke55 Nov 30, 2023

Choose a reason for hiding this comment

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

currently the default value of activate_by_scenario was removed and set only in laucher side autowarefoundation/autoware_launch#679.

And we need to set it false for pull over of lane driving scenario.

#2879

so could you please set false?

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
@github-actions github-actions bot added the component:launch Launch files, scripts and initialization tools. (auto-assigned) label Aug 30, 2023
@@ -1,3 +1,15 @@
<!--
Copyright 2021-2023 UCI SORA Lab, the Autoware Foundation
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding the copyright notice to the launch file.
However, since some parts of the code comes from different author (prehaps TIER IV), we might want to have the original author mentioned as well in the notice.

Copy link
Member

Choose a reason for hiding this comment

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

For the policy on copyright notice, let's discuss in today's Open AD Kit meeting.

Copy link
Member

Choose a reason for hiding this comment

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

Conclusion from the WG discussion is posted in this issue
#2652

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The copyright notice has been modified.

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
Copy link

stale bot commented Nov 21, 2023

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Nov 21, 2023
….universe into refactor-ros-config-costmap_generator

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
@stale stale bot removed the status:stale Inactive or outdated issues. (auto-assigned) label Nov 24, 2023
@satoshi-ota
Copy link
Contributor

@yuntianyi-chen parking.launch.py was removed. So please rebase or update your branch? Thank you for your cooperation.

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
@github-actions github-actions bot removed the component:launch Launch files, scripts and initialization tools. (auto-assigned) label Nov 29, 2023
@yuntianyi-chen
Copy link
Contributor Author

@yuntianyi-chen parking.launch.py was removed. So please rebase or update your branch? Thank you for your cooperation.

Thanks for noticing! I just removed this file.

vehicle_frame: "base_link"
map_frame: "map"
update_rate: 10.0
activate_by_scenario: true
Copy link
Contributor

@kosuke55 kosuke55 Nov 30, 2023

Choose a reason for hiding this comment

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

currently the default value of activate_by_scenario was removed and set only in laucher side autowarefoundation/autoware_launch#679.

And we need to set it false for pull over of lane driving scenario.

#2879

so could you please set false?

Copy link
Contributor

@kosuke55 kosuke55 left a comment

Choose a reason for hiding this comment

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

thanks! LGTM!

@satoshi-ota satoshi-ota added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 2, 2023
@satoshi-ota satoshi-ota enabled auto-merge (squash) December 2, 2023 04:07
Copy link

codecov bot commented Dec 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (765a596) 15.32% compared to head (e3438fc) 31.57%.
Report is 134 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4695       +/-   ##
===========================================
+ Coverage   15.32%   31.57%   +16.25%     
===========================================
  Files        1721        6     -1715     
  Lines      118559      532   -118027     
  Branches    37995      137    -37858     
===========================================
- Hits        18169      168    -18001     
+ Misses      79657      285    -79372     
+ Partials    20733       79    -20654     
Flag Coverage Δ
differential 31.57% <ø> (?)
total ?

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

@satoshi-ota satoshi-ota merged commit c9ceaab into autowarefoundation:main Dec 2, 2023
danielsanchezaran pushed a commit to tier4/autoware.universe that referenced this pull request Dec 15, 2023
* refactor the configuration files of the node costmap_generator according to the new ROS node config guideline

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* style(pre-commit): autofix

* update the organization name in the copyright license

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* Modify the CMakeLists.txt file to enalbe /config directory sharing when building the package.

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* Update the schema file according to the review.

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* Update a parameter in the parking.launch.py file.

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* revert copyright info

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* style(pre-commit): autofix

* delete parking.launch.py file

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* Update planning/costmap_generator/config/costmap_generator.param.yaml

Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>

* Update planning/costmap_generator/schema/costmap_generator.schema.json

Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>

---------

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
* refactor the configuration files of the node costmap_generator according to the new ROS node config guideline

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* style(pre-commit): autofix

* update the organization name in the copyright license

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* Modify the CMakeLists.txt file to enalbe /config directory sharing when building the package.

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* Update the schema file according to the review.

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* Update a parameter in the parking.launch.py file.

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* revert copyright info

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* style(pre-commit): autofix

* delete parking.launch.py file

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>

* Update planning/costmap_generator/config/costmap_generator.param.yaml

Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>

* Update planning/costmap_generator/schema/costmap_generator.schema.json

Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>

---------

Signed-off-by: yuntianyi-chen <yuntianyichen@outlook.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
Signed-off-by: karishma <karishma@interpl.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) 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.

5 participants