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

fix(tier4_control_component_launch): fix duplicate declaration of controller parameter paths #940

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

xuyuan-han
Copy link
Contributor

@xuyuan-han xuyuan-han commented Mar 31, 2024

Description

see #728

Tests performed

In autoware.launch.xml:

  <arg name="lat_controller_param_path" default="<path_to_arbitrary_lateral_controller_param_file>" description="lateral controller configuration file location"/>
  <arg name="lon_controller_param_path" default="<path_to_arbitrary_longitudinal_controller_param_file>" description="longitudinal controller configuration file location"/>
  <!-- Control -->
  <group if="$(var launch_control)">
    <include file="$(find-pkg-share autoware_launch)/launch/components/tier4_control_component.launch.xml"/>
      <arg name="lat_controller_param_path" value="$(var lat_controller_param_path)"/>
      <arg name="lon_controller_param_path" value="$(var lon_controller_param_path)"/>
  </group>

Effects on system behavior

After fixing, arbitrary lateral and longitudinal controller parameter file paths can be specified in the group Control in autoware.launch.xml and can be passed to tier4_control_component.launch.xml

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.

Comment on lines 13 to 21
<arg
name="lat_controller_param_path"
default="$(find-pkg-share autoware_launch)/config/control/trajectory_follower/$(var latlon_controller_param_path_dir)/lateral/$(var lateral_controller_mode).param.yaml"
/>
<arg
name="lon_controller_param_path"
default="$(find-pkg-share autoware_launch)/config/control/trajectory_follower/$(var latlon_controller_param_path_dir)/longitudinal/$(var longitudinal_controller_mode).param.yaml"
/>

Copy link
Contributor

Choose a reason for hiding this comment

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

How about removing the following instead?

  <arg name="lat_controller_param_path" value="$(var lat_controller_param_path)"/>
   <arg name="lon_controller_param_path" value="$(var lon_controller_param_path)"/>

Copy link
Contributor

Choose a reason for hiding this comment

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

Please assign the PR to me once you fixed it.

Copy link
Contributor Author

@xuyuan-han xuyuan-han Apr 9, 2024

Choose a reason for hiding this comment

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

  <arg
    name="lat_controller_param_path"
    default="$(find-pkg-share autoware_launch)/config/control/trajectory_follower/$(var latlon_controller_param_path_dir)/lateral/$(var lateral_controller_mode).param.yaml"
  />
  <arg
    name="lon_controller_param_path"
    default="$(find-pkg-share autoware_launch)/config/control/trajectory_follower/$(var latlon_controller_param_path_dir)/longitudinal/$(var longitudinal_controller_mode).param.yaml"
  />

The purpose of moving these lines above the <include file="$(find-pkg-share tier4_control_launch)/launch/control.launch.py"> is to allow the arguments to be accessible to other launch files. This enables other launch files to pass the entire parameter file path, instead of just the vehicle_id, to tier4_control_component.launch.xml. In our practice, we prefer to store the controller parameter file in a separate folder, rather than in autoware_launch/config/control/trajectory_follower/...

If exposing these arguments does not align with your requirements, simply removing the lines you suggest is the way to go.

The changes made in this pull request are intended to fix the issue. By the way, it appears that I don't have the necessary permissions to assign the pull request.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I know.
I proposed a better way to fix it. Do you mean my proposal will not fix the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, exposing these arguments in the manner I did is not permitted?

Copy link
Contributor

Choose a reason for hiding this comment

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

I got it.

Let me check again.
The ideal design is exposing only the lat_controller_param_path_dir. Why does this not work in your case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In our project, we have our own launch package as ROS overlay above the Autoware workspace. Our launch package contains only our_launch/launch/planning_simulator.launch.xml and our_launch/launch/autoware.launch.xml. These two launch files call the low-level ROS underlay launch files in autoware_launch/launch/components /components such as tier4_control_component.launch.xml. The idea behind this is to minimize file duplication and merge workload, and to exploit the ROS underlay-overlay feature.

So if the whole lat/lon_param_path can be exposed, we can keep our own lat/lon param files in our_launch/config and let it be passed to the component launch file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then, how about moving your project's lat/long parameter files in the same way as autoware_launch.
This concealing parameter's path is also applied to other components like tier4_planning_component.launch.xml, and if the specific project wants to change this method, we should create a github discussion to discuss on a larger scale.

Or you can copy tier4_control_component.launch.xml for your project and modify it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. Currently we copy and modify tier4_control_component.launch.xml for our project.
So I will follow your solution to remove the following instead.

   <arg name="lat_controller_param_path" value="$(var lat_controller_param_path)"/>
   <arg name="lon_controller_param_path" value="$(var lon_controller_param_path)"/>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is done. Could you please review the code again and approve the PR?

@takayuki5168 takayuki5168 self-assigned this Apr 1, 2024
@takayuki5168 takayuki5168 removed their assignment Apr 9, 2024
xuyuan-han

This comment was marked as duplicate.

@xuyuan-han xuyuan-han changed the title fix(tier4_control_component_launch): fix duplicate declaration of controller parameter paths fix(tier4_control_component_launch): expose lat/lon param path & fix duplicate declaration of controller parameter paths Apr 9, 2024
@xuyuan-han xuyuan-han changed the title fix(tier4_control_component_launch): expose lat/lon param path & fix duplicate declaration of controller parameter paths feat(tier4_control_component_launch): expose lat/lon param path & fix duplicate declaration of controller parameter paths Apr 9, 2024
@xuyuan-han xuyuan-han closed this Apr 9, 2024
…troller parameter paths

Signed-off-by: Xuyuan Han <xuyuan.han@outlook.com>
@xuyuan-han xuyuan-han changed the title feat(tier4_control_component_launch): expose lat/lon param path & fix duplicate declaration of controller parameter paths fix(tier4_control_component_launch): fix duplicate declaration of controller parameter paths Apr 9, 2024
@xuyuan-han xuyuan-han reopened this Apr 9, 2024
Copy link
Contributor

@takayuki5168 takayuki5168 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@xuyuan-han xuyuan-han requested a review from takayuki5168 April 9, 2024 17:34
@xuyuan-han
Copy link
Contributor Author

Why does the task build-and-test-differential / clang-tidy-differential (pull_request) fail?

@takayuki5168
Copy link
Contributor

@xuyuan-han The required build passed. Now you can merge.

@xuyuan-han
Copy link
Contributor Author

I don't have write access permission to merge the code. Can you help with this? @takayuki5168

@takayuki5168 takayuki5168 merged commit c844a88 into autowarefoundation:main Apr 9, 2024
14 of 17 checks passed
@takayuki5168
Copy link
Contributor

Okay, I did.

yuki-takagi-66 pushed a commit to tier4/autoware_launch that referenced this pull request Sep 17, 2024
Ericpotato added a commit to tier4/autoware_launch that referenced this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants