Preprint
Article

This version is not peer-reviewed.

Co-Simulation and Runtime Verification of Micro-ROS Communication Mechanisms

Submitted:

27 April 2026

Posted:

28 April 2026

You are already at the latest version

Abstract
Micro-ROS is a lightweight robot operating system for embedded devices with resource-constrained real-time features. Its communication mechanism, based on the XRCE-DDS protocol, facilitates data exchange in constrained environments. To ensure the safety and reliability of message transmission in Micro-ROS, this paper presents an integrated approach that combines simulation and runtime verification. A formal model of XRCE-DDS is constructed using timed automata, while key properties derived from the protocol are expressed in constrained Signal Temporal Logic (STLlb=0). The model is implemented and simulated via Simulink/Stateflow. Furthermore, the key properties are verified with the runtime verification method using the Logical and Temporal Assessments tool in the Test Manager of Simulink Test. Through integrating simulation with runtime verification, this work effectively improves the safety assurance of the Micro-ROS communication mechanisms.
Keywords: 
;  ;  ;  ;  

1. Introduction

The Robot Operating System(ROS) [1] has become the most widely used middleware for the development of robotic software systems. Its safety and reliability are critical to ensuring the robustness of robotic systems. in ROS-based robotic applications, Micro-ROS serves to bridge the performance gap between resource-constrained microcontrollers and powerful computing devices [2,3]. ROS encompasses communication mechanisms, software toolkits, high-level robotic capabilities, and a comprehensive ecosystem. It is extensively applied in the research and development of autonomous robots, unmanned aerial vehicles [4], and intelligent vehicles [5,6], establishing it as a meta-operating system in robotic system development.
Micro-ROS employs XRCE-DDS (eXtremely Resource Constrained Environments DDS) as its core communication middleware in resource-constrained embedded devices. This design aims to adapt the powerful data distribution capabilities of DDS to low-power, limited-memory environments such as microcontrollers (MCUs). This design enables small devices such as microcontrollers to seamlessly integrate into the extensive DDS ecosystem without needing to run a full DDS stack, facilitating real-time and reliable data exchange with more powerful computing nodes (e.g., servers, robot main control computers, etc.).
XRCE-DDS is a client-agent-based standard that enables small, resource-constrained embedded devices to connect to the DDS global data space. The modeling, implementation and analysis of XRCE-DDS applications in distributed multiprocessor real-time embedded systems are key research focuses. Among these, XRCE-DDS utilizes an XML-based data description language to define the format and content of data exchange. Through modeling and implementation, researchers investigate approaches to guaranty real-time data transmission and processing in distributed environments.
The safety of XRCE-DDS is crucial to the Micro-ROS communication mechanism. To construct highly trustworthy Micro-ROS communication based on XRCE-DDS, formal methods are applied to model and verify data exchange in Micro-ROS.
Tools such as temporal logic and process algebra can be used to establish precise mathematical models for core interactions in XRCE-DDS, including client-agent handshakes, message sequences, and state machines. This approach rigorously proves that the protocol is free from deadlocks and livelocks under ideal conditions, satisfies critical safety properties, and eliminates logical flaws at the design stage. Safety policies, such as agent access control lists and topic permission mappings, can be defined using formal languages to enable automated verification of policy consistency and completeness.
The reliability of the XRCE-DDS architecture design has been significantly improved through the application of formal methods. When applied to high-safety fields such as autonomous driving and medical devices, this approach will effectively enhance the safety and operational reliability of these devices.
This paper focuses on the Micro-ROS communication mechanism, employing a combined approach of simulation and formal methods to explore the safety and reliability of XRCE-DDS. Timed automata are introduced for formal modeling, while constrained signal temporal logic is used to characterize the key properties of XRCE-DDS. The model is implemented in Simulink/Stateflow, and its effectiveness is evaluated through simulations. Furthermore, runtime verification is performed using the Logical and Temporal Assessments tool in Simulink Test’s Test Manager to validate critical properties.
The contributions of this paper are mainly reflected in three key aspects.
1.
This study treats the Micro-ROS communication middleware, specifically Micro XRCE-DDS, as a time-critical system and builds abstract modeling. Based on the open-source code of XRCE-DDS, timed automata models are built, including parallel of the client_publisher, client_subscriber, Agent, proxy_publisher, and proxy_subscriber modules.
2.
A constrained signal temporal logic, denoted as STL lb = 0 , is proposed to describe the properties of the Micro-ROS communication mechanism. Key properties are formally specified by the constrained signal temporal logic. Based on an analysis of the XRCE-DDS protocol, critical properties are extracted from natural language descriptions and subsequently converted into logical formulas.
3.
This paper proposes a co-simulation and runtime verification framework based on models for Micro-ROS. The framework is implemented in Simulink/Stateflow, where simulations are conducted and runtime verification is performed to validate critical system properties.
The remainder of this paper is organized as follows. Section 2 provides background and related work; Section 3 presents the overall design architecture; Section 4 introduces the formal modeling of Micro-ROS; Section 5 extracts key properties from the XRCE-DDS protocol and describes them using the constrained signal temporal logic STL lb = 0 ; Section 6 details the model implementation and simulation in Simulink/Stateflow, as well as runtime verification. Finally, the conclusion and future work are summarized.

3. Framework of Micro-ROS Modeling and Analysis

3.1. Micro XRCE-DDS Communication Mechanism

