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

Feat/slow stop #77

Merged
merged 7 commits into from
Sep 13, 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
1 change: 0 additions & 1 deletion signage.repos
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
type: git
url: https://github.com/autowarefoundation/autoware_msgs.git
version: main
src/autoware_adapi_msgs:

Check warning on line 14 in signage.repos

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (adapi)
type: git
url: https://github.com/autowarefoundation/autoware_adapi_msgs.git
version: main
Expand All @@ -19,4 +19,3 @@
type: git
url: https://github.com/tier4/boot_shutdown_tools.git
version: main

41 changes: 41 additions & 0 deletions src/signage/resource/page/SlowStopView.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import QtQuick 2.9
import QtQuick.Controls 2.2

import "Common"

Rectangle {
id: slowStopView
width: viewController.monitor_width
height: viewController.monitor_height
color: "#ffffff"

CurrentTime {
id: displayCurrentTime
}

Text {
id: slowStopText
color: "#000000"
text: qsTr("安全確認のため停車中です")
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.verticalCenter
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pointSize: 80*viewController.size_ratio
font.bold: true
elide: Text.ElideMiddle
}

Text {
id: slowStopEnText
color: "#000000"
text: qsTr("Stop for safety check")
anchors.top: slowStopText.bottom
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pointSize: 80*viewController.size_ratio
font.bold: true
elide: Text.ElideMiddle
}
}
41 changes: 41 additions & 0 deletions src/signage/resource/page/SlowingView.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import QtQuick 2.9
import QtQuick.Controls 2.2

import "Common"

Rectangle {
id: slowingView
width: viewController.monitor_width
height: viewController.monitor_height
color: "#ffffff"

CurrentTime {
id: displayCurrentTime
}

Text {
id: slowingText
color: "#000000"
text: qsTr("減速します")
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.verticalCenter
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pointSize: 80*viewController.size_ratio
font.bold: true
elide: Text.ElideMiddle
}

Text {
id: slowingEnText
color: "#000000"
text: qsTr("Slowing Down")
anchors.top: slowingText.bottom
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pointSize: 80*viewController.size_ratio
font.bold: true
elide: Text.ElideMiddle
}
}
10 changes: 10 additions & 0 deletions src/signage/resource/page/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ Window {
visible: viewController.view_mode === "emergency_stopped"
}

SlowStopView {
id: slowStopView
visible: viewController.view_mode === "slow_stop"
}

SlowingView {
id: slowingView
visible: viewController.view_mode === "slowing"
}

ManualDriving {
id: manualDriving
visible: viewController.view_mode === "manual_driving"
Expand Down
27 changes: 20 additions & 7 deletions src/signage/src/signage/route_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from datetime import datetime
import signage.signage_utils as utils
from tier4_external_api_msgs.msg import DoorStatus
from autoware_adapi_v1_msgs.msg import (

Check warning on line 11 in src/signage/src/signage/route_handler.py

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (adapi)
RouteState,
MrmState,
OperationModeState,
Expand Down Expand Up @@ -58,6 +58,8 @@
self._prev_route_state = 0
self._skip_announce = False
self._announce_engage = False
self._in_slow_stop_state = False
self._in_slowing_state = False

self.process_station_list_from_fms()

Expand All @@ -72,10 +74,17 @@
if self._parameter.ignore_emergency:
in_emergency = False
else:
in_emergency = (
self._autoware.information.mrm_behavior == MrmState.EMERGENCY_STOP
or self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP
)
in_emergency = self._autoware.information.mrm_behavior == MrmState.EMERGENCY_STOP
tkhmy marked this conversation as resolved.
Show resolved Hide resolved

self._in_slowing_state = (
self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP
and self._autoware.information.motion_state == MotionState.MOVING
)

self._in_slow_stop_state = (
self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP
and self._autoware.information.motion_state == MotionState.STOPPED
)

if in_emergency and not self._in_emergency_state:
self._announce_interface.announce_emergency("emergency")
Expand Down Expand Up @@ -175,7 +184,7 @@
data.get("tags", []),
)

self.task_list = utils.seperate_task_list(data.get("tasks", []))
self.task_list = utils.separate_task_list(data.get("tasks", []))

if not self.task_list.doing_list and not self.task_list.todo_list:
self._schedule_details = utils.init_ScheduleDetails()
Expand All @@ -192,11 +201,11 @@
self._display_details.previous_station = ["", ""]
else:
self._display_details.previous_station = (
utils.get_prevous_station_name_from_fms(self.task_list.done_list)
utils.get_previous_station_name_from_fms(self.task_list.done_list)
)

if self._display_details.previous_station == ["", ""] and self.task_list.done_list:
self._display_details.previous_station = utils.get_prevous_station_name_from_fms(
self._display_details.previous_station = utils.get_previous_station_name_from_fms(
self.task_list.done_list
)

Expand Down Expand Up @@ -360,6 +369,10 @@
view_mode = "manual_driving"
elif self._in_emergency_state:
view_mode = "emergency_stopped"
elif self._in_slowing_state:
view_mode = "slowing"
elif self._in_slow_stop_state:
view_mode = "slow_stop"
elif self._is_stopping and self._current_task_details.departure_station != ["", ""]:
view_mode = "stopping"
elif self._is_driving and self._current_task_details.arrival_station != ["", ""]:
Expand Down
4 changes: 2 additions & 2 deletions src/signage/src/signage/signage_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_route_name(tag_list):
return split_name(route_name)


def seperate_task_list(task_list):
def separate_task_list(task_list):
doing_list = []
todo_list = []
done_list = []
Expand Down Expand Up @@ -126,7 +126,7 @@ def process_current_task(task):
return CurrentTask(departure_station, arrival_station, depart_time)


def get_prevous_station_name_from_fms(done_list):
def get_previous_station_name_from_fms(done_list):
previous_station_task = done_list[PREVIOUS_STATION_INDEX]
return split_name(previous_station_task.get("origin", "").get("name", DEFAULT_DEPARTURE_NAME))

Expand Down
Loading