Skip to content

Commit

Permalink
launch file
Browse files Browse the repository at this point in the history
  • Loading branch information
23-saho committed Jul 27, 2024
1 parent f7821b1 commit 1693bd6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
12 changes: 12 additions & 0 deletions device/pi_led/launch/led_launch.py
Original file line number Diff line number Diff line change
@@ -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])
6 changes: 3 additions & 3 deletions device/pi_led/pi_led/pi_led.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions device/pi_led/setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
from glob import glob

from setuptools import find_packages, setup

package_name = "pi_led"
Expand All @@ -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,
Expand Down

0 comments on commit 1693bd6

Please sign in to comment.