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(autoware_behavior_velocity_planner_common,autoware_behavior_velocity_planner): separate param files #9470

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
<param from="$(var velocity_smoother_param_path)"/>
<param from="$(var behavior_velocity_smoother_type_param_path)"/>
<param from="$(var behavior_velocity_planner_common_param_path)"/>
<param from="$(var behavior_velocity_planner_param_path)"/>
<param name="launch_modules" value="$(var behavior_velocity_planner_launch_modules)"/>
<param name="enable_all_modules_auto_mode" value="$(var enable_all_modules_auto_mode)"/>
<param name="is_simulation" value="$(var is_simulation)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@
backward_path_length: 5.0
behavior_output_path_interval: 1.0
stop_line_extend_length: 5.0
max_accel: -2.8
max_jerk: -5.0
system_delay: 0.5
delay_response_time: 0.5
is_publish_debug_path: false # publish all debug path with lane id in each module
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<!-- module config path -->
<arg name="behavior_velocity_config_path"/>
<arg name="behavior_velocity_smoother_type_param_path"/>
<arg name="behavior_velocity_planner_param_path"/>
<arg name="behavior_velocity_planner_common_param_path"/>
<arg name="behavior_velocity_planner_blind_spot_module_param_path"/>
<arg name="behavior_velocity_planner_crosswalk_module_param_path"/>
Expand All @@ -26,7 +27,6 @@
<arg name="behavior_velocity_planner_speed_bump_module_param_path"/>
<arg name="behavior_velocity_planner_no_drivable_lane_module_param_path"/>
<!-- <arg name="behavior_velocity_planner_template_module_param_path"/> -->
<arg name="behavior_velocity_planner_param_file" default="$(find-pkg-share behavior_velocity_planner)/config/behavior_velocity_planner.param.yaml"/>

<node pkg="autoware_behavior_velocity_planner" exec="behavior_velocity_planner_node" name="behavior_velocity_planner" output="screen">
<!-- topic remap -->
Expand All @@ -53,6 +53,7 @@
<param from="$(var vehicle_param_file)"/>
<param from="$(var nearest_search_param_path)"/>
<param from="$(var behavior_velocity_smoother_type_param_path)"/>
<param from="$(var behavior_velocity_planner_param_path)"/>
<param from="$(var behavior_velocity_planner_common_param_path)"/>
<param from="$(var behavior_velocity_planner_blind_spot_module_param_path)"/>
<param from="$(var behavior_velocity_planner_crosswalk_module_param_path)"/>
Expand All @@ -68,7 +69,5 @@
<param from="$(var behavior_velocity_planner_speed_bump_module_param_path)"/>
<param from="$(var behavior_velocity_planner_no_drivable_lane_module_param_path)"/>
<!-- <param from="$(var behavior_velocity_planner_template_param_path)"/> -->

<param from="$(var behavior_velocity_planner_param_file)"/>
</node>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,17 @@
"default": "1.0",
"description": "the output path will be interpolated by this interval"
},
"max_accel": {
"type": "number",
"default": "-2.8",
"description": "(to be a global parameter) max acceleration of the vehicle"
},
"system_delay": {
"type": "number",
"default": "0.5",
"description": "(to be a global parameter) delay time until output control command"
},
"delay_response_time": {
"type": "number",
"default": "0.5",
"description": "(to be a global parameter) delay time of the vehicle's response to control commands"
},
"stop_line_extend_length": {
"type": "number",
"default": "5.0",
"description": "extend length of stop line"
},
"max_jerk": {
"type": "number",
"default": "-5.0",
"description": "max jerk of the vehicle"
},
"is_publish_debug_path": {
"type": "boolean",
"default": "false",
"description": "is publish debug path?"
}
},
"required": [
"forward_path_length",
"behavior_output_path_interval",
"backward_path_length",
"max_accel",
"system_delay",
"delay_response_time",
"stop_line_extend_length",
"max_jerk",
"is_publish_debug_path"
"stop_line_extend_length"
],
"additionalProperties": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()

const auto autoware_test_utils_dir =
ament_index_cpp::get_package_share_directory("autoware_test_utils");
const auto behavior_velocity_planner_common_dir =
ament_index_cpp::get_package_share_directory("autoware_behavior_velocity_planner_common");
const auto behavior_velocity_planner_dir =
ament_index_cpp::get_package_share_directory("autoware_behavior_velocity_planner");
const auto velocity_smoother_dir =
Expand Down Expand Up @@ -82,25 +84,27 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
node_options.parameter_overrides(params);

