style: move pub/sub docs comment, rename SerialPub to Anchor

This commit is contained in:
David
2025-11-10 21:58:03 -06:00
parent 4a49069c2a
commit 4c1416851e

View File

@@ -19,28 +19,27 @@ serial_pub = None
thread = None thread = None
""" class Anchor(Node):
Publishers: """
* /anchor/from_vic/debug Publishers:
- Every string received from the MCU is published here for debugging * /anchor/from_vic/debug
* /anchor/from_vic/core - Every string received from the MCU is published here for debugging
- VicCAN messages for Core node * /anchor/from_vic/core
* /anchor/from_vic/arm - VicCAN messages for Core node
- VicCAN messages for Arm node * /anchor/from_vic/arm
* /anchor/from_vic/bio - VicCAN messages for Arm node
- VicCAN messages for Bio node * /anchor/from_vic/bio
- VicCAN messages for Bio node
Subscribers: Subscribers:
* /anchor/from_vic/mock_mcu * /anchor/from_vic/mock_mcu
- For testing without an actual MCU, publish strings here as if they came from an MCU - For testing without an actual MCU, publish strings here as if they came from an MCU
* /anchor/to_vic/relay * /anchor/to_vic/relay
- Core, Arm, and Bio publish VicCAN messages to this topic to send to the MCU - Core, Arm, and Bio publish VicCAN messages to this topic to send to the MCU
* /anchor/to_vic/relay_string * /anchor/to_vic/relay_string
- Publish raw strings to this topic to send directly to the MCU for debugging - Publish raw strings to this topic to send directly to the MCU for debugging
""" """
class SerialRelay(Node):
def __init__(self): def __init__(self):
# Initalize node with name # Initalize node with name
super().__init__("anchor_node") # previously 'serial_publisher' super().__init__("anchor_node") # previously 'serial_publisher'
@@ -49,7 +48,7 @@ class SerialRelay(Node):
self.port = None self.port = None
if port_override := os.getenv("PORT_OVERRIDE"): if port_override := os.getenv("PORT_OVERRIDE"):
self.port = port_override self.port = port_override
ports = SerialRelay.list_serial_ports() ports = Anchor.list_serial_ports()
for i in range(4): for i in range(4):
if self.port is not None: if self.port is not None:
break break
@@ -270,7 +269,7 @@ def main(args=None):
global serial_pub global serial_pub
serial_pub = SerialRelay() serial_pub = Anchor()
serial_pub.run() serial_pub.run()