diff --git a/src/signage/src/signage/ros_service_interface.py b/src/signage/src/signage/ros_service_interface.py index 20720ef..d8f7dc1 100644 --- a/src/signage/src/signage/ros_service_interface.py +++ b/src/signage/src/signage/ros_service_interface.py @@ -23,17 +23,20 @@ class RosServiceInterface: - def __init__(self, node): + def __init__(self, node, parameter_interface): self._node = node self._created_client_dict = {} self._lock = threading.RLock() - self._cli_accept_start = self.__create_client(AcceptStart, "/api/motion/accept_start") + self._parameter = parameter_interface.parameter + if self._parameter.signage_stand_alone: + self._cli_accept_start = self.__create_client(AcceptStart, "/api/motion/accept_start") # service call function def accept_start(self): - request = AcceptStart.Request() - self.__service_call(self._cli_accept_start, request, True) + if self._parameter.signage_stand_alone: + request = AcceptStart.Request() + self.__service_call(self._cli_accept_start, request, True) # common denominator def __create_client(self, service_type, service_name): diff --git a/src/signage/src/signage/route_handler.py b/src/signage/src/signage/route_handler.py index 884d9a1..a611bdc 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -152,6 +152,9 @@ def process_station_list_from_fms(self, force_update=False): data = json.loads(respond.text) if not data: + self._schedule_details = utils.init_ScheduleDetails() + self._display_details = utils.init_DisplayDetails() + self._current_task_details = utils.init_CurrentTask() raise Exception("No data from fms") elif utils.check_schedule_update(self._schedule_details, data) and not force_update: self._fms_check_time = self._node.get_clock().now() @@ -166,6 +169,9 @@ def process_station_list_from_fms(self, force_update=False): self.task_list = utils.seperate_task_list(data.get("tasks", [])) if not self.task_list.doing_list: + self._schedule_details = utils.init_ScheduleDetails() + self._display_details = utils.init_DisplayDetails() + self._current_task_details = utils.init_CurrentTask() raise Exception("doing_list is not found, skip") for task in self.task_list.doing_list: diff --git a/src/signage/src/signage/signage.py b/src/signage/src/signage/signage.py index d189c1c..146e666 100644 --- a/src/signage/src/signage/signage.py +++ b/src/signage/src/signage/signage.py @@ -27,7 +27,7 @@ def main(args=None): autoware_interface = AutowareInterface(node) parameter_interface = ParameterInterface(node) - ros_service_interface = RosServiceInterface(node) + ros_service_interface = RosServiceInterface(node, parameter_interface) viewController = ViewControllerProperty(node, parameter_interface) announceController = AnnounceControllerProperty(node, autoware_interface, parameter_interface) route_handler = RouteHandler(