---
title: "K.A.R.R. Safety Core: ROS 2 Robot Safety Control and Ethernet Monitoring System"
url: "https://maker.wiznet.io/Aimee0/projects/k-a-r-r-safety-core-ros-2-robot-safety-control-and-ethernet-monitoring-system/"
markdown_url: "https://maker.wiznet.io/Aimee0/projects/k-a-r-r-safety-core-ros-2-robot-safety-control-and-ethernet-monitoring-system/md"
type: "UCC: User Created Content"
author: "Aeolus96"
author_url: "https://github.com/Aeolus96/karr-safety-core"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Aeolus96"
original_url: "https://github.com/Aeolus96/karr-safety-core"
published: "2026-11-09"
language: "en"
hardware: ["WIZnet W5500"]
likes: 0
views: 13
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# K.A.R.R. Safety Core: ROS 2 Robot Safety Control and Ethernet Monitoring System

> K.A.R.R. Safety Core: ROS 2 Robot Safety Control and Ethernet Monitoring System Using ESP32-S3 and W5500

Original author: Aeolus96 (source: https://github.com/Aeolus96/karr-safety-core)

## Components

- **WIZnet W5500** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500))

WIZnet parts: W5500 ([Datasheet](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet?utm_source=maker&utm_medium=project&utm_campaign=w5500), [product hub](https://maker.wiznet.io/products/w5500/))

## Article

## Overview

K.A.R.R. Safety Core는 K.A.R.R.(Keystone Autonomous Resource Rover) 로봇의 RC 입력, 비상 정지(E-stop), Relay 출력 및 상태 모니터링을 담당하는 오픈소스 Firmware 프로젝트입니다. ESP32-S3와 WIZnet W5500이 탑재된 Waveshare Ethernet Relay Board를 사용하며, RC 기반 안전 제어는 MCU에서 직접 처리하고 ROS 2에는 Ethernet을 통해 상태 정보를 전달합니다.

이 프로젝트의 주요 특징은 로봇의 Local Safety Control과 ROS 2 Network Communication을 분리한 구조입니다.

RC Receiver에서 전달되는 i-BUS 데이터를 ESP32-S3가 직접 처리하여 Relay 출력을 제어하며, ROS 2에서는 해당 상태를 모니터링할 수 있습니다. ROS 2 Topic을 통해 Relay를 직접 작동시키는 기능은 제공하지 않습니다.

주요 기능은 다음과 같습니다.

- RC Input Processing: Turnigy iA6B Receiver의 10채널 i-BUS 데이터를 수신하고 ROS 2 `sensor_msgs/Joy` 메시지로 변환

- Wireless E-stop: RC Channel 6을 비상 정지 입력으로 사용

- Local Relay Control: RC Switch 입력에 따라 ESP32-S3가 Relay 출력을 직접 제어

- Failsafe: RC 연결 손실, Failsafe 상태, E-stop 및 기본 설정에서의 Agent 연결 손실 시 RC 관련 출력을 차단

- ROS 2 Monitoring: W5500 Ethernet과 micro-ROS를 통해 RC, Relay, Digital Input 및 시스템 상태를 Publish

## Developer

![](https://maker.wiznet.io/upload/ckeditor5/d798fb58fb3342159eab3633c8b7958e.png)

*https://www.linkedin.com/in/devson/*

**Devson**은 로봇 시스템 개발 분야에서 10년 이상의 경력을 보유한 Robotics Developer입니다. 로봇 시스템, Prototype Race Car, 산업용 3D Printer 등의 개발 경험을 갖추고 있으며, C++와 Python을 활용한 Software Development 및 Robot System Architecture에 전문성을 보유하고 있습니다.

현재는 Autonomous Driving, Deep Learning, Neural Networks, Robot Perception 등의 기술 분야에도 집중하고 있습니다.

K.A.R.R. Safety Core는 이러한 로봇 개발 경험을 바탕으로 ESP32-S3, W5500 Ethernet, micro-ROS를 활용하여 로봇의 안전 제어와 ROS 2 기반 상태 모니터링을 구현한 오픈소스 프로젝트입니다.

## Technical Architecture

K.A.R.R. Safety Core는 Waveshare ESP32-S3-POE-ETH-8DI-8RO-C 보드를 중심으로 구성됩니다. 이 보드는 ESP32-S3 MCU, W5500 Ethernet Controller, TCA9554 I2C Expander 기반 8개 Relay Output 및 8개 Digital Input을 제공합니다.

| Item | Confirmed Details |
| --- | --- |
| MCU / Board | ESP32-S3 / Waveshare ESP32-S3-POE-ETH-8DI-8RO-C |
| Ethernet Chip | WIZnet W5500 |
| MCU–Ethernet Interface | SPI |
| RC Interface | Turnigy iA6B, i-BUS Serial |
| Relay Interface | TCA9554, I2C |
| Software | Arduino, PlatformIO, micro-ROS |
| Network | Ethernet, ROS 2 Jazzy, micro-ROS Agent |

### Dual-Core Task Architecture: Safety Control and ROS Communication

![](https://maker.wiznet.io/upload/ckeditor5/64825bb12c3746a9a6c22ca912ecb336.png)

K.A.R.R. Safety Core는 ESP32-S3의 Dual-Core 구조를 활용하여 **Safety Control과 ROS Communication을 두 개의 독립적인 FreeRTOS Task로 분리**합니다. 이를 통해 micro-ROS 통신 과정에서 지연이 발생하더라도 RC 입력 처리와 Relay 제어가 영향을 받지 않도록 설계되었습니다.

각 Core의 역할은 다음과 같습니다.

| Core | Task | Main Functions |
| --- | --- | --- |
| Core 0 | Control Task | RC i-BUS 수신, Safety State Machine 실행, Relay 제어, LED 및 Buzzer 상태 업데이트 |
| Core 1 | ROS Task | micro-ROS 통신 처리, ROS 2 Topic Publish, Telemetry 전송 |

Control Task는 `app::setup()`에서 `xTaskCreatePinnedToCore()`를 통해 Core 0에 생성되며, ROS Task는 Core 1에서 `app::loop()`를 실행합니다.

특히 ROS Task에서 발생하는 통신 지연이나 Blocking Operation이 Control Task의 실행을 직접 지연시키지 않도록 구성한 것이 핵심입니다. 이를 통해 **로봇의 안전 제어와 네트워크 모니터링을 독립적으로 수행**할 수 있습니다.

## System Architecture

![](https://maker.wiznet.io/upload/ckeditor5/4188ec6ec9824983900029ba1b581d8b.png)

*Generated by ChatGPT*

### Ethernet 및 micro-ROS 설정

`platformio.ini`에서는 `ETH_PHY_W5500`과 SPI 핀을 지정하고 micro-ROS Ethernet Transport를 활성화합니다.

```plaintext
board_microros_distro = jazzy
board_microros_transport = ethernet

-DETH_PHY_TYPE=ETH_PHY_W5500
-DETH_PHY_CS=16
-DETH_PHY_IRQ=12
-DETH_PHY_RST=39
-DETH_SPI_MISO=14
-DETH_SPI_MOSI=13
-DETH_SPI_SCK=15
```

`src/micro_ros_bridge.cpp`는 `SPI.begin()`을 통해 SPI Bus를 초기화하고 `set_microros_ethernet_transports()`를 호출하여 micro-ROS Agent와 연결합니다.

테스트 환경의 네트워크 설정은 다음과 같습니다.

| Device | IP / Port |
| --- | --- |
| Router | `192.168.0.1` |
| ESP32-S3 Relay Board | `192.168.0.24` |
| micro-ROS Agent | `192.168.0.4:8888` |

ESP32-S3는 Static IP를 사용하며, micro-ROS Agent는 동일한 LAN에 연결된 ROS 2 PC에서 실행됩니다.

### ROS2 Telemetry

이 Firmware는 다음 Topic을 통해 시스템 상태를 Publish합니다.

| ROS 2 Topic | 기능 |
| --- | --- |
| `/rc/joy` | RC Channel 데이터, 약 50 Hz |
| `/rc/link` | RC 연결 상태 |
| `/relay_board/heartbeat` | 시스템 동작 상태 |
| `/relay_board/relay_state` | Relay 출력 상태 |
| `/relay_board/inputs` | Digital Input 상태 |
| `/relay_board/estop` | 비상 정지 상태 |

상태 모니터링 Topic은 1 Hz 주기로 Publish됩니다. 이를 통해 ROS 2 환경에서 RC 입력과 안전 상태를 확인할 수 있습니다.

## WIZnet Role in This Project

WIZnet W5500은 ESP32-S3와 SPI로 연결되어 로봇 제어 보드와 ROS 2 PC 사이의 유선 Ethernet 통신 경로를 제공합니다.

이 프로젝트에서 W5500의 역할은 Relay를 직접 제어하는 것이 아니라, ESP32-S3에서 생성된 상태 정보를 micro-ROS Agent로 전달하는 것입니다.

데이터 흐름은 다음과 같습니다.

```plaintext
RC Receiver / Relay / Digital Input
                ↓
             ESP32-S3
                ↓
          W5500 (SPI)
                ↓
             Ethernet
                ↓
          micro-ROS Agent
                ↓
              ROS 2
```

Firmware는 Arduino ESP32 Ethernet API를 이용하는 micro-ROS Transport로 구성되어 있으며, W5500 Hardware Socket을 직접 제어하는 TOE 구현은 확인되지 않습니다.

이러한 구조는 안전 제어 로직을 MCU 내부에 유지하면서도, 외부 ROS 2 시스템에서 장치 상태를 수집하고 분석할 수 있게 합니다.

## Developer Takeaways

K.A.R.R. Safety Core는 W5500 기반 로봇 제어 보드를 개발하는 엔지니어가 다음과 같은 구현 요소를 참고할 수 있는 프로젝트입니다.

- W5500 기반 micro-ROS Ethernet 연결: `platformio.ini`와 `src/micro_ros_bridge.cpp`에서 ESP32-S3의 SPI Ethernet 설정, Static IP, micro-ROS Agent 연결 방식을 확인할 수 있습니다.

- RC Receiver 기반 Local Safety Control: `src/rc_receiver.cpp`는 i-BUS 데이터와 RC 연결 상태를 처리하며, `src/relay_feature_controller.cpp`는 안전 조건에 따라 Relay 출력 권한을 결정합니다.

- Control Task와 ROS Communication의 분리: `src/state_exchange.cpp`는 제어 측 상태 정보를 복사하여 ROS 통신 측으로 전달합니다. 이를 통해 ROS Bridge가 Relay Hardware를 직접 제어하지 않는 구조를 유지합니다.

- 네트워크 연결 손실 대응: micro-ROS Agent가 종료되면 연결 상태를 감지하고 재연결을 수행합니다. 기본 설정에서는 Agent 연결 손실 시 RC 관련 출력도 차단합니다.

이러한 구현 방식은 모바일 로봇, 원격 조작 장비, 산업용 Relay Controller, ROS 2 기반 분산 제어 시스템의 설계에 참고할 수 있습니다.

## Related Maker Content and Application Value

WIZnet Maker Site에는 W5500을 활용한 ROS 2 및 로봇 제어 프로젝트가 소개되어 있습니다. 다음 사례들은 K.A.R.R. Safety Core와 비교할 수 있는 기술적 연결점을 제공합니다.

#### [W5500-Based ESP32-S3 micro-ROS Node Suite for a Distributed Rover Control System](https://maker.wiznet.io/josephsr/projects/w5500-based-esp32-s3-micro-ros-node-suite-for-a-distributed-rover-control-system/?utm_source=chatgpt.com)

ESP32-S3와 W5500을 사용하는 분산 Rover Control System입니다. CAN Motor, BMS, Status Node 등을 micro-ROS로 연결한다는 공통점이 있지만, K.A.R.R. Safety Core는 RC 입력과 Relay 안전 제어를 하나의 보드에서 처리하는 데 집중합니다.

### [How to Build a Wired micro-ROS Node Network with W5500 on RP2040 for a ROS2 Robot?](https://maker.wiznet.io/viktor/projects/how-to-build-a-wired-micro-ros-node-network-with-w5500-on-rp2040-for-a-ros2-robot/?utm_source=chatgpt.com)

RP2040과 W5500을 이용한 분산 로봇의 Ethernet Node 사례입니다. W5500을 통한 micro-ROS 연결이라는 공통점이 있으며, MCU 플랫폼과 네트워크 구현 방식이 다릅니다.

### [Why Does a W5500 Ethernet Link Carry ROS 2 Drive Commands in the ULSTU Buggy?](https://maker.wiznet.io/Benjamin/projects/why-does-a-w5500-ethernet-link-carry-ros-2-drive-commands-in-the-ulstu-buggy/?utm_source=chatgpt.com)

ESP32와 W5500을 사용하여 ROS 2 주행 명령을 UDP로 전달하는 로봇 사례입니다. K.A.R.R. Safety Core는 반대로 ROS 2를 원격 제어 경로가 아닌 상태 모니터링 경로로 제한한다는 차이가 있습니다.

이 프로젝트는 특히 로봇의 안전 관련 동작을 Local Controller에서 수행하면서 ROS 2를 통해 원격 상태 모니터링을 제공하는 설계 사례라는 점에서 활용 가치가 있습니다.

## FAQ

Q1. K.A.R.R. Safety Core에서 ROS 2가 Relay를 직접 제어하나요?

아닙니다. Relay 제어는 ESP32-S3 내부에서 수행하며, ROS 2에는 RC 및 Relay 상태를 Publish하는 구조입니다.

Q2. W5500은 어떤 통신에 사용되나요?

ESP32-S3와 SPI로 연결되어 micro-ROS Agent와의 Ethernet 통신을 담당합니다. Firmware에서는 `ETH_PHY_W5500`을 설정하여 사용합니다.

Q3. 실제 하드웨어 테스트가 완료되었나요?

Ethernet 연결, micro-ROS Telemetry, RC Failsafe, Wireless E-stop 및 Agent 재연결은 테스트가 완료되었습니다. 전체 Relay 및 Digital Input 기능 검증은 아직 진행 중입니다.

## Verified Scope and Sources

2026년 11월 9일 기준으로 제공된 GitHub Repository Snapshot과 공개 Maker Site 자료를 검토했습니다.

| Source | Link | Verified Details |
| --- | --- | --- |
| Original Repository | [GitHub](https://github.com/Aeolus96/karr-safety-core?utm_source=chatgpt.com) | Firmware, README, Architecture |
| Firmware Configuration | [platformio.ini](https://github.com/Aeolus96/karr-safety-core/blob/main/platformio.ini?utm_source=chatgpt.com) | W5500 SPI, micro-ROS |
| Ethernet Implementation | [micro_ros_bridge.cpp](https://github.com/Aeolus96/karr-safety-core/blob/main/src/micro_ros_bridge.cpp?utm_source=chatgpt.com) | Ethernet, Static IP, Agent |
| Hardware Test Notes | [Test Bench](https://github.com/Aeolus96/karr-safety-core/blob/main/docs/test-bench/notes.md?utm_source=chatgpt.com) | 테스트 단계 및 검증 범위 |

공개된 README에는 2026년 10월 17일 기준 Ethernet 및 RC Safety 테스트 결과가 기록되어 있습니다. GitHub Star, Fork, Release 등의 최신 정량 지표는 확인되지 않았습니다.

K.A.R.R. Safety Core는 ESP32-S3의 로컬 안전 제어 기능과 W5500의 Ethernet 연결을 결합한 로봇 제어 Firmware 사례입니다. RC 입력과 Relay 제어를 MCU에서 직접 처리하고, micro-ROS를 통해 상태 정보를 ROS 2 시스템으로 전달합니다. 이를 통해 로봇의 제어 경로와 네트워크 모니터링 경로를 분리하는 실제 구현 방식을 확인할 수 있습니다.

---

Source: https://maker.wiznet.io/Aimee0/projects/k-a-r-r-safety-core-ros-2-robot-safety-control-and-ethernet-monitoring-system/
