Skip to content

Commit

Permalink
fix new external node (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
yabuta authored Mar 28, 2024
1 parent 799137e commit e7320c4
Show file tree
Hide file tree
Showing 17 changed files with 110 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/external_signage/launch/external_signage.launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<launch>
<node pkg="external_signage" exec="external_signage" output="screen" />
</launch>
26 changes: 26 additions & 0 deletions src/external_signage/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<package format="2">
<name>external_signage</name>
<version>0.1.0</version>
<description>The signage package</description>

<maintainer email="[email protected]">yabuta</maintainer>

Check warning on line 7 in src/external_signage/package.xml

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (yabuta)

<license>Apache License 2.0</license>
<exec_depend>ament_index_python</exec_depend>
<exec_depend>signage_version</exec_depend>

<depend>autoware_auto_system_msgs</depend>
<depend>diagnostic_updater</depend>
<depend>python-pulsectl-pip</depend>

Check warning on line 15 in src/external_signage/package.xml

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (pulsectl)
<depend>rclpy</depend>
<depend>std_srvs</depend>
<depend>tier4_api_msgs</depend>
<depend>tier4_debug_msgs</depend>
<depend>tier4_external_api_msgs</depend>
<depend>tier4_hmi_msgs</depend>

<export>
<build_type>ament_python</build_type>
</export>
</package>
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions src/external_signage/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[develop]
script-dir=$base/lib/external_signage
[install]
install-scripts=$base/lib/external_signage
47 changes: 47 additions & 0 deletions src/external_signage/setup.py
Original file line number Diff line number Diff line change
@@ -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="[email protected]",
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",
]
},
)
4 changes: 4 additions & 0 deletions src/external_signage/src/external_signage/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This Python file uses the following encoding: utf-8

# if__name__ == "__main__":
# pass
23 changes: 23 additions & 0 deletions src/external_signage/src/external_signage/external_signage.py
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/signage/src/signage/ros_service_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 0 additions & 2 deletions src/signage/src/signage/route_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ def __init__(
autoware_interface,
parameter_interface,
ros_service_interface,
external_signage,
):
self._node = node
self._viewController = viewController
self._announce_interface = announceController
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",
Expand Down
3 changes: 0 additions & 3 deletions src/signage/src/signage/signage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -34,15 +33,13 @@ 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,
announceController,
autoware_interface,
parameter_interface,
ros_service_interface,
external_signage,
)

ctx = engine.rootContext()
Expand Down

0 comments on commit e7320c4

Please sign in to comment.