Micro-ROS is a lightweight robot operating system optimized based on ROS 2. It integrates resource-constrained embedded device nodes into ROS 2 DDS and enables communication with these devices through the tailored Micro XRCE-DDS middleware [22]. The architecture of the Micro XRCE-DDS communication mechanism is illustrated in Figure 1 [23].
Micro XRCE-DDS is a protocol based on a client-server architecture that enables communication between resource-constrained embedded devices and DDS. It consists of servers (XRCE Agents) and clients (XRCE Clients). The XRCE Agent acts as an intermediary between the XRCE Client and the DDS global data space, serving as a bridge between embedded devices and DDS. Each XRCE Client on the embedded device side connects to the DDS domain through the XRCE Agent. The XRCE Agent represents the XRCE Client and interacts as a peer with other entities in the DDS domain.
Micro XRCE-DDS is designed with transport protocol independence. It ensures reliable communication while remaining agnostic to the underlying transport protocol, thereby decoupling its functionality from specific transport layer implementations.

3.2. Time Automata

Real-time performance is a critical characteristic of embedded devices. We employ timed automata to model real-time behavior. Timed automata are effective for modeling systems with timed characteristics. A timed automaton comprises a finite set of time variables called clocks. Clocks differ from ordinary variables due to restricted access, which implicitly increments as time progresses. Clocks have only two operation: read and reset. All clocks advance at a uniform rate. After the d time units have elapsed, each clock’s value increases by d. Thus, a clock’s value represents the time elapsed since its last reset.
Definition 1  C l o c k   C o n s t r a i n t Clock constraints are primarily used to restrict possible time expenditures. They are defined as follows:
t c : : = x < c x > c x c x c t c t c
where, c is a natural number.
C denotes a finite set of clock variables, where any variable x in C is a clock variable. Additionally, C C ( C ) represents the set of clock constraints defined over the clock set C.
Definition 2  t i m e d   a u t o m a t a A timed automata T A is a tuple:
TA = ( Loc , Loc 0 , Act , C , Inv , )
Where
  • L o c : is the set of locations.
  • L o c 0 L o c is the initial location set.
  • A c t is a finite set of actions or events. Here, actions are divided into two types: general actions and communication actions. Specifically: c ! m s g denotes sending a message m s g through channel c; c ? m s g denotes receiving a message via channel c and storing it in the variable m s g .
  • C is the finite set of clocks.
  • i n v : L o c C C ( C ) is the Invariant Function.
  • L o c × C o n d ( C ) × A c t × L o c is the set of transition relation.
The transition relation is denoted by a quadruple ( l , g , a , l ) , where g C o n d ( C ) is a clock constraint with C o n d ( C ) C C ( C ) , and a is an action. ( l , g , a , l ) indicates that when g is satisfied, a transition occurs from location l to l , and the action a is executed during this transition. The function i n v ( ) assigns an invariant to each location,, representing the time constraint for remaining there. The clock invariant i n v ( ) must be satisfied while the system is at that location. If this invariant is violated, the system must leave the current location.

3.3. Framework of the Micro-ROS

The framework for formal modeling and analysis of micro-ROS communication mechanism, XRCE-DDS, is illustrated in Figure 2. For XRCE-DDS, timed automata are employed to abstract and construct models of the XRCE-DDS Agent and Client from open-source code. Key properties of the XRCE-DDS specification are extracted and specified using Constrained Signal Temporal Logic. The model is implemented and simulated in Simulink. Subsequently, runtime verification of key properties is performed using Simulink’s verification toolkit. Through simulation and verification, a model of XRCE-DDS extracted from the code is satisfied with the specification.

4. Formal Modeling the Micro-ROS

Micro XRCE-DDS of the micro-ROS communication mechanism consists of Agents and Clients. Based on the functionalities of these components, the system is modeled as five modules: client_publisher, client_subscriber, Agent, proxy_publisher, and proxy_subscriber modules. The modular architecture is illustrated in Figure 3.
The five modules in the architecture correspond to three types of devices: resource-constrained devices, Agents, and resource-unconstrained devices.
The client_publisher module and client_subscriber module represent two embedded devices operating in resource-constrained environments, such as cameras and alarm systems. These modules correspond to two functional roles of the Micro XRCE-DDS Client. The first acts as a publisher in the Micro XRCE-DDS domain, sending messages to a specified topic within the ROS 2 network. The other acts as a subscriber, receiving messages from topics of interest in the DDS domain.
The proxy_publisher and proxy_subscriber modules represent two non resource unconstrained devices. The proxy_publisher receives messages from the client_publisher, while the client_subscriber receives messages from the proxy_subscriber. In this process, the client_publisher and proxy_publisher form a corresponding client-proxy pair. The client_subscriber and proxy_subscriber form another client-proxy pair. The Agent module is responsible for receiving transmitted messages and performing selective distribution.

4.1. Client_Publisher Model

The client_publisher module comprises four functional components: a reliable input stream, a reliable output stream, a heartbeat reply message stream, and message transmission. These components are modeled using four concurrent timed automata, denoted as T A C P _ R I S , T A C P _ R O S , T A C P _ H A S , and T A C P _ F S .
The overall timed automaton model of the client_publisher is defined as:
T A C P = T A C P _ R I S T A C P _ R O S T A C P _ H A S T A C P _ F S
Only the T A C P _ R O S model is provided here. T A C P _ R O S models the reliable output stream, and its timed automaton model is as follows:
Definition 3  T A C P _ R O S is a tuple:
T A C P _ R O S = ( L o c C P _ R O S , L o c 0 C P _ R O S , A c t C P _ R O S , C C P _ R O S , I n v C P _ R O S , C P _ R O S )
Where,
  • L o c C P _ R O S = { p r e s e n d i n g , s e n d i n g } .
  • L o c 0 C P _ R O S = { p r e s e n d i n g } .
  • A c t C P _ R O S = { a _ q u e u e _ m s g , c _ b a l a n c e } .
  • C C P _ R O S = { t } represents the clock set.
  • i n v C P _ R O S = { ( p r e s e n d i n g , t 1 ) , ( s e n d i n g , t 3 ) } . It is the invariant function in the reliable output stream model.
  • ↦ is the set of transition relation in T A C P _ R O S , shown as Figure 4.
