From 644459ec711162243d9f1d6aff6ae8e5b8c278be Mon Sep 17 00:00:00 2001 From: David Date: Mon, 29 Sep 2025 11:09:05 -0500 Subject: [PATCH] style: explain anchor topics in comment block --- src/anchor_pkg/anchor_pkg/anchor_node.py | 27 ++++++++++++++++++++---- src/ros2_interfaces_pkg | 2 +- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/anchor_pkg/anchor_pkg/anchor_node.py b/src/anchor_pkg/anchor_pkg/anchor_node.py index c07ff2c..aaef775 100644 --- a/src/anchor_pkg/anchor_pkg/anchor_node.py +++ b/src/anchor_pkg/anchor_pkg/anchor_node.py @@ -19,20 +19,39 @@ serial_pub = None thread = None +""" +Publishers: + * /anchor/from_vic/debug + - Every string received from the MCU is published here for debugging + * /anchor/from_vic/core + - VicCAN messages for Core node + * /anchor/from_vic/arm + - VicCAN messages for Arm node + * /anchor/from_vic/bio + - VicCAN messages for Bio node + +Subscribers: + * /anchor/from_vic/mock_mcu + - For testing without an actual MCU, publish strings here as if they came from an MCU + * /anchor/to_vic/relay + - Core, Arm, and Bio publish VicCAN messages to this topic to send to the MCU + * /anchor/to_vic/relay_string + - Publish raw strings to this topic to send directly to the MCU for debugging +""" class SerialRelay(Node): def __init__(self): # Initalize node with name super().__init__("anchor_node")#previously 'serial_publisher' # New pub/sub with VicCAN - self.mock_mcu_sub_ = self.create_subscription(String, '/anchor/from_mock_mcu', self.relay_mock_fromvic, 20) + self.fromvic_debug_pub_ = self.create_publisher(String, '/anchor/from_vic/debug', 20) self.fromvic_core_pub_ = self.create_publisher(VicCAN, '/anchor/from_vic/core', 20) self.fromvic_arm_pub_ = self.create_publisher(VicCAN, '/anchor/from_vic/arm', 20) self.fromvic_bio_pub_ = self.create_publisher(VicCAN, '/anchor/from_vic/bio', 20) - self.tovic_sub_ = self.create_subscription(VicCAN, '/anchor/to_vic/relay', self.relay_tovic, 20) - self.fromvic_debug_pub_ = self.create_publisher(String, '/anchor/from_vic/debug', 20) - self.tovic_debug_sub_ = self.create_subscription(String, '/anchor/to_vic/debug', self.send_cmd, 20) + self.mock_mcu_sub_ = self.create_subscription(String, '/anchor/from_vic/mock_mcu', self.relay_mock_fromvic, 20) + self.tovic_sub_ = self.create_subscription(VicCAN, '/anchor/to_vic/relay', self.relay_tovic, 20) + self.tovic_debug_sub_ = self.create_subscription(String, '/anchor/to_vic/relay_string', self.send_cmd, 20) # Create publishers diff --git a/src/ros2_interfaces_pkg b/src/ros2_interfaces_pkg index d2b5815..e94359b 160000 --- a/src/ros2_interfaces_pkg +++ b/src/ros2_interfaces_pkg @@ -1 +1 @@ -Subproject commit d2b581561fe4aeea4267727f10afc2b517bef405 +Subproject commit e94359b6ce35d07f1b07411995bb75dda917b046