ROS 2 Learning Path  ยท  Illustrated Tutorial Book

Chapter 16: ARCHO's Compute Hardware โ€” Jetson, Raspberry Pi, ESP32

Which brain, which job
Prerequisite: Chapter 8 (ros2_control)
Running project: ARCHO's real hardware
Platforms: Jetson, Raspberry Pi, ESP32/micro-ROS
Reading time: 110โ€“130 minutes
What's in this chapter 16.1Why one computer isn't enough for everything 16.2Jetson: heavy processing and AI 16.3Raspberry Pi: gateway and lightweight processing 16.4ESP32 and micro-ROS: direct motor control 16.5Watchdog: the most important safety principle in this chapter 16.6ARCHO's complete hardware architecture 16.7Summary, glossary, and exercises

16.1Why one computer isn't enough for everything

Up to this point we've assumed ARCHO has a single computer running everything โ€” from Nav2 to motor control. In the real world, that assumption rarely holds. A real robotic platform typically consists of three different hardware layers, each optimized for its own job.

๐Ÿง  Why we shouldn't put motor control on the same computer as Nav2

Motor control needs a very fast, predictable real-time loop โ€” for example, a thousand times per second. A regular Linux computer that's simultaneously running Nav2, SLAM, and image processing cannot guarantee that timing. That's why industrial architectures separate motor control from heavy processing.

16.2Jetson: heavy processing and AI

NVIDIA Jetson is designed for heavy processing tasks:

flowchart TB J["Jetson"] --> P["Perception"] J --> C["Camera Drivers"] J --> A["AI Models"] J --> S["Visual SLAM"] J --> H["High-Level ROS 2 (Nav2)"] style J fill:#eef0ff,stroke:#3d4bf5
โš ๏ธ Don't hand real-time motor control directly to the Jetson

It's better for the Jetson to send high-level commands (like target velocity) to a separate microcontroller over CAN, Ethernet, or Serial, rather than controlling the motor driver directly itself.

Jetson
   โ”‚
   โ–ผ
CAN / Ethernet / Serial
   โ”‚
   โ–ผ
Microcontroller
   โ”‚
   โ–ผ
Motor Drivers
Important Jetson considerationWhy it matters
Power and coolingHeavy processing generates significant heat and needs proper cooling
Storage spaceAI models and logs can take up a lot of space
JetPack versionDriver and library compatibility depends on the JetPack version
CUDA compatibilityEvery AI model is tested against a specific CUDA version
Automatic node startupAfter a power outage, the system must come back up without human intervention
Log rotationWithout it, the disk gradually fills up
Watchdog and thermal limitsPrevents overheating and system freezes

16.3Raspberry Pi: gateway and lightweight processing

The Raspberry Pi is well suited to lighter workloads:

Good forLimited for
LiDAR driverHeavy AI models
Sensor gatewayMultiple simultaneous depth cameras
ROS bridgeHeavy visual SLAM
Mid-level control, telemetry
Lightweight educational robots
Raspberry Pi
   โ”‚
   โ”œโ”€โ”€ ROS 2
   โ”œโ”€โ”€ LiDAR Driver
   โ”œโ”€โ”€ IMU Driver
   โ”œโ”€โ”€ robot_localization
   โ””โ”€โ”€ Basic Nav2

16.4ESP32 and micro-ROS: direct motor control

An ESP32 usually doesn't run a full ROS 2 stack like a computer does. There are two common paths for connecting it to the ROS 2 world:

flowchart LR A["ESP32 Firmware"] --> B["Custom Serial/CAN Protocol"] --> C["ROS 2 Hardware Interface"]
flowchart LR D["ESP32"] --> E["micro-ROS"] --> F["micro-ROS Agent"] --> G["ROS 2 Graph"] style E fill:#eef0ff,stroke:#3d4bf5
๐Ÿ“– What is micro-ROS

