Skip to main content

Overview

Communication is a subsystem that allows other subsystem to exchange messages and perform various actions neededresponsible for the ERC tasks. Consider the Rover Architecture diagram defined in this page.

The Communications node is center to all important subsystems. It bridgesbridging the two different types ofdistinct networks present on the rover: the Ethernet Network and the ROS2 Network. ThroughWithout its use,it, Jonny Boi (the Jetson)Jetson canOrin communicateNano) would have no way to talk to the hardware microcontrollers or the Basestation, and the internal ROS2 software stack would have no way to act on external inputs or send commands outward.

On the Ethernet side, the Jetson connects to the hardware boards (ArmBoard, DriveBoard, SensorBoard, ContainerBoard) and to the Basestation over WiFi. On the ROS2 side, the Communications node exchanges messages with internal nodes such as the Behavior Node, which handles business logic, and the Controller Node, which manages hardware commands.

All messages sent over the network, whether towards the Basestation or with the Microcontrollershardware over the bridged network.

Messagesmicrocontrollers, are typically sentencoded as protobuffers,Protobuffers, wrapped intoinside an appropriatea PBEnvelope (TODO: Linklink to anPBEnvelope explanationdocumentation). The PBEnvelope acts as a typed container that lets the receiver identify what kind of message it is receiving before deserializing the envelope),payload. ifThese theywrapped messages are sent over the network towards the Microcontrollers or Basestation. However, to communicate with the other ROS2 nods, suchtransmitted as "Behavior", we cannot simply forward raw protobuffers.bytes Forinside that,UDP thepackets.

The Communications node willoperates eitherin convertboth thedirections:

incoming
  • Inbound protobuf(Ethernet -> ROS2): UDP packets received overfrom UDPthe Basestation or hardware boards are parsed, the protobuf payload is extracted from the PBEnvelope, and the data is converted into custom ROS2 messages before publishingbeing published over the appropriate ROS2 topic for other nodes to consume.
  • Outbound (ROS2 -> Ethernet): The Communications node subscribes to relevant ROS2 topics, converts the incoming ROS2 messages back into Protobuffers, wraps them overin ana appropriatePBEnvelope, topicand thattransmits them as UDP packets to the Behaviorintended destination, either the Basestation or Controllera hardware board.

Consider the Rover Architecture diagram Rover Architecture diagram to get a visual overview of how the Communications node cansits subscribeat to,the or,center alternatively,of subscribethese data flows.

Before diving into the codebase, it is strongly recommended to a published topic and convertread the ROS2 messagesinterfaces intodocumentation, Protobuffers.

Read all of the ROS2 documentation prior to continuing, especiallyparticularly the entries regarding interfaces:
topics, messages and publishers/subscribers: https://docs.ros.org/en/humble/Concepts/Basic/About-Interfaces.html

You will also need a bit of background networkingknowledge andin C++ knowledge,and withUDP networking. The following guide is a focussolid onstarting UDPpoint: packet transmission. Below we can recommend a source to help out, but make sure to do your own research as well:
https://beej.us/guide/bgnet/html/split-wide/