In the action set, c _ b a l a n c e denotes a reliable channel used to receive responses to messages. a _ q u e u e _ m s g is an unreliable message channel with a capacity of 1. Messages transmitted through a _ q u e u e _ m s g have a structured format with two parts: DATA and HB. DATA contains the message content, while HB contains heartbeat information.
In this timed automaton model, the location p r e s e n d i n g indicates preparing to send a message, with the location invariant being t 1 . When the time guard t > 1 is satisfied, a transition occurs: the message m s g is sent via the channel a _ q u e u e _ m s g , and the clock t is reset. The location transitions from p r e s e n d i n g to s e n d i n g .
The location s e n d i n g represents the message sending process. When the time guard t > 3 is met, the previous message sent successfully and another message is transmitted through the channel a _ q u e u e _ m s g , and the clock t is reset.
Since a _ q u e u e _ m s g is an unreliable channel, message loss may occur during transmission. If a message is received b m s g from the reliable channel c _ b a l a n c e during 3 time units, a previously sent message was lost and needs to be retransmitted. The location then turns from s e n d i n g back to p r e s e n d i n g , ready to resend the message.

4.2. Client_Subscriber Model

Similar to the client_publisher, the client_subscriber also consists of four functional components: a reliable input stream, a reliable output stream, a heartbeat reply message stream, and message transmission. However, in terms of message transmission, unlike the client_publisher, it includes not only a sending model but also a receiving model. Therefore, this module consists of five timed automata, labeled T A C S _ R I S , T A C S _ R O S , T A C S _ H A S , T A C S _ F S , and T A C P _ R M .
The overall timed automaton model of the c l i e n t _ s u b s c r i b e r can be expressed as:
T A C S = T A C S _ R I S T A C S _ R O S T A C S _ H A S T A C S _ F S T A C S _ M S
Here we provide the definition of T A C S _ R O S . Since the client_subscriber must account for the device’s sleep characteristics, the T A C S _ R O S automaton incorporates this feature by adding a s l e e p location. The formal model T A C S _ R O S is defined as follows.
Definition 4  T A C S _ R O S is a five tuple:
T A C S _ R O S = ( L o c C S _ R O S , L o c 0 C S _ R O S , A c t C S _ R O S , C C S _ R O S , I n v C S _ R O S , C S _ R O S )
Where,
  • L o c C s _ R O S = { i n i t , w a i t R e t , t i m e o u t , s l e e p } .
  • L o c 0 C S _ R O S = { i n i t } .
  • A c t C S _ R O S = { a _ s e t _ p u s h _ s u b _ m s g , c _ s u b s _ s u c c e s s , a _ s t o r e I n f o , a _ r e s t o r e I n f o , f _ s u b _ f i n i s h e d , l e f t w a k e t i m e } .
    The communication actions are a _ s e t _ p u s h _ s u b _ m s g , c _ s u b s _ s u c c e s s and f _ s u b _ f i n i s h e d . a _ s e t _ p u s h _ s u b _ m s g is a channel with a certain capacity, capable of facilitating asynchronous communication.
  • C C S _ R O S = { t 1 , t 2 } represents the clock set. t 1 is the clock used to record awake and sleep durations. t 2 tracks whether the sending time has exceeded the timeout threshold.
  • i n v C S _ R O S = { ( i n i t , t 1 100 ) , ( w a i t R e t , ( t 1 100 ) a n d ( t 2 9 ) ) ,
    ( t i m e o u t , ( t 1 100 ) a n d ( t 2 10 ) ) , ( s l e e p , t 1 100 ) } .
  • ↦ is the set of transition relation in T A C S _ R O S , shown as Figure 5.
In the location set, i n i t represents the initial location where the reliable output stream begins. w a i t R e t denotes the location where the reliable output stream awaits the return result of the subscription message after sending it. t i m e o u t indicates the location reached when the reliable output stream times out while waiting. s l e e p represents the location where the client_subscriber model enters sleep mode, causing the reliable output stream to cease operation.
In the initial state i n i t , it is assumed that the embedded device is awake and the clock t 1 is reset. Once the channel f _ s u b _ f i n i s h e d receives a message from the proxy subscribe model, which is stored in the variable f m s g , and the message is correct, the location transitions to w a i t R e t . Additionally, the clock t 2 is reset. If the clock t 2 > 9 and f m s g 0 at the location w a i t R e t , the received message is incorrect and the system changes to the location t i m e o u t . After remaining in the location t i m e o u t for one time unit, the system returns to i n i t to attempt receiving the message again. The proxy subscribe model re-sends this message after the timeout.
An response message is sent through the channel c _ s u b s _ s u c c e s s to indicate that the message has been received correctly, and the system returns to the initial location i n i t .
Assuming that the embedded device has an awake duration of 100 time units and a sleep duration of 50 time units, if the device remains awake in the locations i n i t , w a i t R e t , or t i m e o u t for more than 100 time units, it immediately enters the location s l e e p . The device remains dormant for 50 time units in the location s l e e p . When the device enters the location s l e e p , it stores the current context via the action a _ s t o r e I n f o . Upon awakening, the context is restored via the action a _ r e s t o r e I n f o .

4.3. Agent Model

In the Micro XRCE-DDS Agent, there is a module responsible for retrieving various types of messages from the network and placing them into a scheduler, which utilizes a multi-level priority queue. Another module reads messages from the queue, distributes them to different ProxyClient objects based on their IDs, and processes them further. Based on these two steps, the Agent model abstracts two functionalities: message reception and message distribution. Message reception acquires incoming messages from the network, while message distribution determines the target agent of a message based on its content and forwards it accordingly. Both message reception and distribution can be modeled using two timed automata: T A R E V and T A D I S . The overall Agent module model can be represented as following.
T A A G = T A R E V T A D I S
In the agent module, the T A R E V model is defined below.
Definition 5  T A R E V is a tuple:
T A A G = ( L o c R E V , L o c 0 R E V , A c t R E V , C R E V , I n v R E V , R E V )
Where,
  • L o c R E V = L o c 0 R E V = { i d l e } .
  • A c t R E V = { a _ q u e u e _ m s g } .
  • C R E V = { t } .
  • i n v R E V = { ( i d l e , t 1 ) } .
  • The transition relation is shown as Figure 6.
