Abstract
Component-based approaches are prevalent in software development for robotic applications due to their reusability and productivity. In this article, we present an Embedded modular Software framework for a networked roBoTic system (EmSBoT) targeting resource-constrained devices such as microcontroller-based robots. EmSBoT is primarily built upon μCOS-III with real-time support. However, its operating system abstraction layer makes it available for various operating systems. It employs a unified port-based communication mechanism to achieve message passing while hiding the heterogeneous distributed environment from applications, which also endows the framework with fault-tolerant capabilities. We describe the design and core features of the EmSBoT framework in this article. The implementation and experimental evaluation show its availability with small footprint size, effectiveness, and OS independence.
Introduction
Currently, advances in sensors, actuators, and computer technologies have led to the increasing complexity of robotic systems. It is a challenging and tedious task to develop new robotic applications for such platforms, especially when the robotic system is equipped with several heterogeneous embedded processors, considered as a networked system (e.g. the ATHLETE robot, 1 Triskar2, 2 and s-bot 3 ). Engineers have to deal with diverse functional modules of the applications, from low-level device drivers to high-level functions such as planning and navigation. On the other hand, it has long been recognized that the use of a multi-robot system can outperform an individual versatile robot, such as space exploration, object transport, and distributed manipulation. Writing software for a multi-robot system further complicates the situation when considering coordination and communication problems. Overall, we can view an advanced robot with several processors and multi-robot system with communication capability as distributed computing systems connected via physical or wireless network, a special case of a networked robotic system (NRS). 4
Due to the inherent difficulty in developing complex robotic applications from scratch, a number of robotic software frameworks (RSFs) or middlewares have been specifically designed and widely used to alleviate the process, such as Player, 5 ROS, 6 ASEBA, 7 RSCA, 8 MIRA, 9 Orocos, 10 Miro, 11 OpenRDK, 12 OPRoS, 13 and OpenRTM-aist. 14 Nearly all these frameworks share the same paradigm—a component-based approach—an idea naturally originating from component-based software engineering (CBSE). By applying the principles of CBSE, the robotic application is divided into different software “agents”, which are loosely coupled. Depending on the framework, an “agent” is also called a “component,” “module,” “node,” or “resource.” In the rest of the article, the term agent is used. These loosely coupled agents only export data or control interfaces to others, while the RSF is responsible for the message passing and event notification between agents. Besides the communication mechanism, some RSFs also specify the agent model for applications, such as OpenRTM-aist, 14 GenoM3, 15 and FINROC. 16 Using RSF in the development process of robotic applications introduces better software quality, code reusability, and collaborative development. However, without deliberately designing the interactions between agents, achievement of the quality-of-service requirements of some applications, such as the real-time constraints, is an intractable problem.
This article focuses on the problem of applying RSF in the domain of NRS. We extend the concept of NRS to a more general idea as illustrated in Figure 1, including not only a group of connected robots, such as swarm robots and modular robots with communication feature, 17,18 but also a complex self-contained robot with distributed processing units. We claim that every node in Figure 1 is equipped with a processing unit, some memory, and some peripheral interfaces that can be used to connect sensors or control actuators, as well as some communication channels. The processing unit could be a microprocessor, microcontroller, or digital signal processor. Using RSF to develop applications for such a heterogeneous system presents some challenges and requirements.