micro-ROS brings the familiar ROS 2 concepts โ€” Publisher, Subscriber, Service, Timer โ€” to microcontrollers. But because an MCU's resources (RAM, flash, CPU, networking) are far more limited than a computer's, the full ROS 2 architecture shouldn't be copied onto it as-is.

Tasks suited to the ESP32Tasks not suited to the ESP32
Reading encodersSLAM
Motor speed PIDNav2
Reading simple sensorsPoint cloud processing
WatchdogLarge AI models
Brake command and light control
Sending telemetry

16.5Watchdog: the most important safety principle in this chapter

โš ๏ธ If communication is lost

If the ESP32 receives no new command from the upper layer for a set period (say, 300 ms), it must decide on its own to zero the motor command and apply the brake โ€” without waiting for an instruction from the Jetson or Raspberry Pi. If the upper layer is disconnected for any reason (even a software crash), ARCHO must not keep moving on the last command it received.

No command for 300 ms
          โ†“
Motor command = 0
          โ†“
Brake

This is one of the most important safety principles in any real industrial robot โ€” and because it is so critical, it must be implemented independently of the entire upstream software architecture, directly on the microcontroller.

16.6ARCHO's complete hardware architecture

flowchart TB J["Jetson"] --> N["Nav2"] J --> AI["AI / Perception"] J --> C["Camera"] J --> S["SLAM"] N --> MCU["ESP32 / STM32"] AI --> MCU C --> MCU S --> MCU MCU --> E["Encoder"] MCU --> PID["Motor PID"] MCU --> W["Watchdog"] MCU --> ES["Emergency Stop"] style J fill:#eef0ff,stroke:#3d4bf5 style MCU fill:#fdeeec,stroke:#d64a3c
๐ŸŒ A split architecture for a production ARCHO

In an industrial version of ARCHO with a picking arm: the Jetson is responsible for Nav2, AI-based object detection, camera, and visual SLAM. These high-level decisions are sent over a communication link (CAN or Serial) to a microcontroller (ESP32 or STM32), which itself directly reads the encoder, closes the motor PID loop, runs the watchdog, and responds to the Emergency Stop button โ€” completely independent of whether the Jetson is healthy or not.

LayerPrimary responsibility
JetsonHeavy processing: AI, perception, visual SLAM, Nav2
Raspberry PiGateway or lightweight processing: LiDAR driver, telemetry
MCU (ESP32/STM32)Real-time control: encoder, PID, watchdog, emergency stop

16.7Chapter 16 summary

Now you know why a real ARCHO rarely runs on a single computer. Heavy processing (Jetson), a lightweight gateway (Raspberry Pi), and direct real-time motor control (ESP32 with an independent watchdog) each play a different role, and this separation improves both performance and system safety.

โœ… Learning checkpoint
  • I can explain why motor control shouldn't run directly on the Jetson.
  • I know what the Raspberry Pi is good for and where it's limited.
  • I can explain the difference between the two paths for connecting an ESP32 to ROS 2.
  • I know what a watchdog does and why it must be independent of the upstream layer.
๐ŸŒ Connection to the main project

ARCHO Project now has a three-layer hardware architecture: a Jetson for Nav2 and AI, and an ESP32 with an independent watchdog for direct motor and encoder control.

What the next chapter adds

In Chapter 17 we move to the industrial networks that actually connect these layers together: CAN bus and EtherCAT.

Chapter 16 glossary

Jetson
NVIDIA's family of computers for parallel processing and AI at the edge.
micro-ROS
A lightweight implementation of ROS 2 concepts for running on resource-constrained microcontrollers.
micro-ROS Agent
The bridge that connects micro-ROS messages to the main ROS 2 graph.
Watchdog
A safety mechanism that stops the motor command if communication with the upstream layer is lost.
Real-Time
A system property that guarantees an operation completes within a defined, predictable time window.

Common mistakes in Chapter 16 โ€” summary