In the timed automaton T A R E V model, when in the i d l e location and the time guard condition t > 1 is satisfied, the automaton receives a message from the channel a _ p o p _ p u s h _ m s g , stores it in the variable m s g , and resets the clock t to wait for the next message reception. The channel a _ p o p _ p u s h _ m s g has a certain capacity, enabling asynchronous communication. When the Agent module receives a message, it forwards the message to either the proxy_publisher module or the client_subscriber module via T A D I V , depending on the type of message.

4.4. Proxy_Publisher Model

The proxy_publisher module represents a ProxyClient entity in a Micro XRCE-DDS. The ProxyClient is responsible for receiving data from the client_publisher through the Agent module and forwarding it to the DDS domain.
According to the description of XRCE-DDS in the XRCE-DDS protocol, when the XRCE-DDS Agent acts as a publisher proxy, it receives messages from the client_publisher. The proxy_publisher needs to abstract a timed automaton for the reliable input stream to process data received from the Agent module.
Therefore, the ProxyClient entity is abstracted into timed automata models responsible for the reliable input stream, heartbeat messages, and message transmission. The three timed automata constructed for the proxy_publisher module are T A P P _ R I S , T A P P _ H A S , and T A P P _ F S . The overall timed automaton model for the proxy_publisher module can be expressed as:
T A P P = T A P P _ R I S T A P P _ H A S T A P P _ F S
In the proxy_publisher module, T A P P _ H A S is the heartbeat response module, and its model is as follows.
Definition 6  T A P P _ H A S is a tuple:
T A P P _ H A S = ( L o c P P _ H A S , L o c 0 P P _ H A S , A c t P P _ H A S , C P P _ H A S , I n v P P _ H A S , P P _ H A S )
Where,
  • L o c P P _ H A S = { R e v , M i s s M s g , C h e c k S e q } .
  • L o c 0 P P _ H A S = { R e v } .
  • A c t P P _ H A S = { a c k _ m s g , n a c k _ m s g , H B } .
  • C P P _ H A S = .
  • i n v P P _ H A S = .
  • ↦ is the set of transition relation in T A P P _ H A S , shown as Figure 7.
In the A c t P P _ H A S set, three channels have been established. One is for heartbeat messages, one for response messages, and another for reporting packet loss. Heartbeat messages are received through the H B channel and packet loss is checked. If no packet loss is detected, a response message is sent through the a c k _ m s g channel. If packet loss occurs, the relevant information is transmitted via the n a c k _ m s g channel.
T A P P _ H A S receives messages through the H B channel, unpacks them, and checks for packet loss. If the sequence number in the heartbeat message is greater than the recorded message number, it indicates that the packet was lost earlier. In this case, a message is sent through the n a c k _ m s g channel to request retransmission. Otherwise, if the message is received, a response is sent through the a c k _ m s g channel to confirm receipt.

4.5. Proxy_Subscriber Model

The proxy_subscriber module serves as the entity model corresponding to the client_subscriber for the Micro XRCE-DDS Agent. It responds to client_subscriber subscriptions and sends data to the client_subscriber.
As described in the XRCE-DDS protocol, when the XRCE-DDS Agent acts as a proxy for subscribers, it must receive messages from the proxy_subscriber and retransmit them to the client_subscriber. To ensure consistency between sent and received messages, it is necessary to periodically send heartbeat messages and receive response messages. Furthermore, since the XRCE-DDS Client may periodically enter sleep mode, the proxy_subscriber must not send messages once the Client has entered the sleep state.
The proxy_subscriber module utilizes the reliable input stream module T A P S _ R I S and the reliable output stream module T A P S _ R O S to process incoming and outgoing messages. It also handles heartbeat messages to be sent and processes received response messages, which are modeled using the timed automaton T A P S _ H A S . The proxy_subscriber sends two types of messages: basic messages requiring reliable transmission and heartbeat messages ensuring reliable delivery. This sub-function also checks whether the client_subscriber module is in a sleep state. The proxy_subscriber can only send messages when the client_subscriber is awake. A timed automaton, T A P S _ F S W T , is constructed for Periodic Sending. The proxy_subscriber module consists of four timed automata models: T A P S _ R I S , T A P S _ R O S , T A P S _ H A S , and T A P S _ F S W T . The proxy_subscriber module can be represented as:
T A P S = T A P S _ R I S T A P S _ R O S T A P S _ H A S T A P S _ F S W T
For the T A P S _ F S W T timed automaton, according to the description of the XRCE-DDS Agent in the XRCE-DDS protocol, it is necessary to receive the subscriber messages and respond accordingly. According to the XRCE-DDS protocol, the timed automaton T A P S _ F S W T must receive sleep or awake messages from the client_subscriber and respond accordingly.
The XRCE-DDS Agent cannot send messages when the client_subscriber is in sleep state. This timed automaton is defined as follows.
Definition 7  T A P S _ S F W T is a tuple:
T A P S _ S F W T = ( L o c P S _ S F W T , L o c 0 P S _ S F W T , A c t P S _ S F W T , C P S _ S F W T , I n v P S _ S F W T , P S _ S F W T )
Where,
  • L o c P S _ S F W T = { c l i e n t S l e e p , c l i e n t W a k e , f l u s h M s g } .
  • L o c 0 P S _ S F W T = { c l i e n t S l e e p } .
  • A c t P S _ S F W T = { C _ s t a t , C _ s l e e p , s l e e p _ f l a g , w a k e _ f l a g } .
  • C P S _ S F W T = { t } .
  • i n v P S _ S F W T = { ( c l i e n t W a k e , t < = 100 ) , ( f l u s h M s g , t < = 100 ) } .
  • ↦ is the set of transition relation in T A P S _ S F W T , shown as Figure 8.
