micro-ROS 리소스 제약 MCU에서 ROS 2 환경에 참여하기 위한 프레임워크 W5500용 커스텀 트랜스포트 계층을 통해 ROS 2 에이전트와 통신
네트워크 스택 정적 IP & DHCP 모두 지원 TCP/UDP 프로토콜을 활용한 통신 “Secure communication channels”를 고려한 구조(추후 TLS 확장에도 참고 가능)
안전성 기능 Watchdog Fail-safe 메커니즘으로 비정상 동작 시 자동 복구를 지향
시스템 아키텍처 – 중앙 관리와 엣지 노드의 역할 분담
Central Traffic Management (Cloud / Server) 도시 전체의 교통 데이터를 수집·분석 정책/전략 수준의 제어 명령 전송
Edge Router & Local Network 현장(교차로, 구간)에 설치된 여러 엣지 노드들을 묶는 네트워크
Smart Traffic Node (본 프로젝트) 센서(차량/보행자) 입력 수집 STM32F103 + FreeRTOS + micro-ROS에서 로컬 의사결정 W5500 이더넷으로 중앙 시스템과 ROS 2 메시지 교환 이 구조는 “클라우드는 두뇌, 엣지는 반사신경” 같은 역할 분리를 원하는 스마트 시티 아키텍처에 잘 맞습니다.
프로젝트 구조 – STM32Cube 기반 설계
GitHub 저장소는 STM32CubeIDE 프로젝트 구조를 그대로 사용하고 있어, 바로 IDE에 임포트해서 빌드할 수 있습니다.
이 프로젝트의 가장 큰 특징은 micro-ROS를 통해 ROS 2 환경과 직접 통신한다는 점입니다. 호스트 PC에 ROS 2 환경 준비 Ubuntu + ROS 2 (Humble, Foxy 등) 설치 micro-ROS Agent 실행 예시 ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
STM32 엣지 노드 동작 보드가 부팅되면, 설정된 IP/포트로 micro-ROS Agent에 자동 접속 이후 토픽 Publish/Subscribe, 서비스 호출 등 ROS 2 생태계와 연동 가능 이를 통해 센서 데이터(교통량, 보행자 감지, 이벤트 정보)를 ROS 2 토픽으로 전송하거나, 중앙 시스템으로부터 신호 제어 명령을 수신할 수 있습니다.
왜 스마트 교통 시스템에 ROS2를 사용 했을까?
스마트 교통 인프라를 하나의 ROS 시스템처럼 다루기 위해 – 중앙 서버(클라우드)와 교차로 엣지 노드를 모두 ROS 2 노드로 취급해서 토픽/서비스로 쉽게 연동.
실시간·신뢰성 있는 통신을 쉽게 구현하기 위해 – DDS 기반 QoS 설정(신뢰성, 지연, 히스토리 등)으로 안전 메시지와 로그 데이터를 성격에 맞게 전송 가능.
MCU까지 ROS 2 네트워크에 편입하기 위해 – micro-ROS + FreeRTOS로 STM32F103 같은 소형 MCU도 ROS 2 그래프에 참여하게 만들 수 있음.
확장성과 생태계를 활용하기 위해 – ros2 툴, 시뮬레이션, 데이터 로깅, 다른 로봇·자율주행 시스템과의 통합을 그대로 활용 가능.
Project Goal – Edge Computing for Smart Traffic
Real-time traffic monitoring and control Quickly collect data from traffic lights, intersections, and crosswalks, and perform control actions locally at the edge.
Minimizing latency through local processing Instead of sending all data to the cloud, the edge MCU makes the first decision and forwards only the necessary information to the upper-level system.
Seamless integration with smart city infrastructure Using micro-ROS, the node can easily integrate with ROS 2–based central traffic management systems and cloud analytics platforms.
The most notable feature of this project is that it communicates directly with a ROS 2 environment via micro-ROS.
Prepare a ROS 2 Environment on the Host PC
Install Ubuntu + ROS 2 (Humble, Foxy, etc.)
Example: Running the micro-ROS Agent
ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
STM32 Edge Node Operation
When the board boots, it automatically connects to the micro-ROS agent using the configured IP and port.
After that, it can integrate with the ROS 2 ecosystem through topic publish/subscribe, service calls, and more.
Through this, the node can:
Publish sensor data (traffic volume, pedestrian detection, event information) to ROS 2 topics
Receive traffic signal control commands from the central system
Why Use ROS 2 for a Smart Traffic System?
Treating the Smart Traffic Infrastructure as One ROS System
Both the central server (cloud) and intersection edge nodes are treated as ROS 2 nodes, making it easy to connect them via topics and services.
Easy Implementation of Real-Time and Reliable Communication
DDS-based QoS settings (reliability, latency, history, etc.) allow safety-critical messages and logging data to be transmitted according to their requirements.
Bringing MCUs into the ROS 2 Network
With micro-ROS + FreeRTOS, small MCUs like the STM32F103 can participate directly in the ROS 2 graph.
Leveraging ROS 2 Scalability and Ecosystem
Can fully use ros2 tools, simulations, data logging, and integration with other robots or autonomous driving systems without reinventing the wheel.