diff --git a/device/pi_led/launch/led_launch.py b/device/pi_led/launch/led_launch.py new file mode 100644 index 0000000..da96464 --- /dev/null +++ b/device/pi_led/launch/led_launch.py @@ -0,0 +1,12 @@ +from launch import LaunchDescription +from launch_ros.actions import Node + + +def generate_launch_description() -> LaunchDescription: + led = Node( + package="pi_led", + excutable="pi_led", + namespace="device", + parameters=[], + ) + return LaunchDescription([led]) diff --git a/device/pi_led/pi_led/pi_led.py b/device/pi_led/pi_led/pi_led.py index a81282b..b30acbe 100644 --- a/device/pi_led/pi_led/pi_led.py +++ b/device/pi_led/pi_led/pi_led.py @@ -10,9 +10,9 @@ def __init__(self): self._led_subscription = self.create_subscription( LedColor, "led_color", self.led_callback, 10 ) - param_r = self.declare_parameter("led_pin_r", "") - param_g = self.declare_parameter("led_pin_g", "") - param_b = self.declare_parameter("led_pin_b", "") + param_r = self.declare_parameter("led_pin_r", "GPIO 17") + param_g = self.declare_parameter("led_pin_g", "GPIO 27") + param_b = self.declare_parameter("led_pin_b", "GPIO 22") led_pin_r = ( self.get_parameter_or(param_r.name, param_r) diff --git a/device/pi_led/setup.py b/device/pi_led/setup.py index 8088438..975661a 100644 --- a/device/pi_led/setup.py +++ b/device/pi_led/setup.py @@ -1,3 +1,6 @@ +import os +from glob import glob + from setuptools import find_packages, setup package_name = "pi_led" @@ -9,6 +12,10 @@ data_files=[ ("share/ament_index/resource_index/packages", ["resource/" + package_name]), ("share/" + package_name, ["package.xml"]), + ( + os.path.join("share", package_name, "launch"), + glob(os.path.join("launch", "*")), + ), ], install_requires=["setuptools"], zip_safe=True,