From 539fce7c9655bd6508b5a7b17b41374258c22c1d Mon Sep 17 00:00:00 2001 From: Zulfaqar Azmi Date: Thu, 9 Jan 2025 19:21:00 +0900 Subject: [PATCH 1/3] docs(lane_change): use json schema Signed-off-by: Zulfaqar Azmi --- .../README.md | 11 +-- .../schema/lane_change_abort.schema.json | 96 +++++++++++++++++++ 2 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json diff --git a/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/README.md b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/README.md index 0508dc753a2e8..e4b83d72ff217 100644 --- a/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/README.md +++ b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/README.md @@ -1044,16 +1044,7 @@ The following parameters are used to configure terminal lane change path feature The following parameters are configurable in `lane_change.param.yaml`. -| Name | Unit | Type | Description | Default value | -| :------------------------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------- | ------------- | -| `cancel.enable_on_prepare_phase` | [-] | boolean | Enable cancel lane change | true | -| `cancel.enable_on_lane_changing_phase` | [-] | boolean | Enable abort lane change. | false | -| `cancel.delta_time` | [s] | double | The time taken to start steering to return to the center line. | 3.0 | -| `cancel.duration` | [s] | double | The time taken to complete returning to the center line. | 3.0 | -| `cancel.max_lateral_jerk` | [m/sss] | double | The maximum lateral jerk for abort path | 1000.0 | -| `cancel.overhang_tolerance` | [m] | double | Lane change cancel is prohibited if the vehicle head exceeds the lane boundary more than this tolerance distance | 0.0 | -| `cancel.unsafe_hysteresis_threshold` | [-] | int | threshold that helps prevent frequent switching between safe and unsafe decisions | 10 | -| `cancel.deceleration_sampling_num` | [-] | int | Number of deceleration patterns to check safety to cancel lane change | 5 | +{{ json_to_markdown("planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json") }} ### Debug diff --git a/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json new file mode 100644 index 0000000000000..8a9514a9a9796 --- /dev/null +++ b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json @@ -0,0 +1,96 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "lane_change_abort", + "type": "object", + "definitions": { + "behavior_path_lane_change_module": { + "type": "object", + "properties": { + "cancel": { + "type": "object", + "properties": { + "enable_on_prepare_phase": { + "type": "boolean", + "description": "Enable cancel lane change.", + "units": "/", + "default": "true", + }, + "enable_on_lane_changing_phase": { + "type": "boolean", + "description": "Enable abort lane change.", + "units": "/", + "default": "true", + }, + "overhang_tolerance": { + "type": "number", + "description": "threshold to determine ego vehicle diverges from current lane.", + "units": "s", + "default": 0.0, + "minimum": 0.0 + }, + "delta_time": { + "type": "number", + "description": "The time taken to start steering to return to the center line.", + "units": "s", + "default": 2.0, + "minimum": 1.0, + "maximum": 3.0 + }, + "duration": { + "type": "number", + "description": "The time taken to complete returning to the center line.", + "units": "s", + "default": 2.0, + "minimum": 1.0, + "maximum": 3.0 + }, + "max_lateral_jerk": { + "type": "number", + "description": "The maximum lateral jerk for abort path.", + "units": "m/s3", + "default": 1000.0 + }, + "unsafe_hysteresis_threshold": { + "type": "integer", + "description": "threshold to determine ego vehicle diverges from current lane.", + "units": "/", + "default": 5, + "minimum": 1 + }, + "deceleration_sampling_num": { + "type": "integer", + "description": "threshold to determine ego vehicle diverges from current lane.", + "units": "/", + "default": 5, + "minimum": 1 + }, + }, + "required": ["enable_on_prepare_phase", "enable_on_lane_changing_phase", "overhang_tolerance", "delta_time", "duration", "max_lateral_jerk", "unsafe_hysteresis_threshold", "deceleration_sampling_num"], + "additionalProperties": false + }, + }, + "required": ["cancel"], + "additionalProperties": false + } + }, + "properties": { + "/**": { + "properties": { + "ros__parameters": { + "type": "object", + "properties": { + "avoidance": { + "$ref": "#/definitions/behavior_path_lane_change_module" + } + }, + "required": ["lane_change"], + "additionalProperties": false + } + }, + "required": ["ros__parameters"], + "additionalProperties": false + } + }, + "required": ["/**"], + "additionalProperties": false +} From 23fae4694338fcd60ac547bf0f1d68ab6641d29f Mon Sep 17 00:00:00 2001 From: Zulfaqar Azmi Date: Thu, 9 Jan 2025 19:31:45 +0900 Subject: [PATCH 2/3] precommit fix? Signed-off-by: Zulfaqar Azmi --- .../schema/lane_change_abort.schema.json | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json index 8a9514a9a9796..5c1b69ed95448 100644 --- a/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json +++ b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json @@ -12,18 +12,16 @@ "enable_on_prepare_phase": { "type": "boolean", "description": "Enable cancel lane change.", - "units": "/", - "default": "true", + "default": true }, "enable_on_lane_changing_phase": { "type": "boolean", "description": "Enable abort lane change.", - "units": "/", - "default": "true", + "default": true }, "overhang_tolerance": { "type": "number", - "description": "threshold to determine ego vehicle diverges from current lane.", + "description": "Threshold to determine ego vehicle diverges from the current lane.", "units": "s", "default": 0.0, "minimum": 0.0 @@ -47,27 +45,34 @@ "max_lateral_jerk": { "type": "number", "description": "The maximum lateral jerk for abort path.", - "units": "m/s3", + "units": "m/s³", "default": 1000.0 }, "unsafe_hysteresis_threshold": { "type": "integer", - "description": "threshold to determine ego vehicle diverges from current lane.", - "units": "/", + "description": "Threshold to determine ego vehicle diverges from the current lane.", "default": 5, "minimum": 1 }, "deceleration_sampling_num": { "type": "integer", - "description": "threshold to determine ego vehicle diverges from current lane.", - "units": "/", + "description": "Number of samples used for deceleration.", "default": 5, "minimum": 1 - }, + } }, - "required": ["enable_on_prepare_phase", "enable_on_lane_changing_phase", "overhang_tolerance", "delta_time", "duration", "max_lateral_jerk", "unsafe_hysteresis_threshold", "deceleration_sampling_num"], + "required": [ + "enable_on_prepare_phase", + "enable_on_lane_changing_phase", + "overhang_tolerance", + "delta_time", + "duration", + "max_lateral_jerk", + "unsafe_hysteresis_threshold", + "deceleration_sampling_num" + ], "additionalProperties": false - }, + } }, "required": ["cancel"], "additionalProperties": false @@ -75,11 +80,12 @@ }, "properties": { "/**": { + "type": "object", "properties": { "ros__parameters": { "type": "object", "properties": { - "avoidance": { + "lane_change": { "$ref": "#/definitions/behavior_path_lane_change_module" } }, From 46231f3ae37a8b4c283b72cc5f4fc63b0132c42b Mon Sep 17 00:00:00 2001 From: Zulfaqar Azmi Date: Fri, 10 Jan 2025 09:44:11 +0900 Subject: [PATCH 3/3] try adding units Signed-off-by: Zulfaqar Azmi --- .../schema/lane_change_abort.schema.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json index 5c1b69ed95448..4c5755c1311cd 100644 --- a/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json +++ b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/schema/lane_change_abort.schema.json @@ -11,41 +11,43 @@ "properties": { "enable_on_prepare_phase": { "type": "boolean", + "units": "s", "description": "Enable cancel lane change.", "default": true }, "enable_on_lane_changing_phase": { "type": "boolean", + "units": "s", "description": "Enable abort lane change.", "default": true }, "overhang_tolerance": { "type": "number", - "description": "Threshold to determine ego vehicle diverges from the current lane.", "units": "s", + "description": "Threshold to determine ego vehicle diverges from the current lane.", "default": 0.0, "minimum": 0.0 }, "delta_time": { "type": "number", - "description": "The time taken to start steering to return to the center line.", "units": "s", + "description": "The time taken to start steering to return to the center line.", "default": 2.0, "minimum": 1.0, "maximum": 3.0 }, "duration": { "type": "number", - "description": "The time taken to complete returning to the center line.", "units": "s", + "description": "The time taken to complete returning to the center line.", "default": 2.0, "minimum": 1.0, "maximum": 3.0 }, "max_lateral_jerk": { "type": "number", - "description": "The maximum lateral jerk for abort path.", "units": "m/s³", + "description": "The maximum lateral jerk for abort path.", "default": 1000.0 }, "unsafe_hysteresis_threshold": { @@ -56,6 +58,7 @@ }, "deceleration_sampling_num": { "type": "integer", + "units": "m/s³", "description": "Number of samples used for deceleration.", "default": 5, "minimum": 1