In the location set L O C P S _ F S W T , c l i e n t S l e e p is the initial location, representing that the client_subscriber, is asleep. Upon receiving a wake-up signal from the client_subscriber, a transition occurs from the c l i e n t S l e e p to the c l i e n t W a k e location, indicating that the client_subscriber has awaked. The f l u s h M s g location denotes the location in which the proxy_subscriber can transmit messages. Once a sleep message is received from client_subscriber, the system enters the location R e a d y S l e e p and then transitions to the location c l i e n t S l e e p , and stops transmitting messages.
In the action set A c t P S _ S F W T , there are four actions. When the channel C _ s t a r t receives the wake-up signal, the embedded device is awakened. The channel C _ s l e e p receives the sleep signal, and the embedded device is going to enter a sleep state. The channel s l e e p _ f l a g sends a message instructing the proxy_subscriber to stop transmitting messages to the embedded device. The channel w a k e _ f l a g transmits a message to the proxy_subscriber model, which then sends data to the client_subscriber module.
The embedded device is sleep in the initial location c l i e n t S l e e p . Once it wakes up, the embedded device sends a signal to the proxy_subscriber module via the C _ s t a r t channel, indicating that the embedded device has entered the awakened state. The T A P S _ F S W T then sends a signal to T A P S _ R O S notifying it that the embedded device is awake, which allows T A P S _ R O S to send messages. If the embedded device needs to enter the sleep state again, T A P S _ F S W T sends a signal to T A P S _ R O S indicating that the embedded device is going to sleep and no further messages should be sent.

5. Properties of Micro-ROS Model

To perform runtime verification of the model, it is to extract the key properties from the Micro-ROS communication specifications and represent them using constrained signal temporal logic formulas.

5.1. Constrained Signal Temporal Logic

Signal Temporal Logic (STL) is a temporal logic used to describe the behavior of continuous-time signals. By incorporating real-valued time variables and temporal operators, STL formally characterizes the dynamic properties of systems over continuous time intervals. Its semantics are based on measurements over time intervals, which provides a logical language for verifying and monitoring of real-time systems.
The syntax of an STL formula is defined as follows:
ϕ : : = true p ¬ ϕ ϕ 1 ϕ 2 ϕ 1 U [ a , b ] ϕ 2
For the time interval [ a , b ] , a , b R 0 and a b . In the Micro-ROS communication model, the focus is generally on the upper bound of the response time when describing the model’s properties, while the lower bound corresponds to the current moment. Therefore, to better represent the Micro-ROS requirements, we propose a constrained signal temporal logic, denoted as STL lb = 0 . The syntax and semantics of STL lb = 0 are defined below.
Definition 8 An STL lb = 0 formula ϕ is recursively defined:
ϕ : : = p ¬ ϕ ϕ 1 ϕ 2 ϕ 1 U [ 0 , a ] ϕ 2
Where p is an atomic proposition, a in the time interval [ 0 , a ] denotes the upper bound of the time interval, and a > 0 . ϕ 1 and ϕ 2 are STL lb = 0 formulas.
Other operators, such as the implication operator →, the future operator F , and the always operator G , can be expressed as follows:
ϕ 1 ϕ 2 = ¬ ϕ 1 ϕ 2
F [ 0 , a ] ϕ = True U [ 0 , a ] ϕ
G [ 0 , a ] ϕ = ¬ F [ 0 , a ] ¬ ϕ
The satisfaction relation ( s , t ) φ denotes if a signal s satisfies an STL lb = 0 formula ϕ at time t.
Definition 9 The STL lb = 0 semantics for a signal s is given recursively below.
( s , t ) p p ( s ( t ) ) = T ( s , t ) ¬ ϕ ( s , t ) ¬ ϕ ( s , t ) ϕ 1 ϕ 2 ( s , t ) ϕ 1 ( s , t ) ϕ 2 ( s , t ) ϕ 1 U [ 0 , a ] ϕ 2 t [ t , t + a ] , ( s , t ) ϕ 2 and t [ t , t ] , ( s , t ) ϕ 1
Where p ( s ( t ) ) indicates that the signal s satisfies property p at time t. For example, consider the property: "Within 200 seconds, if property p is satisfied, then property q will be satisfied within 3 seconds." This property can be expressed using the STL lb = 0 formula as:
G [ 0 , 200 ] ( p F [ 0 , 3 ] q )
the outermost G [ 0 , 200 ] represents the duration of the system’s monitoring. During this monitoring period, if property p is satisfied, then property q will also be satisfied within 3 seconds.

5.2. Key Properties Abstraction