autoware::test_utils::updateNodeOptions(
node_options, {autoware_test_utils_dir + "/config/test_common.param.yaml",
autoware_test_utils_dir + "/config/test_nearest_search.param.yaml",
autoware_test_utils_dir + "/config/test_vehicle_info.param.yaml",
velocity_smoother_dir + "/config/default_velocity_smoother.param.yaml",
velocity_smoother_dir + "/config/Analytical.param.yaml",
behavior_velocity_planner_dir + "/config/behavior_velocity_planner.param.yaml",
get_behavior_velocity_module_config("blind_spot"),
get_behavior_velocity_module_config("crosswalk"),
get_behavior_velocity_module_config("walkway"),
get_behavior_velocity_module_config("detection_area"),
get_behavior_velocity_module_config("intersection"),
get_behavior_velocity_module_config("no_stopping_area"),
get_behavior_velocity_module_config("occlusion_spot"),
get_behavior_velocity_module_config("run_out"),
get_behavior_velocity_module_config("speed_bump"),
get_behavior_velocity_module_config("stop_line"),
get_behavior_velocity_module_config("traffic_light"),
get_behavior_velocity_module_config("virtual_traffic_light"),
get_behavior_velocity_module_config("no_drivable_lane")});
node_options,
{autoware_test_utils_dir + "/config/test_common.param.yaml",
autoware_test_utils_dir + "/config/test_nearest_search.param.yaml",
autoware_test_utils_dir + "/config/test_vehicle_info.param.yaml",
velocity_smoother_dir + "/config/default_velocity_smoother.param.yaml",
velocity_smoother_dir + "/config/Analytical.param.yaml",
behavior_velocity_planner_common_dir + "/config/behavior_velocity_planner_common.param.yaml",
behavior_velocity_planner_dir + "/config/behavior_velocity_planner.param.yaml",
get_behavior_velocity_module_config("blind_spot"),
get_behavior_velocity_module_config("crosswalk"),
get_behavior_velocity_module_config("walkway"),
get_behavior_velocity_module_config("detection_area"),
get_behavior_velocity_module_config("intersection"),
get_behavior_velocity_module_config("no_stopping_area"),
get_behavior_velocity_module_config("occlusion_spot"),
get_behavior_velocity_module_config("run_out"),
get_behavior_velocity_module_config("speed_bump"),
get_behavior_velocity_module_config("stop_line"),
get_behavior_velocity_module_config("traffic_light"),
get_behavior_velocity_module_config("virtual_traffic_light"),
get_behavior_velocity_module_config("no_drivable_lane")});

// TODO(Takagi, Isamu): set launch_modules
// TODO(Kyoichi Sugahara) set to true launch_virtual_traffic_light
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ if(BUILD_TESTING)
)
endif()

ament_auto_package()
ament_auto_package(INSTALL_TO_SHARE
config
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**:
ros__parameters:
max_accel: -2.8
max_jerk: -5.0
system_delay: 0.5
delay_response_time: 0.5
is_publish_debug_path: false # publish all debug path with lane id in each module
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Behavior Velocity Planner Common",
"type": "object",
"definitions": {
"behavior_velocity_planner_common": {
"type": "object",
"properties": {
"max_accel": {
"type": "number",
"default": "-2.8",
"description": "(to be a global parameter) max acceleration of the vehicle"
},
"system_delay": {
"type": "number",
"default": "0.5",
"description": "(to be a global parameter) delay time until output control command"
},
"delay_response_time": {
"type": "number",
"default": "0.5",
"description": "(to be a global parameter) delay time of the vehicle's response to control commands"
},
"max_jerk": {
"type": "number",
"default": "-5.0",
"description": "max jerk of the vehicle"
},
"is_publish_debug_path": {
"type": "boolean",
"default": "false",
"description": "is publish debug path?"
}
},
"required": [
"max_accel",
"system_delay",
"delay_response_time",
"max_jerk",
"is_publish_debug_path"
],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/behavior_velocity_planner_common"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_params_from_yaml():
# get parameters from behavior velocity planner
behavior_vel_yaml_file_path = os.path.join(
autoware_launch_package_path,
"config/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/behavior_velocity_planner.param.yaml",
"config/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/behavior_velocity_planner_common.param.yaml",
)
with open(behavior_vel_yaml_file_path, "r") as yaml_file:
params = yaml.safe_load(yaml_file)
Expand Down
Loading