The extended networked robotic system. A robot could be composed of a single microcontroller, a central processor with several microcontrollers, or just several homogeneous microcontrollers. C: central processor; M: microcontroller; ○: robot;______: linked via physical bus;……: wirelessly connected.
Support for heterogeneous hardware platforms and operating systems. The framework should support diverse hardware platforms, the memory of which could be limited to dozens of kilobytes. Therefore, the framework must be configurable and scalable to support the diversity. On the other hand, the hardware varieties also result in different operating systems on top. Due to the resource constraints in embedded systems, real-time operating systems (RTOSs) are widely used. The programming interfaces and procedures are very different from those in desktop operating systems. The framework should abstract the underlying operating system in order to be ported to other operating systems without too much effort.
Communication network and transport protocol independence. The framework should not depend on the communication network adopted. The communication between computing nodes on a complex robot may be based on a physical network bus, such as an Ethernet or CAN bus. In swarm and modular robotics, the communication may rely on a wireless network, such as ZigBee, Bluetooth, and WLAN. The framework should have the flexibility to switch to different communication networks.
Real-time support. The real-time requirement is ubiquitous in robotic systems, especially in the automotive and avionic domains. Deploying the framework above or on top of the RTOS is the preliminary step in guaranteeing the real-time requirement. In addition, the framework should support the real-time requirement inherently or not jeopardize it. The distribution of the whole system further complicates the situation. It may need real-time communication, whereas we claim that the framework should be network transparent. Therefore, the framework should employ a mechanism to coordinate the real-time communication with the network layer.
Fault-tolerant support. NRS provides reliability and fault tolerance inherently by adding redundant features and distributing task responsibilities to different nodes. An abnormal hardware node or software agent will not disable the system because of automatic reconfiguration. 19 The software framework should have such an advantage and should further simplify the reconfiguration process.
Simplicity and ease of use. The framework should be simple and easy to learn. The programming model of the framework is intuitive and existing code can be adapted to the programming model with little or no change.
This article presents EmSBoT, an Embedded modular Software framework for a networked roBoTic system, which considers the aforementioned requirements. The rest of the article is organized as follows: Section “Related work” gives an overview of related work and highlights the distinguished features of EmSBoT. Section “The EmSBoT framework” describes the internals of EmSBoT design as well as its core features. Section “Implementation and experimental evaluation” presents its implementation details, some benchmarking results, and a multi-robot leader–follower case study to demonstrate its efficacy. Finally, we give some conclusion remarks and future work in section “Conclusion and future work.”
Related work
Many RSFs with various characteristics are available. However, none of them is the de facto standard tool for building robotic applications in the educational and industrial communities, due to the diverse functional and nonfunctional requirements in different robotic projects. A comprehensive survey and comparison of existing frameworks are given in the literarure. 20 –22 Here, we just analyze the attributes that EmSBoT is supposed to include.
After reviewing existing RSFs, we found that none are designed to support heterogeneous hardware platforms and operating systems. Most of them only support the desktop-level environment without taking into account resource-constrained platforms, such as microcontroller-based robots. On the other hand, there are also some RSFs that support embedded hardware, such as R2P, 2 ASEBA, 7 and μORB. 23 However, they do not consider the cross-platform problem. For programming a networked robotic system that includes heterogeneous nodes, an existing solution is to use an RSF in desktop-level or powerful embedded computers with or without an embedded RSF on other nodes. The communication between different RSFs is via a specific wrapper. For instance, in R2P, an μROSnode is developed for integration with the ROS system. In the study by Mellinger et al., 24 a desktop with the ROS system is used to control multiple quadrotors without an RSF on board. The onboard processor is only used to read and transmit sensor data to the desktop, to receive control commands, and to set actuators. However, with advances in processor power and sensors, it is capable of deploying a (real-time) operating system with a lightweight RSF in the quadrotor, as it did in the study by Meier et al. 23 Instead of building a bridge between different RFSs, we propose the idea that a unified framework supporting various platforms can further alleviate the development of applications for NRSs.
Most of the existing frameworks build upon the TCP/IP or UDP/IP network, such as MIRA, ROS, OpenRDK, and Player; some frameworks are also based on general communication middlewares, such as OpenRTM-aist and MIRO adhering to CORBA. FINROC, R2P, and Orocos support communication over CAN bus. ASEBA supports both CAN bus 7 and Bluetooth networks. 25 A communication system based on a ZigBee network was evaluated for self-reconfiguring modular robots in the study by Fitch and Lal. 26 None of these frameworks are versatile enough to support all the networks, or to be network transparent. The capability to seamlessly switch to another network should be integrated into the framework. This feature is profitable for robots with multiprocessors, as well as multi-robot systems.
ROS, Player, and OpenRDK, from their original design goals, have not been dealing with a robotic system with the real-time requirement but are aimed at service robots and assistive robots. ASEBA employs the event-based programming paradigm to support the real-time requirement. RT-CORBA is used in RSCA to support real-time communication. Orocos, built on top of RTAI and RTLinux, supports real-time components. OpenRTM-aist supports real-time capability through its RT-component model. MIRA, by avoiding unnecessary copying of data when handling communication between agents, outperforms other frameworks in terms of communication latency and memory usage. ChibiOS/RT, an RTOS, is chosen in R2P to meet the real-time requirement. R2P also integrates a real-time CAN bus protocol to transmit messages between networked nodes.
Fault tolerance includes fault detection and recovery at runtime. As stated in the study by Cui et al., 19 faults include two aspects: functional and nonfunctional. Detection of the functional and nonfunctional faults is rarely supported in existing frameworks except OPRoS. Fault recovery can be supported if the framework supports agent reconfiguration at runtime. This is strongly related to the programming mode and communication style of the framework. ROS, MIRA, OpenRDK, R2P, and μORB all adopt a similar topic-based communication style. They can achieve fault recovery by replacing the failure agent when finding fault artificially. Another favorable communication style is the port-based mechanism, which is adopted in OPRoS, OpenRTM-aist, FINROC, and COP frameworks. 27 This mechanism makes agents loosely coupled, and the communication between agents can be created and destroyed dynamically, which is highly suitable for failure recovery through agent reconfiguration. OPRoS is endowed with fault tolerance through a specific fault-manager module. 28,29
What most distinguishes EmSBoT from existing frameworks is that it provides a lightweight unified programming and communication interface for heterogeneous distributed environments, ranging from resource-constrained embedded microcontrollers to desktop-level computers. In EmSboT, the communication networks are isolated as special agents, making the framework network transparent and adaptable to diverse communication protocols. This feature is highly beneficial for the devices that inhabit more than one network. Apart from being built on top of RTOSs intentionally as other RSFs do to support the real-time requirement, EmSBoT also employs a priority-based message passing approach to increase its soft real-time capability. Furthermore, the framework integrates an affordable distributed fault-tolerant mechanism that is based on the port-based communication style. All these features will be introduced in detail in the following section.
The EmSBoT framework
The EmSBoT framework was initially proposed to address the problem of communication transparency between swarm robots in our laboratory. These robots are resource constrained, being equipped with ARM Cortex-M MCUs, but capable of embedding an RTOS inside. Also, a more powerful robot equipped with the Cortex-A processor could be used as the mother ship. The communication between them is achieved via a Digi XBee RF module considering the cost and power consumption. The framework must be able to support such a circumstance. If we abstract the underlying network layer, the framework is highly suitable for complex robots with multiprocessors. With this vision, the EmSBoT framework is developed to address the requirements and challenges mentioned earlier.
Overall architecture
The overall architecture of EmSBoT is deliberately divided into three layers (see Figure 2): the operating system abstraction layer, the core of the framework, and the application layer composed of software agents.