To ensure the reliability of communication, seven key properties are extracted based on the Micro-ROS communication specifications. These properties primarily address message transmission and reception, ensuring consistent ordering of messages and the ability to retransmit them in case of loss.
property ECFS: All messages sent by the client_publisher can be delivered.
The property is formulated as follows:
F [ 0 , 180 ] c l i e n t _ p u b _ f i n i s h e d = 1
In runtime verification, when the proxy_publisher receives all messages sent by the client_publisher, the signal c l i e n t _ p u b _ f i n i s h e d eventually becomes 1, indicating that all messages have been delivered.
property ECRA: The client_subscriber can receive all messages to which it has subscribed.
This property is formulated as follows:
F [ 0 , 180 ] c l i e n t _ r e c e i v e d _ a l l = 1
In runtime verification, when the client_subscriber has received all subscribed messages, the signal c l i e n t _ r e c e i v e d _ a l l eventually becomes 1.
property NIWS: Once the client_subscriber enters sleep mode, no additional messages will arrive to wake it.
This property is formulated as follows:
G [ 0 , 180 ] ( s u b C l i e n t _ s t a t u s = 1 G [ 0 , 50 ] s u b C l i e n t _ r e c e i v e S i g = f a l s e )
When the client_subscriber enters sleep mode (indicated by the signal s u b C l i e n t _ s t a t u s changing to 1), it will no longer passively receive messages from the proxy_subscriber. At this point, the value of the signal s u b C l i e n t _ r e c e i v e S i g for message arrivals becomes false and remains so throughout the sleep duration (50 seconds).
property RMIO: The proxy_publisher always receives messages in the same order as they are sent by the client_publisher.
This property is formulated as follows:
G [ 0 , 180 ] ( p u b l i s h e r _ l a s t _ r e c e i v e d 10 V i d e o I n f o = T D D S )
When the proxy_publisher receives the 10th message (i.e., the final message), the V i d e o I n f o array containing the messages to be sent must be identical to the TDDS array of received messages. Since the array indices correspond to the sequential order of message transmission and reception, identical arrays indicate that the order of message sending and receiving order is consistent.
property RMIO2: The client_subscriber always receives messages in the same order as they are sent by the proxy_subscriber.
This property is formulated as follows:
G [ 0 , 180 ] ( s u b s c r i b e r _ l a s t _ r e c e i v e d 10 G e t I n f o = F D D S )
When the client_subscriber receives the 10th message (i.e., the final message), the G e t I n f o array containing the messages to be sent must be identical to the FDDS array of received messages. Since the array indices correspond to the sequential order of message transmission and reception, identical arrays indicate that the order of messages sending and receiving is consistent.
property TMRK: When a message is lost, the receiver can detect it in a timely manner.
This property is formulated as follows:
G [ 0 , 180 ] ( m i s s i n g _ f i g = 1 & & s e n d M i s s S e q < l a s t _ r e c e i v e )
F [ 0 , 20 ] f i n d M i s s S e q = s e n d M i s s S e q
If a message is not acknowledged by the receiver, the receiver will detect the loss within 20 seconds and notify the sender of the missing sequence number by setting the f i n d M i s s S e q signal.
property FARS: All messages not received by the client_subscriber will be promptly resent by the proxy_subscriber.
This property is formulated as follows:
G [ 0 , 180 ] ( l a s t _ s e n t > l a s t _ a c k + 1 F [ 0 , 20 ] l a s t _ s e n t = l a s t _ a c k + 1 )
When the client_subscriber fails to receive a message, the l a s t _ s e n t value of the proxy_subscriber will be greater than the acknowledged value of l a s t _ a c k . The proxy_subscriber attempts to resend the message; upon successful transmission, it adjusts the l a s t _ s e n t value to match l a s t _ a c k within 20 seconds.

6. Implementation, Simulation and Verification

We utilized Simulink/Stateflow to implement and simulate each module, and analyzed the results. We also applied the Logical and Temporal Assessments tool from Simulink’s Simulink Test package Test Manager to perform runtime verification of key properties extracted from the Micrio-ROS specification.
Here, we take a specific and commonly used application scenario as an example and instantiate the model using Simulink/Stateflow. In this case study, an embedded device-controlled camera acts as an XRCE Client that publishes messages in the DDS domain. Additionally, an embedded device-controlled alarm functions as an XRCE Client that subscribes to messages in the DDS domain and has a periodic sleep characteristic. Furthermore, a PC runs an XRCE Agent, which acts as a proxy for both the camera and the alarm. The top-level module of the Simulink/Stateflow model is shown in Figure 9.

6.1. Simulation and Result Analysis

In Simulink, the model’s simulation duration is set to 160 seconds. The final simulation results are observed through the Scope, as shown in Figure 10.
In Figure 10, the horizontal axis represents time, and the vertical axis indicates the number of received messages. TDDS denotes the proxy_publisher in the XRCE-DDS Agent, which receives information from the camera. GetInfo represents the alarm in the XRCE-DDS Client, which receives information from the DDS domain. The varying time intervals between consecutive message receptions demonstrate that the experiment successfully simulated delays in message reception caused by transmission loss in an unreliable network. However, TDDS ultimately failed to receive all messages, primarily due to an error in calculating the simulation time. The maximum detection time was set to only 160 seconds, which was insufficient for receiving and acknowledging all messages. This is because our simulation model includes the emulation of message loss, where some messages are retransmitted after being lost, thereby delaying their normal transmission.
We modified the simulation time in the environment to 180 seconds. After running the simulation again, the data reception status shown in Figure 11 was observed.
Figure 11 shows that after G e t I n f o receives the 9th message, approximately 80 seconds pass before the 10th message is received. This is due to the resource-constrained embedded device entering a sleep period. During this interval, the XRCE-DDS Client enters a sleep state and cannot receive messages from the XRCE-DDS Agent. When the XRCE-DDS Client wakes up and returns to an active state, it resumes receiving messages and successfully receives the 10th message from the XRCE-DDS Agent.

6.2. Runtime Verification and Result Analysis

