From d265e8404fbb16fde1ef3848f30e598b2b7b2d35 Mon Sep 17 00:00:00 2001 From: 23-yoshikawa Date: Mon, 24 Jun 2024 18:25:24 +0900 Subject: [PATCH 1/3] =?UTF-8?q?camera,imshow,joystick=E3=81=AElaunch?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/imshow/launch/imshow_launch.py | 2 +- device/camera_reader/launch/camera_reader_launch.py | 2 +- device/joystick/launch/joystick_launch.py | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/imshow/launch/imshow_launch.py b/app/imshow/launch/imshow_launch.py index 57ee33a..214a40e 100644 --- a/app/imshow/launch/imshow_launch.py +++ b/app/imshow/launch/imshow_launch.py @@ -8,6 +8,6 @@ def generate_launch_description(): package="imshow", executable="imshow", namespace="app", - remappings=[("/app/camera/image", "/packet/camera/image")] + remappings=[("/app/camera_image", "/packet/camera_image")] ) ]) diff --git a/device/camera_reader/launch/camera_reader_launch.py b/device/camera_reader/launch/camera_reader_launch.py index 9cfc58f..5093be4 100644 --- a/device/camera_reader/launch/camera_reader_launch.py +++ b/device/camera_reader/launch/camera_reader_launch.py @@ -8,5 +8,5 @@ def generate_launch_description(): package="camera_reader", executable="camera_reader", namespace="device", - remappings=[("/device/camera/image", "/packet/camera/image")]) + remappings=[("/device/camera_image", "/packet/camera_image")]) ]) diff --git a/device/joystick/launch/joystick_launch.py b/device/joystick/launch/joystick_launch.py index 202a02e..b234dda 100644 --- a/device/joystick/launch/joystick_launch.py +++ b/device/joystick/launch/joystick_launch.py @@ -4,5 +4,9 @@ def generate_launch_description(): return LaunchDescription([ - Node(package="joystick", executable="joystick", namespace="device") + Node(package="joystick", + executable="joystick", + namespace="device", + remappings=[("/device/joystick", "/packet/joystick")] + ) ]) From f0d9fff22aba3e366b06318aba8973ea5a4d7667 Mon Sep 17 00:00:00 2001 From: 23-yoshikawa Date: Sun, 30 Jun 2024 00:28:14 +0900 Subject: [PATCH 2/3] =?UTF-8?q?nucleo=5Fcommunication.py=E3=81=AElaunch?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- device/nucleo_communicate_py/launch/receiver_launch.py | 6 +++++- device/nucleo_communicate_py/launch/sender_launch.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/device/nucleo_communicate_py/launch/receiver_launch.py b/device/nucleo_communicate_py/launch/receiver_launch.py index aa42246..37ee5bb 100644 --- a/device/nucleo_communicate_py/launch/receiver_launch.py +++ b/device/nucleo_communicate_py/launch/receiver_launch.py @@ -6,6 +6,10 @@ def generate_launch_description() -> LaunchDescription: receiver = Node( package="nucleo_communicate_py", executable="receiver", - namespace="device" + namespace="device", + remappings=[("/device/receiver_launch", "/packet/sensor/flex/1"), + ("/device/receiver_launch","/packet/sensor/flex/2"), + ("/device/receiver_launch","/packet/sensor/current"), + ("/device/receiver_launch","/packet/sensor/voltage")] ) return LaunchDescription([receiver]) diff --git a/device/nucleo_communicate_py/launch/sender_launch.py b/device/nucleo_communicate_py/launch/sender_launch.py index 851ca1d..0413eac 100644 --- a/device/nucleo_communicate_py/launch/sender_launch.py +++ b/device/nucleo_communicate_py/launch/sender_launch.py @@ -6,6 +6,8 @@ def generate_launch_description() -> LaunchDescription: sender = Node( package="nucleo_communicate_py", executable="sender", - namespace="device" + namespace="device", + remappings=[("/device/sender_launch", "/packet/order/quit") + ("/device/sender_launch","/packet/order/power")] ) return LaunchDescription([sender]) From 81e39bcec02dd65395903d8df6002afd9978658c Mon Sep 17 00:00:00 2001 From: 23-yoshikawa Date: Mon, 1 Jul 2024 23:33:11 +0900 Subject: [PATCH 3/3] change! --- app/imshow/imshow/imshow.py | 5 ++++- app/imshow/launch/imshow_launch.py | 18 ++++++++++-------- .../launch/camera_reader_launch.py | 17 ++++++++++------- device/joystick/launch/joystick_launch.py | 17 ++++++++++------- .../launch/receiver_launch.py | 10 ++++++---- .../launch/sender_launch.py | 7 +++++-- .../nucleo_communicate_py/channel.py | 5 ++++- .../nucleo_communicate_py/receiver.py | 5 ++++- 8 files changed, 53 insertions(+), 31 deletions(-) diff --git a/app/imshow/imshow/imshow.py b/app/imshow/imshow/imshow.py index 6ee1871..2eb3749 100644 --- a/app/imshow/imshow/imshow.py +++ b/app/imshow/imshow/imshow.py @@ -9,7 +9,10 @@ class Imshow(Node): def __init__(self): super().__init__("imshow") self.subscription = self.create_subscription( - Image, "camera_image", self.listener_callback, 10, + Image, + "camera_image", + self.listener_callback, + 10, ) self.bridge = CvBridge() diff --git a/app/imshow/launch/imshow_launch.py b/app/imshow/launch/imshow_launch.py index 214a40e..f3892d9 100644 --- a/app/imshow/launch/imshow_launch.py +++ b/app/imshow/launch/imshow_launch.py @@ -3,11 +3,13 @@ def generate_launch_description(): - return LaunchDescription([ - Node( - package="imshow", - executable="imshow", - namespace="app", - remappings=[("/app/camera_image", "/packet/camera_image")] - ) - ]) + return LaunchDescription( + [ + Node( + package="imshow", + executable="imshow", + namespace="app", + remappings=[("/app/camera_image", "/packet/camera_image")], + ), + ] + ) diff --git a/device/camera_reader/launch/camera_reader_launch.py b/device/camera_reader/launch/camera_reader_launch.py index 0692757..61bc84a 100644 --- a/device/camera_reader/launch/camera_reader_launch.py +++ b/device/camera_reader/launch/camera_reader_launch.py @@ -3,10 +3,13 @@ def generate_launch_description(): - return LaunchDescription([ - Node( - package="camera_reader", - executable="camera_reader", - namespace="device", - remappings=[("/device/camera_image", "/packet/camera_image")]) - ]) + return LaunchDescription( + [ + Node( + package="camera_reader", + executable="camera_reader", + namespace="device", + remappings=[("/device/camera_image", "/packet/camera_image")], + ), + ] + ) diff --git a/device/joystick/launch/joystick_launch.py b/device/joystick/launch/joystick_launch.py index 3c1a022..9f73214 100644 --- a/device/joystick/launch/joystick_launch.py +++ b/device/joystick/launch/joystick_launch.py @@ -3,10 +3,13 @@ def generate_launch_description(): - return LaunchDescription([ - Node(package="joystick", - executable="joystick", - namespace="device", - remappings=[("/device/joystick", "/packet/joystick")] - ) - ]) + return LaunchDescription( + [ + Node( + package="joystick", + executable="joystick", + namespace="device", + remappings=[("/device/joystick", "/packet/joystick")], + ), + ] + ) diff --git a/device/nucleo_communicate_py/launch/receiver_launch.py b/device/nucleo_communicate_py/launch/receiver_launch.py index 37ee5bb..4aca8bf 100644 --- a/device/nucleo_communicate_py/launch/receiver_launch.py +++ b/device/nucleo_communicate_py/launch/receiver_launch.py @@ -7,9 +7,11 @@ def generate_launch_description() -> LaunchDescription: package="nucleo_communicate_py", executable="receiver", namespace="device", - remappings=[("/device/receiver_launch", "/packet/sensor/flex/1"), - ("/device/receiver_launch","/packet/sensor/flex/2"), - ("/device/receiver_launch","/packet/sensor/current"), - ("/device/receiver_launch","/packet/sensor/voltage")] + remappings=[ + ("/device/receiver_launch", "/packet/sensor/flex/1"), + ("/device/receiver_launch", "/packet/sensor/flex/2"), + ("/device/receiver_launch", "/packet/sensor/current"), + ("/device/receiver_launch", "/packet/sensor/voltage"), + ], ) return LaunchDescription([receiver]) diff --git a/device/nucleo_communicate_py/launch/sender_launch.py b/device/nucleo_communicate_py/launch/sender_launch.py index 0413eac..d25cf5c 100644 --- a/device/nucleo_communicate_py/launch/sender_launch.py +++ b/device/nucleo_communicate_py/launch/sender_launch.py @@ -7,7 +7,10 @@ def generate_launch_description() -> LaunchDescription: package="nucleo_communicate_py", executable="sender", namespace="device", - remappings=[("/device/sender_launch", "/packet/order/quit") - ("/device/sender_launch","/packet/order/power")] + remappings=[ + ("/device/sender_launch", "/packet/order/quit")( + "/device/sender_launch", "/packet/order/power" + ) + ], ) return LaunchDescription([sender]) diff --git a/device/nucleo_communicate_py/nucleo_communicate_py/channel.py b/device/nucleo_communicate_py/nucleo_communicate_py/channel.py index 237f4d0..c0b827a 100644 --- a/device/nucleo_communicate_py/nucleo_communicate_py/channel.py +++ b/device/nucleo_communicate_py/nucleo_communicate_py/channel.py @@ -47,7 +47,10 @@ def _recv_callback(self): f"received from nucleo: {flex1=}, {flex2=}, {current=}, {voltage=}", ) flex1, flex2, current, voltage = self._recv.map_values( - flex1, flex2, current, voltage, + flex1, + flex2, + current, + voltage, ) self._flex1_publisher.publish(Flex(value=flex1)) self._flex2_publisher.publish(Flex(value=flex2)) diff --git a/device/nucleo_communicate_py/nucleo_communicate_py/receiver.py b/device/nucleo_communicate_py/nucleo_communicate_py/receiver.py index 57dc5c1..949c21c 100644 --- a/device/nucleo_communicate_py/nucleo_communicate_py/receiver.py +++ b/device/nucleo_communicate_py/nucleo_communicate_py/receiver.py @@ -61,7 +61,10 @@ def _timer_callback(self) -> None: f"received from nucleo: {flex1=}, {flex2=}, {current=}, {voltage=}", ) flex1, flex2, current, voltage = self._recv.map_values( - flex1, flex2, current, voltage, + flex1, + flex2, + current, + voltage, ) self._flex1_publisher.publish(Flex(value=flex1)) self._flex2_publisher.publish(Flex(value=flex2))