The architecture of the EmSBoT framework in one microcontroller-based robot. EmSBoT: Embedded modular Software framework for a networked roBoTic system.
In order to achieve portability, we argue that EmSBoT should only utilize the generic system calls that operating systems provide, such as calls to thread (or task), semaphore, mutex, and message queue. This principle guides us to abstract these services to a separate layer, leading to the uniform wrapper structures and functions for the upper layer. Our previous experience in evaluating (real-time) operating systems using our benchmark suite proves its feasibility. 30,31
Based on the OS abstraction layer, we implemented the core framework of EmSBoT with the aim of minimizing its memory footprint and dependencies on other libraries. This layer defines the programming model for applications, provides core services to the upper application layer, and routes messages between agents. The real-time requirement and fault-tolerant mechanism are also supported in this layer. The modularity of the framework is implemented by dividing the application into software agents, which are managed by the EmSBoT core. These agents are functionally independent in principle and interact via message passing.
System and programming model
The construction of a distributed EmSBoT system stems from the notion of a computation “node,” which is addressable. Formally, the system can be expressed as a tuple
Node
Each node ni in N is composed of a set of software agents and communication ports. We argue that all the elements of ni share the same memory space. For example, a microcontroller with RTOS and a communication medium inside can be viewed as a node (see Figure 2); a process in the desktop OS such as Linux can also be a node, which could be addressed by a TCP or UDP port number. Every node in the system has a unique ID, NodeID, which can be set to its network address. Then, ni can be generalized as a tuple
Agent
Each agent in the node also has a unique ID, AgentID so in the whole system an agent can be identified and addressed by