To verify the properties of Micro-ROS, the Logical and Temporal Assessments tool from Simulink Test’s Test Manager package is applied for runtime verification. This tool accepts properties described in natural language and converts them into signal temporal logic(STL). The STL formulas generate a syntax trees, which is then evaluated from the leaf nodes upward to construct monitors for runtime verification.
The tool allows properties to be described in a manner close to natural language. Figure 12 shows the interface provided by the tool for engineers to input these properties.
When using this tool to describe properties, the engineer adds the signals involved in the property to the tool via the "Add Symbol" button at the bottom-right corner to configure the detector. Then, the specific property specifications are written in the "ASSESSMENT CALLBACK" section. The seven properties of Micro-ROS are defined in the tool as follows.
  • ECFS: At any point of time, whenever true is true, with a delay of at most 180 seconds, c l i e n t _ p u b _ f i n i s h e d = = 1 must be true.
  • ECRA: At any point of time, whenever true is true, with a delay of at most 180 seconds, c l i e n t r e c e i v e d a l l = = 1 must be true
  • NIWS: At any point of time, whenever s u b C l i e n t s t a t u e = = 1 is true, with a delay between 0 seconds and 50 seconds, s u b C l i e n t _ r e c e i v e S i g = = f a l s e must be true
  • RMIO: At any point of time, whenever p u b l i s h e r _ l a s t _ r e c e i v e d 10 is true, with no delay, V e d i o I n f o = = T D D S must be true
  • RMIO2: At any point of time, whenever s u b s c r i b e r _ l a s t _ r e c e i v e d 10 is true, with no delay, G e t I n f o = = F D D S must be true
  • TMRK: At any point of time, whenever m i s s i n g _ f i g = = 1 & & s e n d M i s s S e q < l a s t _ r e c e i v e is true, with a delay between 0 seconds and 20 seconds,
    f i n d M i s s S e q = = s e n d M i s s S e q must be true
  • FARS: At any point of time, whenever l a s t _ s e n t > l a s t _ a c k + 1 is true, with a delay between 0 seconds and 20 seconds, l a s t _ s e n t = l a s t _ a c k + 1 must be true
The tool was used to perform runtime verification on the seven properties mentioned above, and the model passed successfully all seven verifications. The verification results are presented in Figure 13.
As shown in Figure 13, the results indicate that all seven key properties have passed verification. The system model successfully transmits messages from resource-constrained embedded devices to other nodes. Additionally, resource-constrained embedded devices can receive messages from other nodes.

7. Conclusion

With the continuous development of the Robot Operating System(ROS), Micro-ROS designed for resource-constrained devices has garnered increasing attention from both academia and industry. To ensure the safety and reliability of Micro-ROS, we studied the Micro-ROS specifications and established a modeling, simulation, and verification framework for its communication mechanisms. This framework helps ensure the safety of communication mechanisms in simulated execution paths. Based on specific Micro-ROS application scenarios, we implemented models on the MATLAB Simulink/Stateflow platform to simulate the Micro-ROS communication process. Additionally, we performed runtime verification using the Simulink Test toolkit for the seven key properties extracted from the Micro-ROS specifications.
We have modeled and analyzed the communication behavior after the communication link was established. Before Micro-ROS performs data communication, the Micro XRCE-DDS Agent needs to authenticate and authorize the Micro XRCE-DDS Client in order to ensure its communication security. Future work will investigate the security of Micro XRCE-DDS Client permissions within the DDS domain from an information security perspective, aiming to prevent device impersonation and mitigate security risks.

Author Contributions

Conceptualization, X.R. and J.G.; methodology, Z.W. L.J. and J.G.; software, Z.W.; validation, X.R., Z.W. and J.G.; formal analysis, Z.W. and X.R.; investigation, L.J.; resources, X.R.; data curation, Z.W.; writing—original draft preparation, Z.W. and X.R.; writing—review and editing, J.G.; visualization, X.R.; supervision, J.G.; project administration, J.G.; funding acquisition, X.R. All authors have read and agreed to the published version of the manuscript.

Funding

This paper was supported by the Shanghai Special Program for Promoting High-Quality Industrial Development (Project No. 250203).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

