Skip to content

Commit

Permalink
Merge pull request #80 from tier4/stage
Browse files Browse the repository at this point in the history
merge main
  • Loading branch information
yabuta authored Sep 14, 2023
2 parents b0abbd3 + 5463eaf commit f1763b4
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 10 deletions.
1 change: 0 additions & 1 deletion signage.repos
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ repositories:
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 @@ -58,6 +58,8 @@ def __init__(
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 @@ 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_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 @@ 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()
Expand All @@ -192,11 +201,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
)

Expand Down Expand Up @@ -360,6 +369,10 @@ 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 != ["", ""]:
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

0 comments on commit f1763b4

Please sign in to comment.