Activity diagram of the lifecycle of an agent, integrated with the fault-tolerant mechanism.
Port
Similarly to other frameworks,
13,14,16,27
ports are used to pass messages between agents, giving the advantage of flexibility, low coupling, and ease of use. In our model, the input and output ports are explicitly distinguished. An agent can only receive data from input ports and send data to output ports. The data flow is established by binding input ports to output ports. In the OPRoS model, three types of ports are defined: service, data, and event ports.
13
However, in order to maintain simplicity and reduce the footprint size, only the type of data port is reserved in EmSBoT. We argue that the event port and service port can be easily implemented using a data port. Actually, an event usually includes the payload data,
7
so listening to an event can be converted to listening to the data port. One outstanding feature of EmSBoT is that only the pointer to messages is transmitted in the node domain, which guarantees real-time capability in inner-node communication. Every port in our model also has a unique ID, PortID, and a string, Name indicating its data type. The input (output) port can only bind to the output (input) port, which has the same Name. The model does not restrict the number of output ports that can bind to the same input port, and vice versa. Every port in EmSBoT inherits the same priority
Figure 4 shows the UML diagram of these elements in the EmSBoT system. The framework is responsible for maintaining their relationships, which can be used to help analyze agent dependencies and fault recovery.

UML diagram of the EmSBoT system model. EmSBoT: Embedded modular Software framework for a networked roBoTic system.
Communication mechanism
The communication between agents is achieved via the data flow from the output port of one agent to the input port of another agent. The communication process is explicitly divided into two steps: (1) port binding and (2) data sending and receiving.
Port binding
In the EmSBoT framework, an agent that needs data from an output port of another agent needs to request an input port with the same name from the framework and bind it to the output. Similarly, an agent that intends to send data to an input port of another agent must request an output port and bind it. In our model, every (input or output) port can be “active” or “passive” according to the action of the agent. For instance, an agent that provides other agents with normalized sensor information will use a “passive” output port to export the IR data because it has no perception of which agents need the IR data. On the other hand, if a navigation agent
Sending and receiving messages
After port binding is finished, the agent with the output port can send messages to agents with the matching input port. If the input port is in the same node, EmSBoT directly pushes the message into the receiving buffer of the input port; if the input port is across nodes, the message is first staged in a dummy remote input port (RIP) and then a service named EBRouting, which is a dedicated thread employed to handle message routing asynchronously over node boundaries, is activated. Once EBRouting has been notified, it gets messages from RIPs and passes them to the corresponding communication agent. The whole sending process is illustrated in Figure 5. When data are available in the input port, instead of using callback to invoke the user-defined function, EmSBoT only provides the receiving function to retrieve the data from the input port with or without blocking, which is more flexible than the callback method.

The sequence diagram of sending data.
In EmSBoT, the data items in the input port are also attached to the identity information, indicating the source of the data. This is very helpful when the input port is used to aggregate data from several agents. Additionally, output port multiplexing is supported in EmSBoT. As an example, take a multi-robot surveillance task in which three worker robots