References

  1. Quigley, M.; Conley, K.; Gerkey, B.; et al. ROS: An open-source Robot Operating System//ICRA workshop on open source software. Kobe, 12–17 May 2009, IEEE: Piscataway, 2009; p. 5. [Google Scholar]
  2. Wang, Z.; Liu, S.; Ji, D.; Yi, W. Improving Real-Time Performance of Micro-ROS with Priority-Driven Chain-Aware Scheduling. Electronics 2024, 13, 1658. [Google Scholar] [CrossRef]
  3. Micro-ROS - Puts ROS 2 onto Microcontrollers [EB/OL]. 2004. Available online: https://micro.ros.org.
  4. Lee, H.; Yoon, J.; Jang, M.-S.; Park, K.-J. A robot operating system framework for secure uav communications. Sensors 2021, 21(4), 1369. [Google Scholar] [CrossRef] [PubMed]
  5. Reke, M.; et al. A Self-Driving Car Architecture in ROS2//2020 International SAUPEC/RobMech/PRASA Conference. Cape Town, Jan 29-31, 2020; IEEE: Piscataway; 2020, pp. 1–6. [Google Scholar]
  6. Yang, L.G.; Chi, H.F. SLAM Self-Cruise Vehicle Based on ROS Platform/2021 IEEE International Conference on Consumer Electronics and Computer Engineering (ICCECE). Guangzhou, Jan 15-17, 2021; IEEE: Piscataway; 2021, pp. 6–11. [Google Scholar]
  7. Wang, Z.; Liu, S.; Jiang, X.; Ji, D.; Wang, Y. TIDE: A Timing-Deterministic and Efficient Executor for Micro-ROS. 2023 IEEE International Conferences on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData) and IEEE Congress on Cybermatics (Cybermatics), Danzhou, China, 2023; pp. 487–494. [Google Scholar] [CrossRef]
  8. Mamani-Saico, A.; Yanyachi, P.R. Implementation and Performance Study of the Micro-ROS/ROS2 Framework to Algorithm Design for Attitude Determination and Control System. IEEE Access 2023, 11, 128451–128460. [Google Scholar] [CrossRef]
  9. Zahradník, J.; Daňhel, M.; Kubátová, H. Integration of PXROS-HR with Micro-ROS in Robotic Systems. 2024 13th Mediterranean Conference on Embedded Computing (MECO), Budva, Montenegro, 2024; pp. 1–6. [Google Scholar] [CrossRef]
  10. Dürschmid, T.; Timperley, C.S.; Garlan, D.; et al. Rosinfer: Statically inferring behavioral component models for ros-based robotics systems. In Proceedings of the IEEE/ACM 46th International Conference on Software Engineering, 2024; pp. 1–13. [Google Scholar]
  11. Terei, N.; Wiemann, R.; Raatz, A. ROS-Based Control of an Industrial Micro-Assembly Robot. Procedia CIRP 2024, 130, 909–914. [Google Scholar] [CrossRef]
  12. Dehnavi, S.; Goswami, D.; Koedam, M.; et al. Modeling, implementation, and analysis of XRCE-DDS applications in distributed multi-processor real-time embedded systems. In 2021 Design, Automation and Test in Europe Conference and Exhibition (DATE); IEEE; Volume 2021, pp. 1148–1151.
  13. Park, H.-S.; Lee, S.; Um, D.; Ryu, H.; Park, K.-J. An Analytical Latency Model of the Data Distribution Service in ROS 2. IEEE INFOCOM 2025 - IEEE Conference on Computer Communications, London, United Kingdom; 2025, pp. 1–10. [CrossRef]
  14. Zanatta, G.; Caiazza, G.; Ferrara, P.; Negrini, L.; White, R. Automating ROS2 Security Policies Extraction through Static Analysis. 2024 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Abu Dhabi, United Arab Emirates; 2024, pp. 3627–3634. [CrossRef]
  15. Begemann, M.J.; Kallwies, H.; Leucker, M.; Schmitz, M. TeSSLa-ROS-Bridge – Runtime Verification of Robotic Systems. In ICTAC 2023. Lecture Notes in Computer Science; Springer: Cham, 2023; Volume 14446. [Google Scholar] [CrossRef]
  16. Hu, C.; Dong, W.; Yang, Y.; Shi, H.; Zhou, G. Runtime Verification on Hierarchical Properties of ROS-Based Robot Swarms. IEEE Trans. Reliab. 2020, 69(2), 674–689. [Google Scholar] [CrossRef]
  17. Li, W.; Ribeiro, P.; Miyazawa, A.; et al. Formal design, verification and implementation of robotic controller software via RoboChart and RoboTool. Auton. Robot 2024, 48, 14. [Google Scholar] [CrossRef]
  18. Liu, Y.; Guan, Y.; Li, X.; Wang, R.; Zhang, J. Formal Analysis and Verification of DDS in ROS2. 2018 16th ACM/IEEE International Conference on Formal Methods and Models for System Design (MEMOCODE), Beijing, China, 2018; pp. 1–5. [Google Scholar] [CrossRef]
  19. Carvalho, R.; Cunha, A.; Macedo, N.; Santos, A. Verification of system-wide safety properties of ROS applications. 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Las Vegas, NV, USA, 2020; pp. 7249–7254. [Google Scholar] [CrossRef]
  20. Dust, L.; Gu, R.; Mubeen, S.; Ekström, M.; Seceleanu, C. A model-based approach to automation of formal verification of ROS 2 systems. Front. Robot. AI 2025, 12, 1592523. [Google Scholar] [CrossRef] [PubMed]
  21. Dust, L.; Gu, R.; Seceleanu, C.; et al. Pattern-based verification of ROS 2 applications using UPPAAL. Int. J. Softw. Tools Technol. Transf. 2025, 27, 313–332. [Google Scholar] [CrossRef]
  22. DDS for eXtremely Resource Constrained Environments. Available online: https://www.omg.org/spec/DDS-XRCE/1.0/PDF.
  23. Kucuk, K.; Solpan, S. DDS-XRCE Standard Performance Evaluation of Different Communication Scenarios in IoT Technologies. EAI Endorsed Trans. Internet Things 2022, 8, e1. [Google Scholar] [CrossRef]
Figure 1. The architecture of Micro XRCE-DDS communication middleware.
Figure 1. The architecture of Micro XRCE-DDS communication middleware.
Preprints 210596 g001
Figure 2. The framework of XRCE-DDS formal modeling, simulation, and runtime verification.
Figure 2. The framework of XRCE-DDS formal modeling, simulation, and runtime verification.
Preprints 210596 g002
Figure 3. Architecture diagram of the model.
Figure 3. Architecture diagram of the model.
Preprints 210596 g003
Figure 4. Time automata model T A C P _ R O S .
Figure 4. Time automata model T A C P _ R O S .
Preprints 210596 g004
Figure 5. Time automata model T A C S _ R O S .
Figure 5. Time automata model T A C S _ R O S .
Preprints 210596 g005
Figure 6. Time automata model T A R E V .
Figure 6. Time automata model T A R E V .
Preprints 210596 g006
Figure 7. Time automata model T A P P _ H A S .
Figure 7. Time automata model T A P P _ H A S .
Preprints 210596 g007
Figure 8. Time automata model T A P S _ S F W T .
Figure 8. Time automata model T A P S _ S F W T .
Preprints 210596 g008
Figure 9. System model of Simulink/Stateflow.
Figure 9. System model of Simulink/Stateflow.
Preprints 210596 g009
Figure 10. Simulated receiving messages in 160 seconds.
Figure 10. Simulated receiving messages in 160 seconds.
Preprints 210596 g010
Figure 11. Simulated receiving messages in 180 seconds.
Figure 11. Simulated receiving messages in 180 seconds.
Preprints 210596 g011
Figure 12. Interface of Test Manager.
Figure 12. Interface of Test Manager.
Preprints 210596 g012
Figure 13. Property verification results.
Figure 13. Property verification results.
Preprints 210596 g013
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2026 MDPI (Basel, Switzerland) unless otherwise stated