diff --git a/src/external_signage/launch/external_signage.launch.xml b/src/external_signage/launch/external_signage.launch.xml new file mode 100755 index 0000000..867b598 --- /dev/null +++ b/src/external_signage/launch/external_signage.launch.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/external_signage/package.xml b/src/external_signage/package.xml new file mode 100644 index 0000000..5e0ffa9 --- /dev/null +++ b/src/external_signage/package.xml @@ -0,0 +1,26 @@ + + + external_signage + 0.1.0 + The signage package + + yabuta + + Apache License 2.0 + ament_index_python + signage_version + + autoware_auto_system_msgs + diagnostic_updater + python-pulsectl-pip + rclpy + std_srvs + tier4_api_msgs + tier4_debug_msgs + tier4_external_api_msgs + tier4_hmi_msgs + + + ament_python + + diff --git a/src/external_signage/resource/external_signage b/src/external_signage/resource/external_signage new file mode 100644 index 0000000..e69de29 diff --git a/src/external_signage/resource/td5_file/automatic_128x16.td5 b/src/external_signage/resource/td5_file/automatic_128x16.td5 new file mode 100644 index 0000000..0297cef Binary files /dev/null and b/src/external_signage/resource/td5_file/automatic_128x16.td5 differ diff --git a/src/external_signage/resource/td5_file/automatic_80x24.td5 b/src/external_signage/resource/td5_file/automatic_80x24.td5 new file mode 100644 index 0000000..4d5077f Binary files /dev/null and b/src/external_signage/resource/td5_file/automatic_80x24.td5 differ diff --git a/src/external_signage/resource/td5_file/automonus.td5 b/src/external_signage/resource/td5_file/automonus.td5 new file mode 100644 index 0000000..1926e4a Binary files /dev/null and b/src/external_signage/resource/td5_file/automonus.td5 differ diff --git a/src/external_signage/resource/td5_file/null_128x16.td5 b/src/external_signage/resource/td5_file/null_128x16.td5 new file mode 100644 index 0000000..1cf7414 Binary files /dev/null and b/src/external_signage/resource/td5_file/null_128x16.td5 differ diff --git a/src/external_signage/resource/td5_file/null_80x24.td5 b/src/external_signage/resource/td5_file/null_80x24.td5 new file mode 100644 index 0000000..6e53de0 Binary files /dev/null and b/src/external_signage/resource/td5_file/null_80x24.td5 differ diff --git a/src/external_signage/setup.cfg b/src/external_signage/setup.cfg new file mode 100644 index 0000000..c66e1f6 --- /dev/null +++ b/src/external_signage/setup.cfg @@ -0,0 +1,4 @@ +[develop] +script-dir=$base/lib/external_signage +[install] +install-scripts=$base/lib/external_signage diff --git a/src/external_signage/setup.py b/src/external_signage/setup.py new file mode 100644 index 0000000..8444c2b --- /dev/null +++ b/src/external_signage/setup.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 + +import os + +from setuptools import setup + + +def package_files(directory): + paths = [] + for (path, directories, filenames) in os.walk(directory): + for filename in filenames: + paths.append(os.path.join(path, filename)) + return paths + + +package_name = "external_signage" +setup( + name=package_name, + version="0.1.0", + package_dir={"": "src"}, + packages=[package_name], + data_files=[ + ("share/ament_index/resource_index/packages", ["resource/" + package_name]), + ("share/" + package_name + "/resource/td5_file", package_files("resource/td5_file")), + ("share/" + package_name, ["package.xml"]), + ("share/" + package_name + "/launch", ["launch/external_signage.launch.xml"]), + ], + install_requires=["setuptools"], + zip_safe=True, + author="Makoto Yabuta", + maintainer="Makoto Yabuta", + maintainer_email="makoto.yabuta@tier4.jp", + keywords=["ROS"], + classifiers=[ + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Topic :: Software Development", + ], + description=("external_signage provides a GUI for passanger."), + license="TODO", + entry_points={ + "console_scripts": [ + "external_signage = external_signage.external_signage:main", + ] + }, +) diff --git a/src/external_signage/src/external_signage/__init__.py b/src/external_signage/src/external_signage/__init__.py new file mode 100644 index 0000000..003f841 --- /dev/null +++ b/src/external_signage/src/external_signage/__init__.py @@ -0,0 +1,4 @@ +# This Python file uses the following encoding: utf-8 + +# if__name__ == "__main__": +# pass diff --git a/src/external_signage/src/external_signage/external_signage.py b/src/external_signage/src/external_signage/external_signage.py new file mode 100644 index 0000000..3693ab0 --- /dev/null +++ b/src/external_signage/src/external_signage/external_signage.py @@ -0,0 +1,23 @@ +# This Python file uses the following encoding: utf-8 +import sys + +import rclpy +from rclpy.node import Node + +from external_signage.external_signage_core import ExternalSignage +from ament_index_python.packages import get_package_share_directory + +def main(args=None): + package_path = get_package_share_directory("external_signage") + + rclpy.init(args=args) + node = Node("external_signage") + + external_signage = ExternalSignage(node) + + while True: + rclpy.spin_once(node, timeout_sec=0.01) + + +if __name__ == "__main__": + main() diff --git a/src/signage/src/signage/external_signage.py b/src/external_signage/src/external_signage/external_signage_core.py similarity index 99% rename from src/signage/src/signage/external_signage.py rename to src/external_signage/src/external_signage/external_signage_core.py index 34a98e9..ddac67a 100644 --- a/src/signage/src/signage/external_signage.py +++ b/src/external_signage/src/external_signage/external_signage_core.py @@ -4,7 +4,7 @@ import serial from std_srvs.srv import SetBool from ament_index_python.packages import get_package_share_directory -import signage.packet_tools as packet_tools +import external_signage.packet_tools as packet_tools @dataclass diff --git a/src/signage/src/signage/packet_tools.py b/src/external_signage/src/external_signage/packet_tools.py similarity index 100% rename from src/signage/src/signage/packet_tools.py rename to src/external_signage/src/external_signage/packet_tools.py diff --git a/src/signage/src/signage/ros_service_interface.py b/src/signage/src/signage/ros_service_interface.py index 3331413..193e6ec 100644 --- a/src/signage/src/signage/ros_service_interface.py +++ b/src/signage/src/signage/ros_service_interface.py @@ -43,7 +43,7 @@ def accept_start(self): def trigger_external_signage(self, on): request = SetBool.Request() request.data = on - self.__service_call(self._cli_accept_start, request, True) + self.__service_call(self._cli_trigger_external, 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 034de9d..c254e74 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -26,7 +26,6 @@ def __init__( autoware_interface, parameter_interface, ros_service_interface, - external_signage, ): self._node = node self._viewController = viewController @@ -34,7 +33,6 @@ def __init__( self._autoware = autoware_interface self._parameter = parameter_interface.parameter self._service_interface = ros_service_interface - self._external_signage = external_signage self.AUTOWARE_IP = os.getenv("AUTOWARE_IP", "localhost") self._fms_payload = { "method": "get", diff --git a/src/signage/src/signage/signage.py b/src/signage/src/signage/signage.py index 4020678..71f427a 100644 --- a/src/signage/src/signage/signage.py +++ b/src/signage/src/signage/signage.py @@ -14,7 +14,6 @@ from signage.parameter_interface import ParameterInterface from signage.route_handler import RouteHandler from signage.ros_service_interface import RosServiceInterface -from signage.external_signage import ExternalSignage from ament_index_python.packages import get_package_share_directory @@ -34,7 +33,6 @@ def main(args=None): ros_service_interface = RosServiceInterface(node, parameter_interface) viewController = ViewControllerProperty(node, parameter_interface) announceController = AnnounceControllerProperty(node, autoware_interface, parameter_interface) - external_signage = ExternalSignage(node) route_handler = RouteHandler( node, viewController, @@ -42,7 +40,6 @@ def main(args=None): autoware_interface, parameter_interface, ros_service_interface, - external_signage, ) ctx = engine.rootContext()