An illustration of output port multiplexing.
In order to increase its soft real-time capability, we implemented a priority-based message passing approach in EBRouting inspired by the optimization work of parallel intent broadcasts in real-time Android.
32
When multiple input ports pend on the same output port simultaneously, this approach guarantees that the agent with the higher priority will receive messages earlier than others. In the study by Kalkov et al.,
32
a priority message queue is employed to arrange the messages based on priorities. Instead of prioritizing the messages, our approach sorts the input ports according to the attribute
Besides, as
When managing the communication between heterogeneous platforms, dealing with the data format and type marshalling are inevitable. Frameworks such as R2P 2 and μORB 23 do not consider this problem because they are deployed in homogeneous nodes or in a single node only. As stated in the literature, 21 there are two main kinds of approaches: text-type format and binary data format. Text-type format can be XML, CSV, and JSON, which are more interpretable and language- and platform-independent. However, considering the performance, energy consumption, and communication network bandwidth limit in swarm and modular robots, it is better to use binary data format, which saves encoding time and network bandwidth. As EmSBoT primarily focuses on the resource-constrained platforms, the use of specific binary data format is adopted. It is preferred and advisable to specify the content of messages using standard C data structures. In its current version, EmSBoT directly transmits the content of memory that the message (data structure) occupies without data marshalling when the message is transferred between homogeneous nodes, which promotes the efficiency of the framework. Data marshalling happens only when the message is transferred between heterologous nodes. It is intended that future version EmSBoT will integrate the type specification and marshalling mechanisms of LCM. 33
Some frameworks provide synchronous communication mechanisms, such as ROS, MIRA, and FINROC. They all implement the remote procedure call service, a typically synchronous communication mechanism. When a client agent sends a request to the server agent, it will be blocked until the response from the server agent is returned. EmSBoT does not support synchronous communication, as it mainly copes with microcontroller-based robots and diverse networks. Considering simplicity and efficiency as its design principles, EmSBoT only employs asynchronous communication based on data ports. In practice, if needed, the synchronous communication can be achieved by setting up two communication connections between two agents as shown in Figure 7. The server agent As provides service by receiving a request from the input port

