From b700d40169e35dfb5b3db1ffe133b62d777ed9d0 Mon Sep 17 00:00:00 2001 From: tkhmy Date: Fri, 1 Sep 2023 13:52:51 +0900 Subject: [PATCH 1/7] add slow stop Signed-off-by: tkhmy --- src/signage/resource/page/SlowStopView.qml | 41 ++++++++++++++++++++++ src/signage/resource/page/main.qml | 5 +++ src/signage/src/signage/route_handler.py | 10 +++--- 3 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 src/signage/resource/page/SlowStopView.qml diff --git a/src/signage/resource/page/SlowStopView.qml b/src/signage/resource/page/SlowStopView.qml new file mode 100644 index 0000000..f3a2693 --- /dev/null +++ b/src/signage/resource/page/SlowStopView.qml @@ -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: "#ffff00" + + 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: autoDrivingEnText + color: "#000000" + text: qsTr("Slowing down. Please be careful") + anchors.top: autoDrivingText.bottom + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pointSize: 80*viewController.size_ratio + font.bold: true + elide: Text.ElideMiddle + } +} diff --git a/src/signage/resource/page/main.qml b/src/signage/resource/page/main.qml index 8331ef3..bb832df 100644 --- a/src/signage/resource/page/main.qml +++ b/src/signage/resource/page/main.qml @@ -19,6 +19,11 @@ Window { visible: viewController.view_mode === "emergency_stopped" } + SlowStopView { + id: slowStopView + visible: viewController.view_mode === "slow_stop" + } + ManualDriving { id: manualDriving visible: viewController.view_mode === "manual_driving" diff --git a/src/signage/src/signage/route_handler.py b/src/signage/src/signage/route_handler.py index d740bd3..fc94977 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -58,6 +58,7 @@ def __init__( self._prev_route_state = 0 self._skip_announce = False self._announce_engage = False + self._in_slow_stop_state = False self.process_station_list_from_fms() @@ -72,10 +73,9 @@ def emergency_checker_callback(self): 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 + + self._in_slow_stop_state = self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP if in_emergency and not self._in_emergency_state: self._announce_interface.announce_emergency("emergency") @@ -360,6 +360,8 @@ def view_mode_callback(self): view_mode = "manual_driving" elif self._in_emergency_state: view_mode = "emergency_stopped" + 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 != ["", ""]: From b66f374cb7bd2431c6c851feed88c8af69c11883 Mon Sep 17 00:00:00 2001 From: tkhmy Date: Fri, 1 Sep 2023 13:53:50 +0900 Subject: [PATCH 2/7] clean up Signed-off-by: tkhmy --- signage.repos | 1 - src/signage/src/signage/route_handler.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/signage.repos b/signage.repos index 5cfc7b1..d54faf1 100644 --- a/signage.repos +++ b/signage.repos @@ -19,4 +19,3 @@ repositories: type: git url: https://github.com/tier4/boot_shutdown_tools.git version: main - \ No newline at end of file diff --git a/src/signage/src/signage/route_handler.py b/src/signage/src/signage/route_handler.py index fc94977..e46ef33 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -75,7 +75,9 @@ def emergency_checker_callback(self): else: in_emergency = self._autoware.information.mrm_behavior == MrmState.EMERGENCY_STOP - self._in_slow_stop_state = self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP + self._in_slow_stop_state = ( + self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP + ) if in_emergency and not self._in_emergency_state: self._announce_interface.announce_emergency("emergency") From e6b817bc6e7f774daa193868dd3b69c8c2d7ae98 Mon Sep 17 00:00:00 2001 From: tkhmy Date: Fri, 1 Sep 2023 15:09:43 +0900 Subject: [PATCH 3/7] update phrases Signed-off-by: tkhmy --- src/signage/resource/page/SlowStopView.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/signage/resource/page/SlowStopView.qml b/src/signage/resource/page/SlowStopView.qml index f3a2693..f3e8a6f 100644 --- a/src/signage/resource/page/SlowStopView.qml +++ b/src/signage/resource/page/SlowStopView.qml @@ -7,7 +7,7 @@ Rectangle { id: slowStopView width: viewController.monitor_width height: viewController.monitor_height - color: "#ffff00" + color: "#ffffff" CurrentTime { id: displayCurrentTime @@ -16,7 +16,7 @@ Rectangle { Text { id: slowStopText color: "#000000" - text: qsTr("減速します。ご注意ください") + text: qsTr("減速します") anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.verticalCenter horizontalAlignment: Text.AlignHCenter @@ -29,7 +29,7 @@ Rectangle { Text { id: autoDrivingEnText color: "#000000" - text: qsTr("Slowing down. Please be careful") + text: qsTr("Slowing down") anchors.top: autoDrivingText.bottom anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter From a09d80c0d4fc6f8ddb612db6b50d1bd38fb34217 Mon Sep 17 00:00:00 2001 From: tkhmy Date: Tue, 5 Sep 2023 16:16:01 +0900 Subject: [PATCH 4/7] change condition Signed-off-by: tkhmy --- src/signage/resource/page/SlowStopView.qml | 4 ++-- src/signage/src/signage/route_handler.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/signage/resource/page/SlowStopView.qml b/src/signage/resource/page/SlowStopView.qml index f3e8a6f..175ffc3 100644 --- a/src/signage/resource/page/SlowStopView.qml +++ b/src/signage/resource/page/SlowStopView.qml @@ -16,7 +16,7 @@ Rectangle { Text { id: slowStopText color: "#000000" - text: qsTr("減速します") + text: qsTr("安全確認のため停車中です") anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.verticalCenter horizontalAlignment: Text.AlignHCenter @@ -29,7 +29,7 @@ Rectangle { Text { id: autoDrivingEnText color: "#000000" - text: qsTr("Slowing down") + text: qsTr("Stop for safety check") anchors.top: autoDrivingText.bottom anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter diff --git a/src/signage/src/signage/route_handler.py b/src/signage/src/signage/route_handler.py index e46ef33..2de654c 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -77,6 +77,7 @@ def emergency_checker_callback(self): 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: From f30c7afa62237c79ab4acb5ff207de80c4ed6c19 Mon Sep 17 00:00:00 2001 From: tkhmy Date: Tue, 5 Sep 2023 16:54:57 +0900 Subject: [PATCH 5/7] fix typo Signed-off-by: tkhmy --- src/signage/resource/page/SlowStopView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/signage/resource/page/SlowStopView.qml b/src/signage/resource/page/SlowStopView.qml index 175ffc3..ce11ace 100644 --- a/src/signage/resource/page/SlowStopView.qml +++ b/src/signage/resource/page/SlowStopView.qml @@ -27,10 +27,10 @@ Rectangle { } Text { - id: autoDrivingEnText + id: slowStopEnText color: "#000000" text: qsTr("Stop for safety check") - anchors.top: autoDrivingText.bottom + anchors.top: slowStopText.bottom anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter From 727b1f2f9f5a4de411d87490444d6bca6a9a5b7d Mon Sep 17 00:00:00 2001 From: tkhmy Date: Tue, 5 Sep 2023 17:01:51 +0900 Subject: [PATCH 6/7] fix typo Signed-off-by: tkhmy --- src/signage/src/signage/route_handler.py | 6 +++--- src/signage/src/signage/signage_utils.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/signage/src/signage/route_handler.py b/src/signage/src/signage/route_handler.py index 2de654c..206e25f 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -178,7 +178,7 @@ def process_station_list_from_fms(self, force_update=False): 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() @@ -195,11 +195,11 @@ def process_station_list_from_fms(self, force_update=False): 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 ) diff --git a/src/signage/src/signage/signage_utils.py b/src/signage/src/signage/signage_utils.py index fc1be90..2b95615 100644 --- a/src/signage/src/signage/signage_utils.py +++ b/src/signage/src/signage/signage_utils.py @@ -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 = [] @@ -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)) From 2be2237875cbaa637be810389701ae1c3fd5c1c8 Mon Sep 17 00:00:00 2001 From: tkhmy Date: Fri, 8 Sep 2023 14:51:01 +0900 Subject: [PATCH 7/7] add slwoing down Signed-off-by: tkhmy --- src/signage/resource/page/SlowingView.qml | 41 +++++++++++++++++++++++ src/signage/resource/page/main.qml | 5 +++ src/signage/src/signage/route_handler.py | 8 +++++ 3 files changed, 54 insertions(+) create mode 100644 src/signage/resource/page/SlowingView.qml diff --git a/src/signage/resource/page/SlowingView.qml b/src/signage/resource/page/SlowingView.qml new file mode 100644 index 0000000..b5193fc --- /dev/null +++ b/src/signage/resource/page/SlowingView.qml @@ -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 + } +} diff --git a/src/signage/resource/page/main.qml b/src/signage/resource/page/main.qml index bb832df..5249bb5 100644 --- a/src/signage/resource/page/main.qml +++ b/src/signage/resource/page/main.qml @@ -24,6 +24,11 @@ Window { visible: viewController.view_mode === "slow_stop" } + SlowingView { + id: slowingView + visible: viewController.view_mode === "slowing" + } + ManualDriving { id: manualDriving visible: viewController.view_mode === "manual_driving" diff --git a/src/signage/src/signage/route_handler.py b/src/signage/src/signage/route_handler.py index 206e25f..1aa7260 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -59,6 +59,7 @@ def __init__( 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() @@ -75,6 +76,11 @@ def emergency_checker_callback(self): else: in_emergency = self._autoware.information.mrm_behavior == MrmState.EMERGENCY_STOP + 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 @@ -363,6 +369,8 @@ def view_mode_callback(self): 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 != ["", ""]: