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

[pull] main from autowarefoundation:main #424

Merged
merged 3 commits into from
Nov 23, 2023
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
@@ -0,0 +1,60 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for obstacle collision checker",
"type": "object",
"definitions": {
"vehicle_cmd_gate": {
"type": "object",
"properties": {
"delay_time": {
"type": "number",
"default": 0.3,
"description": "Delay time of vehicles."
},
"update_rate": {
"type": "number"
},
"footprint_margin": {
"type": "number",
"default": 0.0,
"description": "Foot print margin."
},
"max_deceleration": {
"type": "number",
"default": 2.0,
"description": "Max deceleration for ego vehicle to stop."
},
"resample_interval": {
"type": "number",
"default": 0.3,
"description": "Interval for resampling trajectory."
},
"search_radius": {
"type": "number",
"default": 5.0,
"description": "Search distance from trajectory to point cloud"
}
},
"required": [
"delay_time",
"footprint_margin",
"max_deceleration",
"resample_interval",
"search_radius",
"update_rate"
]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/obstacle_collision_checker"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def print_data(self):
print("-" * len(header_str))

# Print each topic's data
for topic, data in self.data_map.items():
for topic in sorted(self.data_map.keys()):
# Fetch the data for the current topic
data = self.data_map[topic]
# Round the data to the third decimal place for display
data_rounded = round(data, 3)
# Calculate the number of bars to be displayed (clamped to max_display_time)
Expand Down
15 changes: 1 addition & 14 deletions system/emergency_handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,7 @@ Emergency Handler is a node to select proper MRM from from system failure state

## Parameters

### Node Parameters

| Name | Type | Default Value | Explanation |
| ----------- | ---- | ------------- | ---------------------- |
| update_rate | int | `10` | Timer callback period. |

### Core Parameters

| Name | Type | Default Value | Explanation |
| --------------------------- | ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| timeout_hazard_status | double | `0.5` | If the input `hazard_status` topic cannot be received for more than `timeout_hazard_status`, vehicle will make an emergency stop. |
| use_parking_after_stopped | bool | `false` | If this parameter is true, it will publish PARKING shift command. |
| turning_hazard_on.emergency | bool | `true` | If this parameter is true, hazard lamps will be turned on during emergency state. |
| use_comfortable_stop | bool | `false` | If this parameter is true, operate comfortable stop when latent faults occur. |
{{ json_to_markdown("system/emergency_handler/schema/emergency_handler.schema.json") }}

## Assumptions / Known limits

Expand Down
77 changes: 77 additions & 0 deletions system/emergency_handler/schema/emergency_handler.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for emergency handler",
"type": "object",
"definitions": {
"emergency_handler": {
"type": "object",
"properties": {
"update_rate": {
"type": "integer",
"description": "Timer callback period.",
"default": 10
},
"timeout_hazard_status": {
"type": "number",
"description": "If the input `hazard_status` topic cannot be received for more than `timeout_hazard_status`, vehicle will make an emergency stop.",
"default": 0.5
},
"timeout_takeover_request": {
"type": "number",
"description": "Transition to MRR_OPERATING if the time from the last takeover request exceeds `timeout_takeover_request`.",
"default": 10.0
},
"use_takeover_request": {
"type": "boolean",
"description": "If this parameter is true, the handler will record the time and make take over request to the driver when emergency state occurs.",
"default": "false"
},
"use_parking_after_stopped": {
"type": "boolean",
"description": "If this parameter is true, it will publish PARKING shift command.",
"default": "false"
},
"use_comfortable_stop": {
"type": "boolean",
"description": "If this parameter is true, operate comfortable stop when latent faults occur.",
"default": "false"
},
"turning_hazard_on": {
"type": "object",
"properties": {
"emergency": {
"type": "boolean",
"description": "If this parameter is true, hazard lamps will be turned on during emergency state.",
"default": "true"
}
},
"required": ["emergency"]
}
},
"required": [
"update_rate",
"timeout_hazard_status",
"timeout_takeover_request",
"use_takeover_request",
"use_parking_after_stopped",
"use_comfortable_stop",
"turning_hazard_on"
],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/emergency_handler"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
EmergencyHandler::EmergencyHandler() : Node("emergency_handler")
{
// Parameter
param_.update_rate = declare_parameter<int>("update_rate", 10);
param_.timeout_hazard_status = declare_parameter<double>("timeout_hazard_status", 0.5);
param_.timeout_takeover_request = declare_parameter<double>("timeout_takeover_request", 10.0);
param_.use_takeover_request = declare_parameter<bool>("use_takeover_request", false);
param_.use_parking_after_stopped = declare_parameter<bool>("use_parking_after_stopped", false);
param_.use_comfortable_stop = declare_parameter<bool>("use_comfortable_stop", false);
param_.turning_hazard_on.emergency = declare_parameter<bool>("turning_hazard_on.emergency", true);
param_.update_rate = declare_parameter<int>("update_rate");
param_.timeout_hazard_status = declare_parameter<double>("timeout_hazard_status");
param_.timeout_takeover_request = declare_parameter<double>("timeout_takeover_request");
param_.use_takeover_request = declare_parameter<bool>("use_takeover_request");
param_.use_parking_after_stopped = declare_parameter<bool>("use_parking_after_stopped");
param_.use_comfortable_stop = declare_parameter<bool>("use_comfortable_stop");
param_.turning_hazard_on.emergency = declare_parameter<bool>("turning_hazard_on.emergency");

using std::placeholders::_1;

Expand Down