Implementation of synchronous communication using two-way port connections in EmSBoT. EmSBoT: Embedded modular Software framework for a networked roBoTBoTic system.
Communication agents
In our framework, to facilitate communication between different computing nodes, we creatively abstract the communication layer as individual agents, each of which is associated with one communication channel. A communication agent is in charge of sending (receiving) messages to (from) its corresponding communication channel. An agent is identified as a communication agent by providing three callbacks to the EmSBoT core via the system API
where Sendfunc and
To keep its flexibility, the framework does not strictly specify how the three callbacks are implemented in a communication agent. For instance, we have already implemented a UDP/IP communication agent, in which a public UDP port is shared among nodes and is used to broadcast messages, while each node holds an exclusive UDP port to send and receive unicasting messages. In reality, when performing port binding, the framework will first broadcast a port metadata discovery message to all other nodes and then the other nodes will reply with the matching results by unicasting. However, the port binding process can be completely different if we prefer to use a centralized hub that manages all the port metadata. In this scenario, we only need to implement the
Fault-tolerant support
The prevalence of NRS is due to its advantages, such as robustness and fault tolerance, over a single robot. A team of robots with different functionalities could cooperate to carry out the tasks assigned in parallel. In a high level, an abnormal robot could be replaced by another normal one. In a low level, when a functional software unit of a robot does not work correctly, the robot could benefit from utilizing the same software unit located in another robot. However, it is not straightforward to achieve these objectives autonomously at runtime, especially in a distributed environment. There are at least two major problems to consider: (1) how to detect the failure of an agent and (2) how to recover from the failure in a tractable way. EmSBoT promotes the separation of fault handling from the normal logic of an agent.
Fault detection
In EmSBoT, the faults for an agent either originate from the agent itself through self-checking or from other coupled agents through fault propagation. The framework now supports the detection of two types of faults: timing fault and functional fault. A timing fault is identified by recording the start and end time of Exec of the agent (see Figure 3). If the agent has timing specification
Fault recovery
The fault recovery procedure is divided into two steps. First, if the Faulthandling function is provided by the agent designer, the fault is passed to it. The prototype of Faulthandling is defined as follows:
where the first two parameters indicate the source of the fault, and type is a structure and denotes the fault type and value. In Faulthandling, the agent designer can implement different fault recovery strategies according to its context and different fault types. For instance, if the timing fault happens, the agent can go back to normal by requesting for more computation resource from the system (through increasing its priority) if this mechanism is supported by the operating system. Furthermore, when a fault message is received, the agent can identify the faulty agent by nodeid and agentid and then change the port binding with the faulty agent.
Finally, if Faulthandling is incapable of handling the fault, the fault will be further processed by the framework. At this step, we can conclude that the agent is impossible to recovery from the fault, so this agent is marked as faulty, and the framework will propagate a specific fault message to other agents that are connected with the faulty agent. Through fault propagation and dynamic port binding, EmSBoT supports distributed fault tolerance in a novel and tractable way.
Implementation and experimental evaluation
EmSBoT is initially proposed to achieve transparent communication between devices with constrained resources, so we implement it primarily on top of the μC/OS-III RTOS on both the ARM Cortex-A8 and Cortex-M4 processors. As the goal of EmSBoT is to support heterogeneous hardware platforms and operating systems, it does not use any standard libraries that depend on specific operating systems. EmSBoT only employs a minimal set of OS features including threads (tasks), semaphores, mutexes, and timing, all of which are available in RTOSs and general-purpose operating systems. By introducing the OSAL, EmSBoT also supports QNX, Windows, and Linux platform. Our practical experience shows that porting EmSBoT to other platforms can be done effortlessly just by rewriting around 200 lines of code for the OS abstraction layer. Considering performance and programming of embedded devices, the framework is written entirely in C language and compiled using the GNU toolchain. MinGW (Minimalist GNU for Windows) is used in a Windows environment, while for ARM Cortex processors, the gcc-arm-embedded toolchain is used.
Memory footprint
One of the merits of the EmSBoT framework is its small memory footprint, which makes it feasible and suitable for deployment on MCUs. Table 1 shows the memory usage when running the EmSBoT framework on the STM32F4DISCOVERY board, which has 1 MB of flash memory for code and 192 KB of SRAM for data. The source code contains the μC/OS-III RTOS, necessary BSP files, the framework, and agents. Each agent has one input port and one output port. All the data in the table are statically allocated through the memory pool. When the program is executing, it will never acquire memory from the heap, which avoids deterioration of determinism using dynamic memory allocation. However, the framework also supports dynamic memory heap through configuration when compiling. It is favorable to use dynamic memory when the size of the program is hard to estimate or when the behavior of the program is unpredictable. The firmware is compiled by the GNU toolchain for ARM processors with Optimization Flag ‘O3’ (Optimize most) and with ‘gc-sections’ enabled (remove unused sections). From the table, EmSBoT will cost about 13 KB of flash memory and 5 KB of data memory when there are two agents in the system. When one agent is added, it will additionally cost about 1 KB of data memory.
Memory usage of the firmware when deploying the EmSBoT framework on the STM32F4DISCOVERY board with μ C/OS-III RTOS.
EmSBoT: Embedded modular Software framework for a networked roBoTic system
In conclusion, it has been shown that EmSBoT is very suitable for most microcontroller-based robots. When provided with a well-designed communication agent, EmSBoT is a desirable candidate for swarm robotic applications.
Performance evaluation
We have carried out three primary tests to check the framework’s performance and real-time support. The first one measures the message delivery latency between agents in node domain. In this test, one agent

Data delivery latency between
Figure 8(a) shows that the latency increases linearly with n if
The second test measures the message delivery latency in distributed domain. As it is intractable to measure absolute latencies between two systems, in this test, the round-trip message delivery time is measured between two distributed heterogeneous systems. EmSBoT is first deployed in the Beaglebone Black board with 1 GHz ARM Cortex-A8 processor, 512 MB RAM, and QNX Neutrino 6.5 running on top. On the other side, the processor is Intel Core i5 750@2.67 GHz with four cores, 8 GB of memory, and Ubuntu 14.04 LTS 64 bit running on top. The two systems are connected via a GigE switch, and the UDP/IP communication agent is employed in EmSBoT. On the QNX side, agent

