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(launch): add new option to select planning preset #680

Merged
merged 4 commits into from
Nov 8, 2023

Conversation

satoshi-ota
Copy link
Contributor

@satoshi-ota satoshi-ota commented Nov 7, 2023

Description

Add new option planning_module_preset so that it is able to switch launch modules more easily and flexibly.

ros2 launch autoware_launch planning_simulator.launch.xml map_path:=foo vehicle_model:=bar sensor_model:=baz planning_module_preset:=default
  <!-- launch module preset -->
  <arg name="planning_module_preset" default="default" description="planning module preset"/>

We can select launch modules in preset yaml file as follow. In addition, since we can manage launch modules by only one file, we don't have to create new branch in order to change launch modules.

...
  - arg:
      name: use_experimental_lane_change_function
      default: "true"

  - arg:
      name: launch_surround_obstacle_checker
      default: "true"

  - arg:
      name: motion_path_smoother_type
      default: elastic_band
      # option: elastic_band
      #         none

  - arg:
      name: motion_path_planner_type
      default: obstacle_avoidance_planner
      # option: obstacle_avoidance_planner
      #         path_sampler
      #         none

  - arg:
      name: motion_stop_planner_type
      default: obstacle_stop_planner
      # option: obstacle_stop_planner
      #         obstacle_cruise_planner
      #         none
...

How to add preset?

  1. create preset file <identification_name>_preset.yaml.
  2. put it under /autoware_launch/config/planning/preset/<identification_name>_preset.yaml.
  3. launch autoware with option planning_module_preset:=<identification_name>.

Tests performed

Effects on system behavior

Nothing.

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.

@satoshi-ota satoshi-ota force-pushed the feat/configurable-planning-preset branch from 8f7a7d6 to 7a762f4 Compare November 7, 2023 08:31
@satoshi-ota satoshi-ota marked this pull request as ready for review November 7, 2023 09:02
Comment on lines 23 to 25
default: "[behavior_velocity_planner::CrosswalkModulePlugin,
behavior_velocity_planner::WalkwayModulePlugin,
behavior_velocity_planner::TrafficLightModulePlugin,
Copy link
Contributor

Choose a reason for hiding this comment

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

In order to prevent duplicate descriptions and typos in the behavior_velocity_planner plugin, wouldn't it be better to write it in "commented out format" like before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tkimura4 Thanks for your comment. I think so. But it seems that it can't do comment out like this since this parameter is definded as a string.

  - arg:
      name: behavior_velocity_planner_launch_modules
      default: "[behavior_velocity_planner::CrosswalkModulePlugin,
        behavior_velocity_planner::WalkwayModulePlugin,
        behavior_velocity_planner::TrafficLightModulePlugin,
        behavior_velocity_planner::IntersectionModulePlugin,
      # behavior_velocity_planner::MergeFromPrivateModulePlugin,
        behavior_velocity_planner::BlindSpotModulePlugin,
        behavior_velocity_planner::DetectionAreaModulePlugin,
        behavior_velocity_planner::NoStoppingAreaModulePlugin,
        behavior_velocity_planner::StopLineModulePlugin,
        behavior_velocity_planner::OutOfLaneModulePlugin]"

Or do you have any workarounds...?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh... 😢 Sorry, I don't know the solution either.

In the current string format, is it easy to understand errors caused by duplicate plugin descriptions or typos?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh... 😢 Sorry, I don't know the solution either.

🙏

In the current string format, is it easy to understand errors caused by duplicate plugin descriptions or typos?

Umm...maybe... It may ouputs error message from node, I guess. 🤔

    RCLCPP_ERROR_STREAM(node.get_logger(), "The scene plugin '" << name << "' is not available.");

https://github.com/autowarefoundation/autoware.universe/blob/0d929d408eb3459962c9cd228421a826669705dc/planning/behavior_velocity_planner/src/planner_manager.cpp#L76

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 it has better use std::invalid_argument instead of RCLCPP_ERROR_STREAM in order to notice invalid launch config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tkimura4 I update xml so that it can align launch flag style in 096acd8.

@satoshi-ota satoshi-ota force-pushed the feat/configurable-planning-preset branch from 64891b6 to 74746d0 Compare November 8, 2023 03:35
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.

LGTM

@satoshi-ota satoshi-ota force-pushed the feat/configurable-planning-preset branch from ecdddb7 to bc6694a Compare November 8, 2023 14:14
@satoshi-ota satoshi-ota merged commit 0cd5d89 into main Nov 8, 2023
9 of 10 checks passed
@satoshi-ota satoshi-ota deleted the feat/configurable-planning-preset branch November 8, 2023 23:09
takayuki5168 referenced this pull request in tier4/autoware_launch Nov 26, 2023
@kosuke55
Copy link
Contributor

link universe pr
autowarefoundation/autoware.universe#5505

yuki-takagi-66 referenced this pull request in tier4/autoware_launch Jul 8, 2024
feat(behavior_path_planner): add yaw threshold param (autowarefoundation#1040)
mitukou1109 pushed a commit to mitukou1109/autoware_launch that referenced this pull request Nov 22, 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.

3 participants