Skip to content

Commit

Permalink
refactor(scenario_selector): rework parameters (#5218)
Browse files Browse the repository at this point in the history
* refactor(scenario_selector): rework parameters

Signed-off-by: PhoebeWu21 <[email protected]>

* style(pre-commit): autofix

* refactor(scenario_selector): rework parameters

Signed-off-by: PhoebeWu21 <[email protected]>

* refactor(scenario_selector): rework parameters

Signed-off-by: PhoebeWu21 <[email protected]>

---------

Signed-off-by: PhoebeWu21 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
PhoebeWu21 and pre-commit-ci[bot] authored Nov 23, 2023
1 parent 033edff commit 27ac617
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 13 deletions.
1 change: 1 addition & 0 deletions planning/scenario_selector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ endif()

ament_auto_package(INSTALL_TO_SHARE
launch
config
)
8 changes: 1 addition & 7 deletions planning/scenario_selector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ None

### Parameters

| Parameter | Type | Description |
| -------------------------- | ------ | ------------------------------------------------------------------------------- |
| `update_rate` | double | timer's update rate |
| `th_max_message_delay_sec` | double | threshold time of input messages' maximum delay |
| `th_arrived_distance_m` | double | threshold distance to check if vehicle has arrived at the trajectory's endpoint |
| `th_stopped_time_sec` | double | threshold time to check if vehicle is stopped |
| `th_stopped_velocity_mps` | double | threshold velocity to check if vehicle is stopped |
{{ json_to_markdown("planning/scenario_selector/schema/scenario_selector.schema.json") }}

### Flowchart

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**:
ros__parameters:
update_rate: 10.0
th_max_message_delay_sec: 1.0
th_arrived_distance_m: 1.0
th_stopped_time_sec: 1.0
th_stopped_velocity_mps: 0.01
10 changes: 4 additions & 6 deletions planning/scenario_selector/launch/scenario_selector.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

<arg name="output_scenario"/>
<arg name="output_trajectory"/>
<!-- Parameter -->
<arg name="config_file" default="$(find-pkg-share scenario_selector)/config/scenario_selector.param.yaml"/>

<node pkg="scenario_selector" exec="scenario_selector" name="scenario_selector" output="screen">
<remap from="input/lane_driving/trajectory" to="$(var input_lane_driving_trajectory)"/>
Expand All @@ -19,11 +21,7 @@

<remap from="output/scenario" to="$(var output_scenario)"/>
<remap from="output/trajectory" to="$(var output_trajectory)"/>

<param name="update_rate" value="10.0"/>
<param name="th_max_message_delay_sec" value="1.0"/>
<param name="th_arrived_distance_m" value="1.0"/>
<param name="th_stopped_time_sec" value="1.0"/>
<param name="th_stopped_velocity_mps" value="0.01"/>
<!-- Parameter -->
<param from="$(var config_file)"/>
</node>
</launch>
61 changes: 61 additions & 0 deletions planning/scenario_selector/schema/scenario_selector.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Scenario Selector Node",
"type": "object",
"definitions": {
"scenario_selector": {
"type": "object",
"properties": {
"update_rate": {
"type": "number",
"description": "timer's update rate",
"default": "10.0",
"minimum": 0.0
},
"th_max_message_delay_sec": {
"type": "number",
"description": "threshold time of input messages' maximum delay",
"default": "1.0",
"minimum": 0.0
},
"th_arrived_distance_m": {
"type": "number",
"description": "threshold distance to check if vehicle has arrived at the trajectory's endpoint",
"default": "1.0",
"minimum": 0.0
},
"th_stopped_time_sec": {
"type": "number",
"description": "threshold time to check if vehicle is stopped",
"default": "1.0",
"minimum": 0.0
},
"th_stopped_velocity_mps": {
"type": "number",
"description": "threshold velocity to check if vehicle is stopped",
"default": "0.01",
"minimum": 0.0
}
},
"required": [
"update_rate",
"th_max_message_delay_sec",
"th_arrived_distance_m",
"th_stopped_time_sec",
"th_stopped_velocity_mps"
]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/scenario_selector"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}

0 comments on commit 27ac617

Please sign in to comment.