Round-trip delivery latency between
The third test is used to check the framework’s maximum throughput in node domain under different circumstances. It measures the maximum number of transmitted messages with different n and different priorities of

Maximum throughput with respect to different priorities of
In conclusion, the performance evaluation shows that EmSBoT preserves and supports the real-time capability of the system and meets the latency and throughput requirements for most real applications.
A case study
We used the EmSBoT framework in a simple leader–follower robotic application, which proved the effectiveness of EmSBoT. Two differential drive wheeled robots (Figure 11, modified QuickBoT) are used in the experiment. Both feature two wheel encoders and are controlled by the Beaglebone Black board. The state information (position and velocity) of the robot is approximately estimated by measuring the distances travelled by each wheel at 1000 Hz using the wheel encoders. The communication between the two robots is achieved via the Digi XBee ZigBee RF module. The μC/OS-III RTOS is ported to the board.

The robots used in the experiment.
Each robot (the control board) is viewed as a single node and features three agents (Figure 12). The main functions of these agents are as follows:

The architecture of the control software for the experiment. Solid lines denote the binding between input and output ports inside nodes, while the dashed line indicates that the binding is across nodes.
Figure 13 reports the experimental results that we obtained. The data are collected from the follower robot, which has the state information of both robots. The leader robot remains at a fixed linear velocity while visiting all the points. When it arrives at one point, the goal point is switched to the next one accordingly. Figure 13(b) shows the trajectories of both robots. The follower robot can follow the path of the leader perfectly when they remain in (50 cm, 0°)-formation,
34
except near goal points. This is acceptable because

Distance data and trajectory data of the experiment. The leader robot starts from (0, 0), and is assigned to visit four points in order: A(1000, 0), B(1000, 1000), C(0, 1000), and D(0, 0). The follower is required to keep 50 cm distance and 0° relative bearing angle with respect to the leader robot, and thus the two robots remain in (50 cm, 0°) formation. 34
One major problem in the experiment is the indeterminism of message latency of the Xbee communication channel, which meant that
Conclusion and future work
The inherent complexity of developing (distributed) robotic applications promotes the popularity of RSFs, most of which adopt the component-based approach with different communication patterns. However, few RSFs consider embedded devices with constrained resources. EmSBoT, presented in this article, is an embedded modular component-based robotic software framework targeting heterogeneous platforms. It is deliberately built upon lightweight RTOSs, making it suitable for resource-constrained devices such as microcontroller-based robots. Furthermore, the OS abstraction layer extends it to other operating systems without too much effort. It uses the port-based communication mechanism as the only way to exchange messages between agents, which makes the agents loosely coupled, and endows the system with fault-tolerant capability by binding and rebinding ports dynamically at runtime. By isolating the communication channels as separate agents, we provide uniform message-passing APIs for agents, making the communication transparent over node boundaries. It also employs a priority-based message passing approach, providing the application with real-time capability. We also introduce a distributed fault-handling mechanism in EmSBoT. The agent can either have its own fault-handling procedure or propagate a fault message to other agents that bind to it.
The EmSBoT framework is fully implemented in C language. So far, it has already been ported to μC/OS-III, QNX, Windows, and Linux operating systems. The footprint (together with μC/OS-III) measured in the STM32F4Discovery board shows that EmSBoT is very suitable for microcontroller-based robots. We also conducted an exhaustive performance evaluation of EmSBoT inside one node, proving that EmSBoT is capable of maintaining real-time performance and providing high throughput. A leader–follower distributed application, which employs the XBee ZigBee mesh network to pass messages, was conducted to verify its effectiveness. In the future, we intend to develop other communication agents for the framework, such as agents over CAN and TCP/IP. Further experiments need to be conducted to evaluate its distributed performance, to compare it with other frameworks, and to demonstrate its fault-tolerant capability. At present, EmSBoT is in its initial version, so we do not consider the problem of message marshalling, which is a necessity when messages are exchanged between heterogeneous platforms. We will add this feature in the next version.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work is partially supported by the scholarship from China Scholarship Council (CSC) under grant no. 201206110039.
