<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Robot. AI</journal-id>
<journal-title>Frontiers in Robotics and AI</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Robot. AI</abbrev-journal-title>
<issn pub-type="epub">2296-9144</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/frobt.2016.00006</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Robotics and AI</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Unix Philosophy and the Real World: Control Software for Humanoid Robots</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name><surname>Dantam</surname> <given-names>Neil T.</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<xref ref-type="corresp" rid="cor1">&#x0002A;</xref>
<uri xlink:href="http://frontiersin.org/people/u/172955"/>
</contrib>
<contrib contrib-type="author">
<name><surname>B&#x000F8;ndergaard</surname> <given-names>Kim</given-names></name>
<xref ref-type="aff" rid="aff2"><sup>2</sup></xref>
<uri xlink:href="http://frontiersin.org/people/u/320069"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Johansson</surname> <given-names>Mattias A.</given-names></name>
<xref ref-type="aff" rid="aff3"><sup>3</sup></xref>
<uri xlink:href="http://frontiersin.org/people/u/322116"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Furuholm</surname> <given-names>Tobias</given-names></name>
<xref ref-type="aff" rid="aff3"><sup>3</sup></xref>
<uri xlink:href="http://frontiersin.org/people/u/284227"/>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name><surname>Kavraki</surname> <given-names>Lydia E.</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<xref ref-type="corresp" rid="cor1">&#x0002A;</xref>
<uri xlink:href="http://frontiersin.org/people/u/136640"/>
</contrib>
</contrib-group>
<aff id="aff1"><sup>1</sup><institution>Department of Computer Science, Rice University</institution>, <addr-line>Houston, TX</addr-line>, <country>USA</country></aff>
<aff id="aff2"><sup>2</sup><institution>Prevas A/S</institution>, <addr-line>Aarhus</addr-line>, <country>Denmark</country></aff>
<aff id="aff3"><sup>3</sup><institution>Rocktec Division, Altas Copco Rock Drills AB</institution>, <addr-line>&#x000D6;rebro</addr-line>, <country>Sweden</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Lorenzo Natale, Istituto Italiano di Tecnologia, Italy</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Ali Paikan, Istituto Italiano di Tecnologia, Italy; Torbjorn Semb Dahl, Plymouth University, UK</p></fn>
<corresp content-type="corresp" id="cor1">&#x0002A;Correspondence: Neil T. Dantam, <email>ntd&#x00040;rice.edu</email>; Lydia E. Kavraki, <email>kavraki&#x00040;rice.edu</email></corresp>
<fn fn-type="other" id="fn001"><p>Specialty section: This article was submitted to Humanoid Robotics, a section of the journal Frontiers in Robotics and AI</p></fn>
</author-notes>
<pub-date pub-type="epub">
<day>08</day>
<month>03</month>
<year>2016</year>
</pub-date>
<pub-date pub-type="collection">
<year>2016</year>
</pub-date>
<volume>3</volume>
<elocation-id>6</elocation-id>
<history>
<date date-type="received">
<day>13</day>
<month>10</month>
<year>2015</year>
</date>
<date date-type="accepted">
<day>12</day>
<month>02</month>
<year>2016</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2016 Dantam, B&#x000F8;ndergaard, Johansson, Furuholm and Kavraki.</copyright-statement>
<copyright-year>2016</copyright-year>
<copyright-holder>Dantam, B&#x000F8;ndergaard, Johansson, Furuholm and Kavraki</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license>
</permissions>
<abstract>
<p>Robot software combines the challenges of general purpose and real-time software, requiring complex logic and bounded resource use. Physical safety, particularly for dynamic systems such as humanoid robots, depends on correct software. General purpose computation has converged on unix-like operating systems &#x02013; standardized as POSIX, the Portable Operating System Interface &#x02013; for devices from cellular phones to supercomputers. The modular, multi-process design typical of POSIX applications is effective for building complex and reliable software. Absent from POSIX, however, is an interproccess communication mechanism that prioritizes newer data as typically desired for control of physical systems. We address this need in the Ach communication library which provides suitable semantics and performance for real-time robot control. Although initially designed for humanoid robots, Ach has broader applicability to complex mechatronic devices &#x02013; humanoid and otherwise &#x02013; that require real-time coupling of sensors, control, planning, and actuation. The initial user space implementation of Ach was limited in the ability to receive data from multiple sources. We remove this limitation by implementing Ach as a Linux kernel module, enabling Ach&#x02019;s high performance and latest-message-favored semantics within conventional POSIX communication pipelines. We discuss how these POSIX interfaces and design principles apply to robot software, and we present a case study using the Ach kernel module for communication on the Baxter robot.</p>
</abstract>
<kwd-group>
<kwd>real-time software</kwd>
<kwd>middleware</kwd>
<kwd>robot programing</kwd>
<kwd>humanoid robots</kwd>
<kwd>software engineering</kwd>
</kwd-group>
<contract-num rid="cn01">IIS 1317849, CCF 1514372</contract-num>
<contract-sponsor id="cn01">National Science Foundation<named-content content-type="fundref-id">10.13039/100000001</named-content></contract-sponsor>
<contract-sponsor id="cn02">Rice University<named-content content-type="fundref-id">10.13039/100007863</named-content></contract-sponsor>
<contract-sponsor id="cn03">Atlas Copco Rock Drills AB</contract-sponsor>
<counts>
<fig-count count="4"/>
<table-count count="0"/>
<equation-count count="0"/>
<ref-count count="68"/>
<page-count count="15"/>
<word-count count="11014"/>
</counts>
</article-meta>
</front>
<body>
<sec id="S1" sec-type="introduction">
<label>1</label> <title>Introduction</title>
<p>Humanoid robot software presents a broad set of requirements. Humanoids have physical dynamics, requiring fast, real-time software. Humanoids have many sensors and actuators, requiring high performance network code. Humanoids, ideally, operate autonomously, requiring complex application logic. Satisfying these three requirements is a challenging software design and development problem. Fortunately, there are existing solutions to many of these challenges. Unix-like operating systems have served over many decades as the foundation for developing complex software. The standards and design principles learned developing these operating systems and applications provide many lessons and tools for humanoids and other robots.</p>
<p>Humanoid robotics would benefit by building on the significant design and engineering effort employed in unix development.<xref ref-type="fn" rid="fn1"><sup>1</sup></xref> These operating systems are codified in POSIX, the IEEE standard for a Portable Operating System Interface (POSIX, <xref ref-type="bibr" rid="B51">2008</xref>). POSIX provides a vendor neutral interface for systems programing, and there are numerous high-quality implementations that run on all major computer architectures. However, POSIX is more than just a standard for accessing filesystems and networks. Many POSIX applications follow a common design approach based on composing multiple, independent, modular processes. The multiprocess design promotes rapid development of robust and flexible software by isolating errors to a single process and enabling composition of existing tools to address new requirements (Raymond, <xref ref-type="bibr" rid="B54">2003</xref>; Tanenbaum and Bos, <xref ref-type="bibr" rid="B64">2014</xref>), a lesson already largely adopted by the robotics community with frameworks that often, though not always, compose applications from multiple processes (Bruyninckx et al., <xref ref-type="bibr" rid="B5">2003</xref>; Brugali and Scandurra, <xref ref-type="bibr" rid="B4">2009</xref>; Quigley et al., <xref ref-type="bibr" rid="B53">2009</xref>). Unix-like systems are also pervasive in network-intensive applications, leading to powerful communication capabilities. Moreover, the widespread use and long history of unix has bred a variety of tools and conventions to aid system integration &#x02013; a major challenge for robotics &#x02013; by producing and configuring software that is flexible and portable. These features and corresponding design approaches present in Unix-like systems address many, though not all, the needs of humanoid robot software.</p>
<p>While Unix-like operating systems have been phenomenally successful for general purpose computing, they are less prevalent in real-time control of physical processes. Typically, a physical process such as a robot is viewed as a set of continuous, time-varying <italic>signals</italic>. To control this physical process with a digital computer, one must <italic>sample</italic> the signal at discrete time intervals and perform control calculations using the sampled value. To achieve high-performance control of a physical system, we must process the latest sample with minimum latency. This differs from the requirements of general computing which focus on throughput over latency and favor older data over newer data. While nearly all POSIX communication favors the older data, in robot control, the newest data are critical. However, some parts of the system, such as logging, may need to access older samples, so this also should be permitted at least on a best-effort basis. In this paper, we address the need for real-time communication within the larger context of POSIX programing. <italic>We demonstrate a Linux kernel module for high performance, real-time communication, and discuss its use in the application of POSIX programing practice to humanoid robots</italic>.</p>
<p>The Ach interprocess communication library provides fast communication that favors latest message data as typically desired for real-time control of physical systems. Ach is not a new framework that discards or duplicates the existing and significant tools for systems programing. Instead, Ach is a mechanism that integrates and builds upon the vast useful features of the POSIX and Linux ecosystem. In previous work, we presented an implementation of the Ach data structure in the POSIX user space (Dantam and Stilman, <xref ref-type="bibr" rid="B14">2012</xref>; Dantam et al., <xref ref-type="bibr" rid="B13">2015</xref>). User space Ach was limited in the ability to receive data from multiple sources. Now, we present an implementation of Ach as a Linux kernel module. Kernel space Ach enables applications to efficiently receive data from many sources, a crucial feature for mechatronic systems such as humanoid robots which contain many sensors, actuators, and software modules. The Ach Linux kernel module presents the conventional file descriptor interface used for communication in POSIX, enabling direct integration into existing communication systems and frameworks.</p>
<p>Though this work was initially developed for humanoid robots, it is broadly applicable to other complex mechantronic systems such as robot manipulators and intelligent vehicles. These evolving technologies all present similar requirements for complex software with real-time performance. The unix philosophy is effective for building complex software systems, and the Ach library grounds this approach to real-time, physical control.</p>
</sec>
<sec id="S2">
<label>2</label> <title>Learning from Unix</title>
<p>Humanoid robotics can learn from of the POSIX programing community. Important and challenging issues for humanoid robot software, such as high-performance communication, real-time memory allocation, and software integration, are largely addressed by existing techniques and standards. The humanoid robotics community would benefit by building on this work.</p>
<sec id="S2-1">
<label>2.1</label> <title>Communication and Scalability</title>
<p>Humanoid robotics can benefit from the strong communication capabilities of unix-like operating systems. Historically, Unix and the Internet developed in concert (Quarterman et al., <xref ref-type="bibr" rid="B52">1985</xref>). POSIX provides a variety of communication and networking approaches, which largely address the performance and scalability needs of humanoid robot software. We summarize communication with many other nodes in Section <xref ref-type="sec" rid="S2-1-1">2.1.1</xref> and service lookup in Section <xref ref-type="sec" rid="S2-1-2">2.1.2</xref>. Later, we address the unique needs of humanoid robots with the Ach library in Section <xref ref-type="sec" rid="S3">3</xref>, building on the capabilities offered by POSIX.</p>
<sec id="S2-1-1">
<label>2.1.1</label> <title>Multiplexing Approaches</title>
<p>Both general network servers and humanoid robots must communicate with a large number of other devices, be they network clients or hardware sensors and actuators. There are several techniques to communicate with multiple different nodes, each having trade-offs in implementation complexity and computational efficiency.</p>
<sec id="S2-1-1-1">
<label>2.1.1.1</label> <title>Fixed Interval Loop</title>
<p>A simple method to handle multiple connections is to service each connection at a fixed interval. The advantages of this approach are that it is simple to implement and it is similar to the fixed timestep commonly used in discrete-time control. However, there are computational disadvantages. Messages may be delayed because the connections are only serviced once per step. Additional computation may be required to check connections that have no new messages. Furthermore, readers may block if attempting to service a connection with no data to read, and writers may block on full write buffers. While this approach can handle a small, fixed number of connections, it is not a practical consideration for network servers because it performs poorly with a large and varying number of connections.</p>
</sec>
<sec id="S2-1-1-2">
<label>2.1.1.2</label> <title>Process-Per-Connection</title>
<p>One approach to handle varying numbers of connections is to create a separate worker process or thread for each connection. Creating worker processes was traditionally popular because it is easy to implement, process creation on unix-like systems is inexpensive, and separating connections in different processes provides isolation between them. The <monospace>inetd</monospace> superserver is based entirely on the approach of starting a handler process for each new connection. In addition, on modern multi-core machines, separate processes provide true concurrency. Separate handler processes also provide the unique feature of user-based access control; this is useful for low-volume and security-critical services such as SSH. The downside of using separate processes is the overhead to create and maintain the additional processes (Tanenbaum and Bos, <xref ref-type="bibr" rid="B64">2014</xref>). Each connection requires memory for the process&#x02019;s function call stack, and context switching between processes introduces overhead. Consequently, this approach does not scale to very large numbers of connections.</p>
</sec>
<sec id="S2-1-1-3">
<label>2.1.1.3</label> <title>Asynchronous I/O</title>
<p>Asynchronous I/O promises to allow applications to initiate operations, which are performed in the background with the application notified on completion. This would seem to address the scalability issues of the process-per-connection approach. However, current implementations of asynchronous I/O are not mature. The implementation on GNU/Linux uses threads to handle background I/O and scales poorly (Kerrisk, <xref ref-type="bibr" rid="B38">2014</xref>).</p>
</sec>
<sec id="S2-1-1-4">
<label>2.1.1.4</label> <title>Event-Driven I/O</title>
<p>Event-based methods allow efficient handling of many connections through a synchronous interface that notifies applications when a connection is ready for I/O. These methods use the traditional <monospace>select</monospace> call from System V UNIX and <monospace>poll</monospace> from BSD. The more recent <monospace>kqueue</monospace> call on FreeBSD and <monospace>epoll</monospace> on Linux reduce the overhead for very large numbers of connections. Though all these calls differ slightly in their semantics, the underlying premise is the same. The application provides the kernel with a list of file descriptors, and the kernel notifies the application when one of those descriptors is ready for a requested I/O operation. While this approach does require explicitly managing lists of active connections, it efficiently scales to large numbers of connections.</p>
<p>A rough benchmark for network servers is the ability to handle 10 thousand concurrent network connections (C10K) (Kegel, <xref ref-type="bibr" rid="B37">2006</xref>). Though at one point this was a challenging problem, it is now easily handled through event-based methods such as <monospace>epoll</monospace> and <monospace>kqueue</monospace>. The popular and efficient Nginx<xref ref-type="fn" rid="fn2"><sup>2</sup></xref> webserver uses event-based methods as does the libevent<xref ref-type="fn" rid="fn3"><sup>3</sup></xref> library, which underlies communication in memcached and the Google Chrome web browser, among others. For handling many concurrent connections, event-based methods are widely used and scale on ordinary hardware to thousands of concurrent connections.</p>
</sec>
</sec>
<sec id="S2-1-2">
<label>2.1.2</label> <title>Name Resolution and Service Discovery</title>
<p>Another important issue in communication is name resolution and service discovery. Humanoid robots have many distinct software modules that need to locate the underlying mechanism for communication. Many middlewares provide their own form of service discovery: CORBA (CORBA, <xref ref-type="bibr" rid="B9">2011</xref>) provides its naming service to locate remote objects, ONC RPC provides the port mapper (Srinivasan, <xref ref-type="bibr" rid="B61">1995</xref>) to resolve the port numbers to connect to a desired program, and ROS resolves topic names in the <monospace>rosmaster</monospace> process (Quigley et al., <xref ref-type="bibr" rid="B53">2009</xref>). However, name resolution and service discovery are addressed in a standard and general way via multicast DNS (mDNS) (Cheshire and Krochmal, <xref ref-type="bibr" rid="B7">2013</xref>), a peer-to-peer variation of the traditional, hierarchical domain name system (DNS). DNS and mDNS are flexible protocols and can even store arbitrary information in TXT records (Rosenbaum, <xref ref-type="bibr" rid="B56">1993</xref>). Of course, non-naming features such as connection monitoring are outside the scope of DNS. Multicast DNS is a standard protocol with existing implementations, so using mDNS instead of a specialized resolution method reduces the number of separate daemons which must run as well as separate code which must be maintained. Consequently, we use mDNS in Ach to locate communication channels on remote hosts.</p>
</sec>
<sec id="S2-1-3">
<label>2.1.3</label> <title>Lesson Learned</title>
<p>Humanoid robots need communication that is both scalable and real-time. Event-based methods impose the lowest overhead of the various POSIX communication approaches and are the typical choice for scalability-critical network servers (Gammo et al., <xref ref-type="bibr" rid="B20">2004</xref>). Communication for humanoid robots would benefit from the scalability of an event-based approach, and we discuss the real-time requirements next in Section <xref ref-type="sec" rid="S2-2">2.2</xref>. Event-based methods operate on kernel file descriptors (Stevens and Rago, <xref ref-type="bibr" rid="B62">2013</xref>), which motivated the development of the Ach kernel module (see Section <xref ref-type="sec" rid="S3-2">3.2</xref>). To name and locate services, the standard mDNS protocol and implementations provide the necessary capabilities; there is no need to duplicate the features of mDNS.</p>
</sec>
</sec>
<sec id="S2-2">
<label>2.2</label> <title>Real-Time Software</title>
<p>Humanoid robot software requires not only the complex logic and efficient communication of general purpose software but also real-time response to handle physical dynamics. The software infrastructure for humanoids should address the need for real-time performance without unnecessarily sacrificing the capabilities of general purpose systems. While it is a challenge to develop real-time software on general purpose systems, acceptable performance can still be achieved.</p>
<sec id="S2-2-1">
<label>2.2.1</label> <title>Real-Time Communication</title>
<p>POSIX provides a variety of general purpose communication mechanisms; however, none are ideal for robot control. Robot control requires the latest data sample each control cycle. General purpose communication, however, gives priority to older data, which must be read or flushed before newer data can be received. This is the <italic>Head of Line (HOL) Blocking</italic> problem. The specific issues of each POSIX communication mechanism are discussed in Dantam et al. (<xref ref-type="bibr" rid="B13">2015</xref>). It was this HOL blocking challenge that motivated the initial development of Ach (Dantam and Stilman, <xref ref-type="bibr" rid="B14">2012</xref>), which always provides access to the most recent data sample.</p>
<p>Though general network servers can handle thousands of concurrent connections (Gammo et al., <xref ref-type="bibr" rid="B20">2004</xref>), there is a key difference from the needs of humanoid robots. Network servers are primarily concerned with maximizing throughput &#x02013; serving as many clients as possible. Robot control, on the other hand, requires minimizing latency &#x02013; handling each communication operation in minimal and bounded time. Throughput-focused methods often attempt to reduce copying, e.g., by eliding a copy to a kernel buffer for network socket communication or directly mapping a buffer into another process&#x02019;s addresses space via shared memory or relaying a file descriptor through a local socket. However for robots, individual real-time messages are typically small, e.g., a few floating point values read from a sensor, so the overhead of copying the data is minimal. Instead, overhead from system calls and process context-switching dominates. This shift in focus from throughput to latency is one aspect of the difference between general-purpose and real-time systems, and is a concern that we consider in the design of the Ach data structure (see Section <xref ref-type="sec" rid="S3-1">3.1</xref>).</p>
<p>Network communication uses Quality of Service (QoS) mechanisms to improve response for traffic with special requirements, for example, by reserving bandwidth or offering predictable delays (Huston, <xref ref-type="bibr" rid="B31">2000</xref>). Linux provides <italic>queuing disciplines</italic> to prioritize sent traffic and reduce HOL blocking at the sending end (Siemon, <xref ref-type="bibr" rid="B58">2013</xref>). However, HOL blocking or dropped packets may still occur at the receiving end if the receiver does not process messages as quickly as they are sent. The popular, real-time Controller Area Network (CAN) includes a dedicated priority field in messages to guarantee that higher priority messages are sent first, though messages of equal priority are still processed first-in-first-out, different senders must use unique message priorities to avoid collisions, and packet routing is not considered (ISO 11898-1:<xref ref-type="bibr" rid="B32">2015</xref>, <xref ref-type="bibr" rid="B32">2015</xref>). Higher-level communication frameworks also employ QoS, the improve predictability of communication (DDS 1.2, <xref ref-type="bibr" rid="B16">2007</xref>; Hammer and Bauml, <xref ref-type="bibr" rid="B27">2013</xref>; Paikan et al., <xref ref-type="bibr" rid="B48">2015</xref>). Appropriate use of QoS can improve real-time network performance, but the underlying queuing of network communication still presents challenges when one needs the most recent data sample.</p>
<p>The Ach library that we present in Section <xref ref-type="sec" rid="S3-1">3.1</xref> is an interprocess communication mechanism rather than a network protocol, resulting in a distinct set of capabilities and challenges. Network communication must address issues such as limited bandwidth, packet loss, collisions, clock skew, and security. In contrast, processes on a single host can access a unified physical memory, which provides high bandwidth and assumed perfect reliability; still, care must be taken to ensure memory consistency between asynchronously executing processes. While network protocols use QoS to prioritize traffic, Ach maintains a specific data structure (see Figure <xref ref-type="fig" rid="F1">1</xref>B) to guarantee constant-time access to the most recent data sample. Furthermore, Ach communication is compatible with process priorities and priority inheritance, so higher priority processes gain first access to read from and write to an Ach channel. Overall, we view Ach is complementary to network communication. The low latency and fast latest-message-access of Ach make it well suited for real-time interprocess communication.</p>
<fig position="float" id="F1">
<label>Figure 1</label>
<caption><p><bold>Logical memory structure for a conventional circular buffer (A) and an Ach channel (B)</bold>. <bold>(A)</bold> shows a single writer, single reader circular buffer. <bold>(B)</bold> shows the Ach data structure with separate index and data buffers. The index buffer records metadata on the messages, enabling multiple readers, and detection of overwritten messages.</p></caption>
<graphic xlink:href="frobt-03-00006-g001.tif"/>
</fig>
</sec>
<sec id="S2-2-2">
<label>2.2.2</label> <title>Real-Time Kernels</title>
<p>The trade-off between throughput and latency exists also at the level of the operating system kernel. General purpose kernels such as Linux and XNU (used in MacOSX) focus on maximizing throughput while real-time kernels focus on minimizing latency. QNX and VxWorks are POSIX kernels that focus on real-time performance, but both are proprietary. Open source kernels provide greater flexibility for the user, which is important for research where requirements are initially uncertain. There are two real-time variants of the open source Linux kernel. The Linux PREEMPT_RT patch (Dietrich, <xref ref-type="bibr" rid="B17">2005</xref>) seamlessly runs Linux applications with significantly reduced latency compared to vanilla Linux, and work is ongoing to integrate it into the mainline kernel. However, it is far from providing formally guaranteed bounds on latency. Xenomai runs the real-time Adeos hypervisor alongside a standard Linux kernel (Gerum, <xref ref-type="bibr" rid="B21">2004</xref>). It typically offers better latency than PREEMPT_RT but is less polished (Brown, <xref ref-type="bibr" rid="B3">2010</xref>; Dantam et al., <xref ref-type="bibr" rid="B13">2015</xref>) and its dual kernel approach complicates development. Because of the maturity, positive roadmap, and open source code base of Linux PREEMPT_RT (Fayyad-Kazan et al., <xref ref-type="bibr" rid="B19">2013</xref>), we initially implement multiplexable Ach channels within this kernel.</p>
</sec>
<sec id="S2-2-3">
<label>2.2.3</label> <title>Memory Allocation</title>
<p>Memory allocation is a particularly critical part of software development, even more so for real-time software. The ubiquitous <monospace>malloc</monospace> and <monospace>free</monospace> pose issues for real-time performance. Typical implementations are tuned for throughput over latency. The allocator in the GNU C Library (glibc) commonly used on Linux lazily batches manipulation of free lists. Calls to glibc&#x02019;s <monospace>free</monospace> are usually fast but sometimes take very long to complete (Lea, <xref ref-type="bibr" rid="B40">2000</xref>). In contrast, the real-time focused Two-Level Segregate Fit (TLSF) allocator (Masmano et al., <xref ref-type="bibr" rid="B45">2004</xref>) promises O(1) performance, though it is not tuned for multi-threaded applications. For garbage collected languages, latency is even more severe. Collection cycles introduce pause times that are unacceptable for real-time performance on humanoid robots (Johnson et al., <xref ref-type="bibr" rid="B35">2015</xref>). Research on real-time garbage collection is ongoing (Yuasa, <xref ref-type="bibr" rid="B67">1990</xref>; Bacon et al., <xref ref-type="bibr" rid="B1">2003</xref>; Kalibera et al., <xref ref-type="bibr" rid="B36">2011</xref>), while (Smith et al., <xref ref-type="bibr" rid="B60">2014</xref>) use Java for real-time control by disabling garbage collection in the real-time module. If we can constrain the ordering of allocations and frees, then the situation improves. Region-based allocators impose a last-allocated, first-freed constraint, and operate in O(1) time with low overhead (Hanson, <xref ref-type="bibr" rid="B28">1990</xref>). In addition, they provide the software-engineering advantage that all objects allocated from a region can be freed with a single call, potentially reducing the bookkeeping necessary to avoid memory leaks. Though none of these memory allocation approaches are the universal solution for real-time constraints, each has advantages and is useful in the appropriate circumstances.</p>
</sec>
<sec id="S2-2-4">
<label>2.2.4</label> <title>Lesson Learned</title>
<p>Wringing real-time performance out of a general purpose system is a careful balancing act. It requires understanding the overheads introduced by low-level calls and avoiding those with the potential to cause unacceptable resource usage. Selecting appropriate kernels and runtime support helps, but universal and guaranteed solutions are rare. A fundamental challenge is that general purpose computation considers time not in terms of correctness but only as a quality metric &#x02013; faster is better &#x02013; whereas real-time computation depends on timing for correctness (Lee, <xref ref-type="bibr" rid="B41">2009</xref>). This is one area where continuing research is needed.</p>
</sec>
</sec>
<sec id="S2-3">
<label>2.3</label> <title>System Integration</title>
<p>System integration is a major challenge in robotics (Johnson et al., <xref ref-type="bibr" rid="B35">2015</xref>; Zucker et al., <xref ref-type="bibr" rid="B68">2015</xref>). While this is a broad issue covering algorithms, software, hardware, and operating environments, there are still lessons from the unix community that inform integration of humanoid robot software. In this regard, the humanoid robotics community mirrors the general open source world, depending on a wide variety of software packages from globally distributed authors and running on a wide variety of underlying platforms. We discuss design issues for software extensibility and compatibility in this section. In Appendix B, we discuss how build systems and package managers help integrate the many software packages required by humanoids. These general approaches for extensible design and software management are useful for similar software integration problems on humanoids.</p>
<sec id="S2-3-1">
<label>2.3.1</label> <title>Compatibility and Extensibility</title>
<p>Flexible and adaptable software is crucial to humanoid robots, where requirements and platforms are continually evolving. Tools and design principles from the POSIX programing community enable software that gracefully handles both the constant churn of ongoing development and the larger shifts of evolving platforms.</p>
<sec id="S2-3-1-1">
<label>2.3.1.1</label> <title>Mechanism vs. Policy</title>
<p>A key consideration in designing flexible software is the <italic>Separation of Mechanism and Policy</italic> (Silberschatz et al., <xref ref-type="bibr" rid="B59">2009</xref>). Flexible software helps both in development by making it easier to prototype new systems and in long-term maintenance by making it easier to adapt to changing requirements. Software is more flexible when it provides mechanisms to perform some activity, but does not dictate overly restrictive policies over when or how to execute those activities. A canonical example of this approach is the X Window System (X11), which provides a mechanism for handling the display, but defers on policies for window management and &#x0201C;look-and-feel&#x0201D; (Scheifler, <xref ref-type="bibr" rid="B57">2004</xref>). Compared to other, more integrated windowing systems, X11 has been extraordinarily long-lived, surviving various alternatives, e.g., Gosling et al. (<xref ref-type="bibr" rid="B25">1989</xref>), Linton and Price (<xref ref-type="bibr" rid="B43">1993</xref>), and Thomas et al. (<xref ref-type="bibr" rid="B65">2003</xref>), through changing graphics platforms. For research in particular, the separation of concerns is critically important to handling requirements that evolve as understanding of the project grows. We have followed this approach also in Ach by providing a communication mechanism but not dictating policies for message encoding or event handling. This separation of <italic>policy</italic> from <italic>mechanism</italic> is important for flexibility.</p>
</sec>
<sec id="S2-3-1-2">
<label>2.3.1.2</label> <title>Binary Compatibility</title>
<p>When we modify a library on the robot, it is desirable to avoid the need to modify or recompile programs using that library. This requires maintaining <italic>binary compatibility</italic>. Preserving binary compatibility requires the library to export a compatible Application Binary Interface (ABI). Maintaining ABI compatibility helps users by avoiding the requirement to install multiple library versions and by reducing the need to recompile applications. Drepper (<xref ref-type="bibr" rid="B18">2011</xref>) provides a detailed explanation of shared libraries and compatibility. In general, preserving binary compatibility requires that symbol names not be changed or removed and that client-visible structures preserve both their total size and the offsets of their fields. In C&#x0002B;&#x0002B;, changes to the class hierarchy or virtual methods break binary compatibility. These requirements present challenges as new features are added to software. Adding new functions will not break compatibility; however, changes to structures may. There are some options to change structures while still preserving the ABI. One option, used in Ach, is to reserve space in structure declarations for fields to be added in the future. Reserving space maintains the total size of the structure when new fields are added. The cost is additional memory usage for the reserved space. Another option is to encapsulate all structure allocation and access within the library, exposing structures only as opaque pointers along with functions to access their fields. Encapsulating allocation permits changes to the underlying structure. The cost is the additional indirection and function call overhead to access the structure. When breaking the ABI is necessary, it is desirable to permit multiple ABI versions of the library to be installed together. Installing multiple ABI versions can be done by changing the library name, typically by including the version number in the library name; however, this may unnecessarily create different ABI versions when the new library version actually maintains binary compatibility. The alternative is to maintain a separate ABI version from the library version number. ABI versioning is handled differently on different operating systems; however, the Libtool component of Autotools provides a uniform interface for library versioning (GNU Libtool, <xref ref-type="bibr" rid="B23">2015</xref>). While preserving ABI compatibility requires care and planning, it is generally possible and benefits library users.</p>
</sec>
<sec id="S2-3-1-3">
<label>2.3.1.3</label> <title>Source Compatibility</title>
<p>If we cannot maintain binary compatibility when we modify a library, it is desirable to at least require only a recompilation of programs using the library rather than modifications to the programs&#x02019; source code. This requires maintaining <italic>source compatibility</italic>. Preserving source compatibility requires a library to export a compatible Application Programing Interface (API). Maintaining API compatibility helps users by avoiding or reducing the need for them to modify their code to accommodate API changes. API compatibility is easier to maintain than ABI compatibility, generally requiring only that symbols not be removed or renamed and that argument lists remain the same. If such changes are necessary, there are some options to reduce the burden on users. One can give users time to change their code by first <italic>deprecating</italic> symbols before they are removed. For example, the <monospace>gets</monospace> function, vulnerable to buffer overflows, was deprecated in ISO/IEC <xref ref-type="bibr" rid="B33">9899</xref>:<xref ref-type="bibr" rid="B33">1999</xref> (<xref ref-type="bibr" rid="B33">1999</xref>) and removed in ISO/IEC <xref ref-type="bibr" rid="B34">9899</xref>:<xref ref-type="bibr" rid="B34">2011</xref> (<xref ref-type="bibr" rid="B34">2011</xref>). When structure fields must be renamed, one can preserve API compatibility by including both names within an anonymous union field. The old name can then be marked as deprecated. If it is possible that additional arguments may at some point be needed for a function, one can pass multiple arguments as fields within a structure or as items in a bitmasked integer. This allows additional arguments to be later included as fields in the structure or bits of the integer. This approach is used by the POSIX theads API (pthreads) in their various attribute structure arguments (POSIX, <xref ref-type="bibr" rid="B51">2008</xref>). Several functions in Ach also take a similar attribute structure as an argument. Taking these precautions to preserve API compatibility eases the task of software maintenance for library users.</p>
</sec>
<sec id="S2-3-1-4">
<label>2.3.1.4</label> <title>Language Selection</title>
<p>Programing language selection is an important, though contentious issue, and no language is universally ideal for the diverse needs of humanoid robots. Developing complex applications is easier in high-level, garbage-collected languages, while strict real-time requirements preclude garbage-collection, leaving lower-level languages such as C and C&#x0002B;&#x0002B;. Though C&#x0002B;&#x0002B; has many features over C that are sometimes useful, it comes at a cost which should be considered. C is often preferred by performance-sensitive projects, e.g., the Linux kernel, because it is easier for the programmer to understand and control important, low-level details such as error handling and memory allocations which C&#x0002B;&#x0002B; abstracts through exceptions and constructors. C&#x0002B;&#x0002B; also presents compatibility issues. Because C identifiers map directly to assembly language symbols, it is generally possible to link C code built with different compilers. C&#x0002B;&#x0002B;, on the other hand, uses implementation-specific name mangling on identifiers, e.g., to handle overloaded functions, so linking C&#x0002B;&#x0002B; code built with different compilers may not be possible. Changes to operating systems ABIs for C&#x0002B;&#x0002B;, though still infrequent, occur more often than for C. When performance requirements permit high-level, garbage-collected languages, binding low-level libraries written in C is generally easier than for C&#x0002B;&#x0002B;. C is universally supported among high-level languages for foreign function bindings, e.g., JNI for Java, CFFI for Lisp, and ctypes for Python, whereas the ability to directly interact with C&#x0002B;&#x0002B; classes is less common. Because Ach is performance sensitive and real-time, it is implemented in C. To interface with high-level, non-real-time modules, Ach provides foreign function bindings for Common Lisp, Python, and Java. Given the trade-offs among programing languages, one should be judicious in selecting languages for implementations and interfaces.</p>
</sec>
</sec>
<sec id="S2-3-2">
<label>2.3.2</label> <title>Lesson Learned</title>
<p>The unix programing tradition provides many tools and conventions to assist with system integration of humanoid robot software. Following established conventions to preserve ABI and API compatibility makes software easier to use by reducing the system administration and software maintenance task for users. Appropriate languages ease software development and maintenance while still providing acceptable performance. Though this is far from covering the full range of system integration issues for humanoid robots, it goes a long way toward addressing software-specific system integration.</p>
</sec>
</sec>
</sec>
<sec id="S3">
<label>3</label> <title>Extending Linux Communication</title>
<p>POSIX provides a rich variety of communication methods that are well suited for general purpose information processing, but none are ideal for real-time robot control. General computation favors throughput over latency. POSIX communication favors older data over newer. In contrast, real-time control requires low latency access to the newest data. Dantam et al. (<xref ref-type="bibr" rid="B13">2015</xref>) discusses the challenges of POSIX communication in detail. This gap has made it difficult to develop real-time applications in the multiprocess POSIX style. To address this communication need, we developed the Ach library.</p>
<sec id="S3-1">
<label>3.1</label> <title>The Ach IPC Library</title>
<p>Ach provides a message bus or publish-subscribe style of communication between multiple writers and multiple readers (Dantam et al., <xref ref-type="bibr" rid="B13">2015</xref>). Robots using Ach have multiple channels across which individual data samples are published. Messages are sent as byte arrays, so arbitrary data may be transmitted such as floating point vectors, text, images, and binary control messages. The primary unique feature of Ach is that newer messages always supersede older messages whereas POSIX communication gives priority to older data and will block or drop newer messages when buffers are full. Ach&#x02019;s latest-message semantics are appropriate for continuous, time-varying signals such as reference velocities or position measurements. In other cases where reliable messaging is required, such as updating a PID gain value, Ach may provide sufficient reliability by using a separate channel with a large buffer; however, this is a secondary consideration. Ach&#x02019;s primary focus on latest-information, publish-subscribe messaging give it unique capabilities for real-time communication of physical data samples.</p>
<sec id="S3-1-1">
<label>3.1.1</label> <title>Relation to Robotics Middleware</title>
<p>There are many other communication systems developed for robotics; however, Ach provides a unique set of features and capabilities. First, many other systems operate as frameworks (Bruyninckx et al., <xref ref-type="bibr" rid="B5">2003</xref>; Metta et al., <xref ref-type="bibr" rid="B46">2006</xref>; Quigley et al., <xref ref-type="bibr" rid="B53">2009</xref>) that impose specific structure on the application. Sometimes this structure is helpful when it fits the desired application, and other times such imposed structure may impede development if the requirements are outside the particular framework&#x02019;s model. In contrast, Ach strictly adheres to the idea of <italic>mechanism, not policy</italic> (see Section <xref ref-type="sec" rid="S2-3-1-1">2.3.1.1</xref>), providing a flexible communication method that is easily integrated with other approaches (see Appendix <xref ref-type="app" rid="S7">A</xref>). One could also view Ach as providing low-level capabilities that could serve as a useful building-block for such higher-level frameworks. Second, many other systems focus on network communication (Metta et al., <xref ref-type="bibr" rid="B46">2006</xref>; Quigley et al., <xref ref-type="bibr" rid="B53">2009</xref>; Huang et al., <xref ref-type="bibr" rid="B30">2010</xref>; Hammer and Bauml, <xref ref-type="bibr" rid="B27">2013</xref>). In contrast, Ach focuses on local, interprocess communication. This focus enables it to achieve superior performance in its domain (Dantam et al., <xref ref-type="bibr" rid="B13">2015</xref>), and we view Ach as complementary to various network protocols. Finally, Ach provides unique semantics that make it especially suited to real-time communication of continuously varying data. Similar to multicast methods (Huang et al., <xref ref-type="bibr" rid="B30">2010</xref>), Ach efficiently supports multiple senders and receivers. Ach implicitly supports <italic>process priorities</italic> whereas network-based methods use <italic>QoS</italic> (DDS 1.2, <xref ref-type="bibr" rid="B16">2007</xref>; Hammer and Bauml, <xref ref-type="bibr" rid="B27">2013</xref>). Crucially, Ach eliminates any possibility HOL blocking (see Section <xref ref-type="sec" rid="S2-2-1">2.2.1</xref>). Network-based methods can handle HOL blocking at the sending and receiving ends (Metta et al., <xref ref-type="bibr" rid="B46">2006</xref>), but dealing with assumptions in intermediate infrastructure and code is a difficult challenge (Gettys and Nichols, <xref ref-type="bibr" rid="B22">2012</xref>). Overall, the unique design decisions underlying Ach result in special advantages for local, real-time communication, and we consider Ach as a key component within a larger robot software system.</p>
</sec>
<sec id="S3-1-2">
<label>3.1.2</label> <title>Design of Ach</title>
<p>The data structure for each channel, shown in Figure <xref ref-type="fig" rid="F1">1</xref>B, is a pair of circular buffers, (1) a data buffer with variable sized entries and (2) an index buffer with fixed-size elements indicating the offsets into the data buffer. Ach provides additional capabilities compared to a typical circular buffers, such as in Figure <xref ref-type="fig" rid="F1">1</xref>A:
<list list-type="bullet">
<list-item><label>&#x02022;</label> <p>Ach allows multiple receivers;</p></list-item>
<list-item><label>&#x02022;</label> <p>Ach always allows access to the newest data;</p></list-item>
<list-item><label>&#x02022;</label> <p>Ach drops the oldest data &#x02013; instead of the newest data &#x02013; when the buffer is full.</p></list-item>
</list></p>
<p>Two procedures compose the core of ach: <monospace>ach_put</monospace> and <monospace>ach_get</monospace>. Detailed pseudocode is provided in Dantam and Stilman (<xref ref-type="bibr" rid="B14">2012</xref>), and their use is discussed in the Ach manual (Dantam, <xref ref-type="bibr" rid="B11">2015b</xref>) and programing reference (Dantam, <xref ref-type="bibr" rid="B10">2015a</xref>).</p>
<p>The procedure <monospace>ach_put</monospace> inserts new messages into the channel. It is analogous to the POSIX <monospace>write</monospace>, <monospace>sendmsg</monospace>, and <monospace>mq_send</monospace> functions. The procedure is given a pointer to the shared memory region for the channel and a byte array containing the message to post.</p>
<p>Algorithm 1 (ach_put). There are four broad steps to the <monospace>ach_put</monospace> procedure:
<list list-type="order">
<list-item><p>Get an index entry. If there is at least one free index entry, use it. Otherwise, clear the oldest index entry and its corresponding message in the data array.</p></list-item>
<list-item><p>Make room in the data array. If there is enough room already, continue. Otherwise, repeatedly free the oldest message until there is enough room.</p></list-item>
<list-item><p>Copy the message into data array.</p></list-item>
<list-item><p>Update the offset and free counts in the channel structure.</p></list-item>
</list></p>
<p>The procedure <monospace>ach_get</monospace> receives a message from the channel. It is analogous to <monospace>read</monospace>, <monospace>recvmsg</monospace>, and <monospace>mq_receive</monospace>. The procedure takes a pointer to the shared memory region, a storage buffer to copy the message to, the last message sequence number received, the next index offset to check for a message, and option flags indicating whether to block waiting for a new message and whether to return the newest message bypassing any older unseen messages.</p>
<p>Algorithm 2 (ach_get). There are four broad steps to the <monospace>ach_get</monospace> procedure:
<list list-type="order">
<list-item><p>If given the option argument to wait for a new message and there is no new message, then wait. Otherwise, if there are no new messages, return a status code indicating this fact.</p></list-item>
<list-item><p>Find the index entry to use. If given the option argument to return the newest message, use the newest entry. Otherwise, if the next entry we expected to use contains the next sequence number, we expect to see, use that entry. Otherwise, use the oldest entry.</p></list-item>
<list-item><p>According to the offset and size from the selected index entry, copy the message from the data array into the provided storage buffer.</p></list-item>
<list-item><p>Update the sequence number count and next index entry offset for this receiver.</p></list-item>
</list></p>
<p>Ach provides unique semantics compared to traditional POSIX communication. Processes on a single host can access a unified physical memory, which provides high bandwidth and assumed perfect reliability; still, care must be taken to ensure memory consistency between asynchronously executing processes. In contrast, real-time communication across a network need not worry about memory consistency, but must address issues such as limited bandwidth, packet loss, collisions, clock skew, and security.</p>
</sec>
<sec id="S3-1-3">
<label>3.1.3</label> <title>User Space Limitations</title>
<p>The initial implementation of Ach located the data structure shown in Figure <xref ref-type="fig" rid="F1">1</xref>B in POSIX shared memory and synchronized access using a mutex and a condition variable. This presented a few potential error modes and limitations: a rogue or faulty process could deadlock or corrupt a channel and each thread was limited to waiting for data on single channel at a time. We discuss these potential issues next and resolve them with the kernel space implementation described in Section <xref ref-type="sec" rid="S3-2">3.2</xref>.</p>
<p>While the formal verification of Ach (Dantam et al., <xref ref-type="bibr" rid="B13">2015</xref>) guarantees that it will not deadlock with regular use of the library calls, deadlock may still occur if a reader or writer dies, e.g., with a <monospace>kill -9</monospace>, inside a library call. This is partially mitigated by the use of robust POSIX mutexes, which detect this condition and handle interrupted reads. Additional code could be added, which would rollback an interrupted write.</p>
<p>Because all processes accessing the channel must have read and write access to the shared memory region, a rogue process could corrupt the channel data structures. Currently, unintentional corruption is weakly detected with guard bytes. This could be improved with better sanity checks of the channel and automatic recreation of corrupted channels.</p>
<p>The use of POSIX threads synchronization primitives limits each thread to wait for new messages on a single channel at a time. Readers wait for new messages on a per-channel POSIX condition variable and are notified by the writer when a new message is posted. POSIX threads are limited to waiting on only a single condition variable at a time; thus, there is no way in this implementation for a thread to simultaneously wait for data on multiple channels. Alternative file-based notification, e.g., using pipes or sockets, would allow multiplexing but may cause extra context-switching and additional logic would be required to ensure that tasks run in priority order. This semantic limitation was the primary motivation for the development of the kernel space Ach implementation.</p>
</sec>
</sec>
<sec id="S3-2">
<label>3.2</label> <title>Kernel Space Ach</title>
<p>To address the limitations of user space Ach presented in Section <xref ref-type="sec" rid="S3-1-3">3.1.3</xref>, we develop a new kernel space implementation of the Ach data structure and procedures. This implementation runs in the Linux kernel. The channel buffers shown in Figure <xref ref-type="fig" rid="F1">1</xref>B are located in kernel memory, protecting channels from corruption and deadlock (see Figure <xref ref-type="fig" rid="F2">2</xref>). Critically, channels are accessed from user space via file descriptors, enabling efficient multiplexing through event-based <monospace>poll</monospace>/<monospace>select</monospace> style calls. This enables efficient real-time communication using established network programing idioms.</p>
<fig position="float" id="F2">
<label>Figure 2</label>
<caption><p><bold>Backing memory locations for Ach channels</bold>. Channels in the process heap are private to the process. Channels in POSIX shared memory are accessible by multiple processes. The kernel channels presented in this paper are available through per-channel virtual devices and are also accessible by multiple processes. The virtual devices are accessed from user space through file descriptors, meaning the kernel channels can be multiplexed via <monospace>select</monospace>, <monospace>poll</monospace>, etc. Because kernel channels are in protected kernel memory, they cannot be corrupted by rogue processes.</p></caption>
<graphic xlink:href="frobt-03-00006-g002.tif"/>
</fig>
<sec id="S3-2-1">
<label>3.2.1</label> <title>Kernel Module Implementation</title>
<p>Ach is implemented in kernel space as a Linux module that creates a device file for each channel. When the module is loaded, it creates the /<monospace>dev/achctrl</monospace> device to manage channel creation and removal. Each channel is represented with a separate virtual device, e.g., /<monospace>dev/ach-foo</monospace> for channel <monospace>foo</monospace>. These virtual devices are not accessed directly by applications but instead are accessed through the Ach library using the same API as user space channels. This provides backward source-compatibility with the user space implementation and allows applications to freely switch between user and kernel space channels. The library functions to create channels (<monospace>ach_create</monospace>) and remove channels (<monospace>ach_unlink</monospace>) operate on kernel channels through <monospace>ioctl</monospace> system calls on the /<monospace>dev/achctrl</monospace> device. The library functions to send (<monospace>ach_put</monospace>) and receive (<monospace>ach_get</monospace>) messages map to <monospace>write</monospace> and <monospace>read</monospace>, respectively. Additional parameters for receiving messages, such as timeouts or flags to retrieve the newest message, are passed to the kernel via <monospace>ioctl</monospace>s. Event-based multiplexing of ach channels &#x02013; alongside sockets, pipes, and other file descriptors &#x02013; is possible by passing the file descriptor for the channel device file to <monospace>poll</monospace>, <monospace>select</monospace>, etc; the kernel module performs the appropriate notification when a new message is posted to the channel. By providing this kernel-supported, file-descriptor-based interface to ach channels, we improve the ability to handle multiple data sources and to interoperate with other communication mechanisms using the standard POSIX event-based I/O functions.</p>
<p>Multiplexing of Ach kernel channels is possible with the following steps:</p>
<p>Algorithm 3 (Ach Multiplexing).</p>
<list list-type="order">
<list-item><p>Open all channels with <monospace>ach_open</monospace>.</p></list-item>
<list-item><p>Obtain the channels&#x02019; file descriptors by calling <monospace>ach_channel_fd</monospace>, and record the file descriptors in the <monospace>struct pollfd</monospace>.</p></list-item>
<list-item><p>Call <monospace>poll</monospace> to wait for new data on any channel.</p></list-item>
<list-item><p>Call <monospace>ach_get</monospace> on channels with new data.</p></list-item>
</list>
<p>Appendix A provides a complete example of multiplexing Ach channels alongside conventional POSIX streams.</p>
</sec>
<sec id="S3-2-2">
<label>3.2.2</label> <title>Advantages of Kernel Space Ach</title>
<p>The in-kernel Ach implementation removes the limitations of the user space implementation discussed in Section <xref ref-type="sec" rid="S3-1-3">3.1.3</xref>. Primarily, it permits multiplexing of multiple channels alongside other POSIX communication mechanisms using standard and efficient event-based I/O, e.g., <monospace>select</monospace> and <monospace>poll</monospace>. For humanoid robots, where a process may need to receive data from a large number of sources, this ability to conduct efficient I/O is a critical advantage. In addition, the potential of user space channels for corruption and deadlock from rogue processes is eliminated in the kernel implementation. Kernel channels are in kernel memory which cannot be directly accessed by user space processes. The kernel implementation eliminates the faults of user space Ach, giving it the same features and robustness as standard POSIX communication mechanisms.</p>
</sec>
<sec id="S3-2-3">
<label>3.2.3</label> <title>Disadvantages of Kernel Space Ach</title>
<p>The in-kernel implementation does present some potential disadvantages for portability and a caveat regarding robustness.</p>
<p>While the user space implementation used standard POSIX calls, the in-kernel implementation is Linux-specific, running on vanilla and PREEMPT_RT kernels. This would present an issue if it is necessary to use a non-Linux kernel, requiring additional work to implement Ach within that separate kernel. However, the Ach code is modular and well-factored &#x02013; the core code is largely shared between the user and Linux kernel space implementations. Adding an additional backend for another kernel should not be a major challenge, and we hope to develop a kernel module for Xenomai in the future.</p>
<p>Code in kernel space faces stricter correctness requirements than in user space. Software errors in the Ach kernel module &#x02013; as with any kernel space code &#x02013; can potentially crash the entire operating system. However, for humanoid robots, any software error, whether in user or kernel space, can potentially &#x02013; and literally &#x02013; crash the entire robot. Thus, moving Ach to the kernel does not significantly change the severity of potential errors. Still, it is important to understand the strict requirements on kernel space code.</p>
</sec>
</sec>
<sec id="S3-3">
<label>3.3</label> <title>Benchmarks</title>
<p>We provide benchmark results of message latency for Ach compared to a variety of other kernel communication methods.<xref ref-type="fn" rid="fn4"><sup>4</sup></xref> Latency is often more critical than bandwidth for real-time control as the amount of data per sample is generally small, e.g., state and reference values for several joint axes. Consequently, the actual time to copy the data is negligible compared to other sources of overhead such as process scheduling. The benchmark application performs the following steps:
<list list-type="order">
<list-item><p>Initialize communication structures;</p></list-item>
<list-item><p><monospace>fork</monospace> sending and receiving processes;</p></list-item>
<list-item><p>Sender: Post timestamped messages at the desired frequency;</p></list-item>
<list-item><p>Receivers: Receive messages and record latency of each messaged based on the timestamp.</p></list-item>
</list></p>
<p>Figure <xref ref-type="fig" rid="F3">3</xref> shows the results of the benchmarks, run on an Intel<sup>&#x000AE;</sup> Core&#x02122; i7-4790 at 3.6&#x02009;GHz under Linux 3.18.16-rt13 PREEMPT RT. We compare Ach with several common POSIX communication mechanisms. In contrast to Ach and these lightweight, kernel methods, heavyweight middleware such as ROS and CORBA impose several times greater communication latency (Dantam et al., <xref ref-type="bibr" rid="B13">2015</xref>). All the methods shown in Figure <xref ref-type="fig" rid="F3">3</xref> are similar in performance, indicating that the bulk of overhead is due to the process context switch rather than the minimal time for the actual communication operation. For the single receiver case, both user and kernel space Ach provide comparable latency to POSIX communication. While the latency is similar, there are also important feature differences. Kernel space Ach can multiplex across multiple channels while user space Ach cannot, and unlike POSIX communication, Ach directly supports multiple subscribers. The results in Figure <xref ref-type="fig" rid="F3">3</xref> show that Ach provides strong performance, along with its ability to handle multiple subscribers and its unique latest-message-favored semantics.</p>
<fig position="float" id="F3">
<label>Figure 3</label>
<caption><p><bold>Message Latency for Ach and POSIX communication</bold>. Ach has comparable performance to optimized POSIX communication, and unlike POSIX methods, Ach enables multiple receivers and prioritizes newer data. In the plots, &#x0201C;Mean&#x0201D; is the average latency over all messages, &#x0201C;99%&#x0201D; is the latency that 99% of messages beat, and &#x0201C;Max&#x0201D; is the maximum recorded latency. The long-tail of the worst-case behavior arises from the focus of general purpose platforms on average-case performance instead of bounded response needed by real-time systems. For example, lazy algorithms and hardware memory caches improve average performance, but still leave the worst-case cost to pay.</p></caption>
<graphic xlink:href="frobt-03-00006-g003.tif"/>
</fig>
</sec>
<sec id="S3-4">
<label>3.4</label> <title>Case Study: Baxter Robot</title>
<p>We use the new kernel space Ach implementation in our control system for the Baxter robot. The Baxter is a dual-arm manipulator. Each arm has 7 degrees of freedom and a parallel jaw gripper. The integrated electronics enable position, velocity, and torque control of the robot&#x02019;s axes. We implement several modes of multi-axis control using this interface.</p>
<p>Figure <xref ref-type="fig" rid="F4">4</xref> shows our Ach-based control system for the Baxter robot. In this system, each driver and controller runs as a separate, isolated operating system process. Previous ach-based systems ran drivers as separate processes, but multiple controllers were combined into a single processes (Dantam et al., <xref ref-type="bibr" rid="B13">2015</xref>). Because kernel space Ach channels are efficiently multiplexable, we can run the Baxter controllers in separate processes, each outputing to a distinct channel. The <monospace>ref</monospace> process receives messages from all these channels, selecting the highest priority message to communicate to the robot. This design efficiently integrates multiple control modes for the robot, each running in separate processes.</p>
<fig position="float" id="F4">
<label>Figure 4</label>
<caption><p><bold>Ach-based control system for the Baxter robot</bold>. Three control pipelines run concurrently: a teleoperation pipeline for manual control (top), a camera registration and visual servoing pipeline (middle, Dantam et al., <xref ref-type="bibr" rid="B12">2016</xref>), and a joint planning (Sucan et al., <xref ref-type="bibr" rid="B63">2012</xref>) and interpolation pipeline (bottom). The <monospace>ref</monospace> process multiplexes the output of these three pipelines and selects the highest priority command to send to the robot. A non-real-time logging process (not shown) also receives informational and error messages from the other control system processes over a single Ach channel and records the messages in a log file.</p></caption>
<graphic xlink:href="frobt-03-00006-g004.tif"/>
</fig>
<p>In addition to the processes shown in Figure <xref ref-type="fig" rid="F4">4</xref>, we also run a separate, non-real-time logging process. All the control system processes write log messages to a single event channel. In normal operation, the logger waits for new messages on the event channel, stepping through each posted message and recording it to a log file. However, if log messages are posted faster than the logger can process them, for example whether due limited CPU cycles or a programing error, some messages will be skipped as they are overwritten in the circular buffer (see Figure <xref ref-type="fig" rid="F1">1</xref>B). The alternative to skipping messages would be to block the message sender until the logger can process messages or to buffer an unbounded number of unprocessed log messages. Neither blocking a real-time process nor growing a buffer without bound is desirable in a real-time control system. Instead, Ach overwrites the oldest message and the system continues, missing only the skipped log messages.</p>
<p>The primary advantages of this multi-process control system design are modularity and robustness to software errors. Separating drivers and controllers into different processes means they can be developed and tested independently. This separation is particularly useful to prototype new controllers, which can be developed without disturbing previously tested work. For example, we developed and tested the workspace controller described in Kingston et al. (<xref ref-type="bibr" rid="B39">2015</xref>) without any modification to the processes in Figure <xref ref-type="fig" rid="F4">4</xref>. Failures encountered while developing and testing the new controller did not affect the other running control processes. In contrast, combining multiple controllers in a single process as was necessary for the user space Ach systems presented in Dantam et al. (<xref ref-type="bibr" rid="B13">2015</xref>) means that errors encountered while prototyping a new controller will not interfere with existing control modes. In research applications on robot control, easing controller development and testing is a key advantage.</p>
</sec>
</sec>
<sec id="S4">
<label>4</label> <title>Conclusion</title>
<p>We have discussed the application of unix design principles to robot software. Among the various unix tools and conventions, the multiprocess design typical of unix applications improves modularity and robustness, critical needs for complex systems such as humanoid robots. We enable this multiprocess design for real-time control with the efficient Ach communication library. This approach is general, applying to multiple types of robots and other complex mechatronic systems that require coordination of many hardware devices and software modules. Ach fills a need in robot software unmet by POSIX, providing a communication mechanism that supports multiple receivers and gives priority to newer messages. The kernel space implementation presented in this paper exposes a file descriptor interface, enabling multiplexing of messages from many sources and efficient integration with other communication methods. Kernel space Ach enables development of real-time robot software in the conventional modular, robust, multi-process unix style.</p>
<p>The approach to robot software development we have presented &#x02013; advocating use of existing tools and conventions from the unix programing community &#x02013; is inherently conservative. While building on unix provides a mature set of capabilities, new research in techniques to automate software development have the potential to radically improve the development process.</p>
<p>Formal methods for software verification and synthesis can greatly ease software development. Some tools are already in widespread use (Cimatti et al., <xref ref-type="bibr" rid="B8">2002</xref>; Ball et al., <xref ref-type="bibr" rid="B2">2004</xref>), and we used SPIN (Holzmann, <xref ref-type="bibr" rid="B29">2004</xref>) to verify Ach in Dantam et al. (<xref ref-type="bibr" rid="B13">2015</xref>). Formal methods continue to be an active research area in robotics (Wang et al., <xref ref-type="bibr" rid="B66">2009</xref>; Dantam and Stilman, <xref ref-type="bibr" rid="B15">2013</xref>; Liu et al., <xref ref-type="bibr" rid="B44">2013</xref>; Nedunuri et al., <xref ref-type="bibr" rid="B47">2014</xref>; Lignos et al., <xref ref-type="bibr" rid="B42">2015</xref>), bridging the fields of software engineering, automatic control, and planning and scheduling. Though limits remain on which problems admit formal reasoning, further research has the potential to broaden the scope of formal methods for humanoid robot software, changing our fundamental approach to software development.</p>
</sec>
<sec id="S5">
<title>Author Contributions</title>
<p>ND, primary author of overall software, secondary author of additional modules described in paper. KB, primary author of additional modules described in paper. MJ, additional contributions to software. TB, supported work at Atlas Copco and Prevas, contributions to design and testing methods. LK, supported work at Rice University, contributions to testing and presentation of the work.</p>
</sec>
<sec id="S6">
<title>Conflict of Interest Statement</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest. The reviewer AP and the handling editor LN declared their shared affiliation, and the handling editor states that the process nevertheless met the standards of a fair and objective review.</p>
</sec>
</body>
<back>
<ack>
<p>Work at Rice University by ND and LK has been supported in part by NSF IIS 1317849, NSF CCF 1514372, and Rice University Funds. Work by KB, MJ, and TF has been supported by Atlas Copco Rock Drills AB. We thank Zachary K. Kingston for his development work and continuing maintenance of the presented Baxter software example.</p>
</ack>
<ref-list>
<title>References</title>
<ref id="B1"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Bacon</surname> <given-names>D. F.</given-names></name> <name><surname>Cheng</surname> <given-names>P.</given-names></name> <name><surname>Rajan</surname> <given-names>V.</given-names></name></person-group> (<year>2003</year>). <article-title>&#x0201C;A real-time garbage collector with low overhead and consistent utilization,&#x0201D;</article-title> in <source>Symposium on Principles of Programming Languages</source>, Vol. <volume>38</volume> (<publisher-loc>New Orleans, LA</publisher-loc>: <publisher-name>ACM</publisher-name>), <fpage>285</fpage>&#x02013;<lpage>298</lpage>.</citation></ref>
<ref id="B2"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Ball</surname> <given-names>T.</given-names></name> <name><surname>Cook</surname> <given-names>B.</given-names></name> <name><surname>Levin</surname> <given-names>V.</given-names></name> <name><surname>Rajamani</surname> <given-names>S. K.</given-names></name></person-group> (<year>2004</year>). <article-title>&#x0201C;SLAM and static driver verifier: technology transfer of formal methods inside Microsoft,&#x0201D;</article-title> in <source>Integrated Formal Methods, Volume 2999 of Lecture Notes in Computer Science</source> (<publisher-loc>Canterbury</publisher-loc>: <publisher-name>Springer</publisher-name>), <fpage>1</fpage>&#x02013;<lpage>20</lpage>.</citation></ref>
<ref id="B3"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Brown</surname> <given-names>J. H.</given-names></name> <name><surname>Martin</surname> <given-names>B.</given-names></name></person-group> (<year>2010</year>). <source>How Fast Is Fast Enough? Choosing between Xenomai and Linux for Real-time Applications</source>. <publisher-name>Technical Report, Rep Invariant Systems</publisher-name>. Available at: <uri xlink:href="https://www.osadl.org/fileadmin/dam/rtlws/12/Brown.pdf">https://www.osadl.org/fileadmin/dam/rtlws/12/Brown.pdf</uri></citation></ref>
<ref id="B4"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Brugali</surname> <given-names>D.</given-names></name> <name><surname>Scandurra</surname> <given-names>P.</given-names></name></person-group> (<year>2009</year>). <article-title>Component-based robotic engineering (part I)[tutorial]</article-title>. <source>IEEE Rob. Autom. Mag.</source> <volume>16</volume>, <fpage>84</fpage>&#x02013;<lpage>96</lpage>.<pub-id pub-id-type="doi">10.1109/MRA.2009.934837</pub-id></citation></ref>
<ref id="B5"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Bruyninckx</surname> <given-names>H.</given-names></name> <name><surname>Soetens</surname> <given-names>P.</given-names></name> <name><surname>Koninckx</surname> <given-names>B.</given-names></name></person-group> (<year>2003</year>). <article-title>&#x0201C;The real-time motion control core of the Orocos project,&#x0201D;</article-title> in <source>International Conference on Robotics and Automation</source>, Vol. <volume>2</volume> (<publisher-loc>Taipei</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>2766</fpage>&#x02013;<lpage>2771</lpage>.</citation></ref>
<ref id="B6"><citation citation-type="web"><collab>Catkin</collab>. (<year>2015</year>). <source>Catkin Conceptual Overview</source>. Available at: <uri xlink:href="http://wiki.ros.org/catkin/conceptual_overview">http://wiki.ros.org/catkin/conceptual_overview</uri></citation></ref>
<ref id="B7"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Cheshire</surname> <given-names>S.</given-names></name> <name><surname>Krochmal</surname> <given-names>M.</given-names></name></person-group> (<year>2013</year>). <source>Multicast DNS</source>. <publisher-name>Internet Engineering Task Force</publisher-name>. Available at: <uri xlink:href="https://tools.ietf.org/html/rfc6762">https://tools.ietf.org/html/rfc6762</uri></citation></ref>
<ref id="B8"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Cimatti</surname> <given-names>A.</given-names></name> <name><surname>Clarke</surname> <given-names>E. M.</given-names></name> <name><surname>Giunchiglia</surname> <given-names>E.</given-names></name> <name><surname>Giunchiglia</surname> <given-names>F.</given-names></name> <name><surname>Pistore</surname> <given-names>M.</given-names></name> <name><surname>Roveri</surname> <given-names>M.</given-names></name> <etal/></person-group> (<year>2002</year>). <article-title>&#x0201C;Nusmv 2: an opensource tool for symbolic model checking,&#x0201D;</article-title> in <source>Computer Aided Verification, CAV &#x02019;02</source> (<publisher-loc>London</publisher-loc>: <publisher-name>Springer-Verlag</publisher-name>), <fpage>359</fpage>&#x02013;<lpage>364</lpage>.</citation></ref>
<ref id="B9"><citation citation-type="book"><collab>CORBA</collab>. (<year>2011</year>). <source>Common Object Request Broker Architecture (CORBA/IIOP)</source>, <edition>3.1.1 Edn</edition>. <publisher-name>The Object Management Group</publisher-name>. Available at: <uri xlink:href="http://www.omg.org/spec/CORBA/3.1.1/">http://www.omg.org/spec/CORBA/3.1.1/</uri></citation></ref>
<ref id="B10"><citation citation-type="web"><person-group person-group-type="author"><name><surname>Dantam</surname> <given-names>N. T.</given-names></name></person-group> (<year>2015a</year>). <source>Ach IPC Library</source>. Available at: <uri xlink:href="http://golems.github.io/ach/api/">http://golems.github.io/ach/api/</uri></citation></ref>
<ref id="B11"><citation citation-type="web"><person-group person-group-type="author"><name><surname>Dantam</surname> <given-names>N. T.</given-names></name></person-group> (<year>2015b</year>). <source>Ach IPC User Manual</source>. Available at: <uri xlink:href="http://golems.github.io/ach/manual/">http://golems.github.io/ach/manual/</uri></citation></ref>
<ref id="B12"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Dantam</surname> <given-names>N. T.</given-names></name> <name><surname>Amor</surname> <given-names>H. B.</given-names></name> <name><surname>Christensen</surname> <given-names>H.</given-names></name> <name><surname>Stilman</surname> <given-names>M.</given-names></name></person-group> (<year>2016</year>). <article-title>&#x0201C;Online camera registration for robot manipulation,&#x0201D;</article-title> in <source>Experimental Robotics</source>. eds <person-group person-group-type="editor"><name><surname>Ani Hsieh</surname> <given-names>M.</given-names></name> <name><surname>Khatib</surname> <given-names>O.</given-names></name> <name><surname>Kumar</surname> <given-names>V.</given-names></name></person-group> (<publisher-loc>Switzerland</publisher-loc>: <publisher-name>Springer</publisher-name>), <fpage>179</fpage>&#x02013;<lpage>194</lpage>.</citation></ref>
<ref id="B13"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Dantam</surname> <given-names>N. T.</given-names></name> <name><surname>Lofaro</surname> <given-names>D.</given-names></name> <name><surname>Hereid</surname> <given-names>A.</given-names></name> <name><surname>Oh</surname> <given-names>P.</given-names></name> <name><surname>Ames</surname> <given-names>A.</given-names></name> <name><surname>Stilman</surname> <given-names>M.</given-names></name></person-group> (<year>2015</year>). <article-title>The Ach IPC library</article-title>. <source>Rob. Autom. Mag.</source> <volume>22</volume>, <fpage>76</fpage>&#x02013;<lpage>85</lpage>.<pub-id pub-id-type="doi">10.1109/MRA.2014.2356937</pub-id></citation></ref>
<ref id="B14"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Dantam</surname> <given-names>N. T.</given-names></name> <name><surname>Stilman</surname> <given-names>M.</given-names></name></person-group> (<year>2012</year>). <article-title>&#x0201C;Robust and efficient communication for real-time multi-process robot software,&#x0201D;</article-title> in <source>International Conference on Humanoid Robots</source> (<publisher-loc>Osaka</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>316</fpage>&#x02013;<lpage>322</lpage>.</citation></ref>
<ref id="B15"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Dantam</surname> <given-names>N. T.</given-names></name> <name><surname>Stilman</surname> <given-names>M.</given-names></name></person-group> (<year>2013</year>). <article-title>The motion grammar: analysis of a linguistic method for robot control</article-title>. <source>Trans. Rob.</source> <volume>29</volume>, <fpage>704</fpage>&#x02013;<lpage>718</lpage>.<pub-id pub-id-type="doi">10.1109/TRO.2013.2239553</pub-id></citation></ref>
<ref id="B16"><citation citation-type="book"><collab>DDS 1.2</collab>. (<year>2007</year>). <source>Data Distribution Service for Real-time Systems</source>, <edition>1.2 Edn</edition>. <publisher-name>The Object Management Group</publisher-name>. Available at: <uri xlink:href="http://www.omg.org/spec/DDS/1.2/">http://www.omg.org/spec/DDS/1.2/</uri></citation></ref>
<ref id="B17"><citation citation-type="other"><person-group person-group-type="author"><name><surname>Dietrich</surname> <given-names>S. -T.</given-names></name> <name><surname>Walker</surname> <given-names>D.</given-names></name></person-group> (<year>2005</year>). <article-title>The evolution of real-time Linux</article-title>. In <source>7th Real Time Linux Workshop</source>.</citation></ref>
<ref id="B18"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Drepper</surname> <given-names>U.</given-names></name></person-group> (<year>2011</year>). <source>How to Write Shared Libraries</source>. <publisher-name>Technical Report</publisher-name>, Red Hat. Available at: <uri xlink:href="http://www.akkadia.org/drepper/dsohowto.pdf">http://www.akkadia.org/drepper/dsohowto.pdf</uri></citation></ref>
<ref id="B19"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Fayyad-Kazan</surname> <given-names>H.</given-names></name> <name><surname>Perneel</surname> <given-names>L.</given-names></name> <name><surname>Timmerman</surname> <given-names>M.</given-names></name></person-group> (<year>2013</year>). <article-title>Linux PREEMPT-RT vs. commercial RTOSs: how big is the performance gap?</article-title> <source>J. Comput.</source> <volume>3</volume>, <fpage>135</fpage>&#x02013;<lpage>142</lpage>.<pub-id pub-id-type="doi">10.5176/2251-3043_3.1.244</pub-id></citation></ref>
<ref id="B20"><citation citation-type="web"><person-group person-group-type="author"><name><surname>Gammo</surname> <given-names>L.</given-names></name> <name><surname>Brecht</surname> <given-names>T.</given-names></name> <name><surname>Shukla</surname> <given-names>A.</given-names></name> <name><surname>Pariag</surname> <given-names>D.</given-names></name></person-group> (<year>2004</year>). <article-title>&#x0201C;Comparing and evaluating epoll, select, and poll event mechanisms,&#x0201D;</article-title> in <source>Proceedings of the 6th Annual Ottawa Linux Symposium</source>. Available at: <uri xlink:href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi&#x0003D;10.1.1.215.7953">http://citeseerx.ist.psu.edu/viewdoc/summary?doi&#x0003D;10.1.1.215.7953</uri></citation></ref>
<ref id="B21"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Gerum</surname> <given-names>P.</given-names></name></person-group> (<year>2004</year>). <source>Xenomai &#x02013; Implementing a RTOS Emulation Framework on Gnu/Linux</source>. <publisher-name>Technical Report</publisher-name>, <publisher-loc>Xenomai</publisher-loc>.</citation></ref>
<ref id="B22"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Gettys</surname> <given-names>J.</given-names></name> <name><surname>Nichols</surname> <given-names>K.</given-names></name></person-group> (<year>2012</year>). <article-title>Bufferbloat: dark buffers in the internet</article-title>. <source>Commun. ACM</source> <volume>55</volume>, <fpage>57</fpage>&#x02013;<lpage>65</lpage>.<pub-id pub-id-type="doi">10.1145/2063176.2063196</pub-id></citation></ref>
<ref id="B23"><citation citation-type="book"><collab>GNU Libtool</collab>. (<year>2015</year>). <source>GNU Libtool &#x02013; Portable Dynamic Shared Object Management</source>. <publisher-name>Free Software Foundation</publisher-name>. Available at: <uri xlink:href="https://www.gnu.org/software/libtool/manual/">https://www.gnu.org/software/libtool/manual/</uri></citation></ref>
<ref id="B24"><citation citation-type="book"><collab>GNU Standards</collab>. (<year>2015</year>). <source>GNU Coding Standards</source>. <publisher-name>Free Software Foundation</publisher-name>. Available at: <uri xlink:href="https://www.gnu.org/prep/standards/">https://www.gnu.org/prep/standards/</uri></citation></ref>
<ref id="B25"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Gosling</surname> <given-names>J.</given-names></name> <name><surname>Rosenthal</surname> <given-names>D. S.</given-names></name> <name><surname>Arden</surname> <given-names>M. J.</given-names></name></person-group> (<year>1989</year>). <source>The NeWS Book: An Introduction to the Network/Extensible Window System</source>. <publisher-loc>New York, NY</publisher-loc>: <publisher-name>Springer Science &#x00026; Business Media</publisher-name>.</citation></ref>
<ref id="B26"><citation citation-type="book"><collab>Gray v. Novell, Inc</collab>. (<year>2011</year>). <source>United States Court of Appeals, Eleventh Circuit, NO. 09-11374</source>. <publisher-loc>Florida</publisher-loc>.</citation></ref>
<ref id="B27"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Hammer</surname> <given-names>T.</given-names></name> <name><surname>Bauml</surname> <given-names>B.</given-names></name></person-group> (<year>2013</year>). <article-title>&#x0201C;The highly performant and realtime deterministic communication layer of the ardx software framework,&#x0201D;</article-title> in <source>2013 16th International Conference on Advanced Robotics (ICAR)</source> (<publisher-loc>Montevideo</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>1</fpage>&#x02013;<lpage>8</lpage>.</citation></ref>
<ref id="B28"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hanson</surname> <given-names>D. R.</given-names></name></person-group> (<year>1990</year>). <article-title>Fast allocation and deallocation of memory based on object lifetimes</article-title>. <source>Software Pract. Exp.</source> <volume>20</volume>, <fpage>5</fpage>&#x02013;<lpage>12</lpage>.</citation></ref>
<ref id="B29"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Holzmann</surname> <given-names>G.</given-names></name></person-group> (<year>2004</year>). <source>The Spin Model Checker</source>. <publisher-loc>Boston, MA</publisher-loc>: <publisher-name>Addison Wesley</publisher-name>.</citation></ref>
<ref id="B30"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Huang</surname> <given-names>A. S.</given-names></name> <name><surname>Olson</surname> <given-names>E.</given-names></name> <name><surname>Moore</surname> <given-names>D. C.</given-names></name></person-group> (<year>2010</year>). <article-title>&#x0201C;LCM: Lightweight communications and marshalling,&#x0201D;</article-title> in <source>Intelligent Robots and Systems</source> (<publisher-loc>Taipei</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>4057</fpage>&#x02013;<lpage>4062</lpage>.</citation></ref>
<ref id="B31"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Huston</surname> <given-names>G.</given-names></name></person-group> (<year>2000</year>). <source>Next Steps for the IP QoS Architecture</source>. <publisher-name>Internet Engineering Task Force</publisher-name>. Available at: <uri xlink:href="https://tools.ietf.org/html/rfc2990">https://tools.ietf.org/html/rfc2990</uri></citation></ref>
<ref id="B32"><citation citation-type="book"><collab>ISO 11898-1:2015</collab>. (<year>2015</year>). <source>Road Vehicles &#x02013; Controller Area Network (CAN) &#x02013; Part 1: Data Link Layer and Physical Signalling</source>, <edition>2 Edn</edition>. <publisher-name>ISO</publisher-name>. Available at: <uri xlink:href="http://www.iso.org/iso/catalogue_detail.htm?csnumber&#x0003D;63648">http://www.iso.org/iso/catalogue_detail.htm?csnumber&#x0003D;63648</uri></citation></ref>
<ref id="B33"><citation citation-type="book"><collab>ISO/IEC 9899:1999</collab>. (<year>1999</year>). <source>Programming Languages &#x02013; C</source>, <edition>2 Edn</edition>. <publisher-name>ISO/IEC</publisher-name>. Available at: <uri xlink:href="http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber&#x0003D;29237">http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber&#x0003D;29237</uri></citation></ref>
<ref id="B34"><citation citation-type="book"><collab>ISO/IEC 9899:2011</collab>. (<year>2011</year>). <source>Programming Languages &#x02013; C</source>, <edition>3 Edn</edition>. <publisher-name>ISO/IEC</publisher-name>. Available at: <uri xlink:href="http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber&#x0003D;57853">http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber&#x0003D;57853</uri></citation></ref>
<ref id="B35"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Johnson</surname> <given-names>M.</given-names></name> <name><surname>Shrewsbury</surname> <given-names>B.</given-names></name> <name><surname>Bertrand</surname> <given-names>S.</given-names></name> <name><surname>Wu</surname> <given-names>T.</given-names></name> <name><surname>Duran</surname> <given-names>D.</given-names></name> <name><surname>Floyd</surname> <given-names>M.</given-names></name> <etal/></person-group> (<year>2015</year>). <article-title>Team IHMC&#x02019;s lessons learned from the DARPA robotics challenge trials</article-title>. <source>J. Field Rob.</source> <volume>32</volume>, <fpage>192</fpage>&#x02013;<lpage>208</lpage>.<pub-id pub-id-type="doi">10.1002/rob.21571</pub-id></citation></ref>
<ref id="B36"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kalibera</surname> <given-names>T.</given-names></name> <name><surname>Pizlo</surname> <given-names>F.</given-names></name> <name><surname>Hosking</surname> <given-names>A. L.</given-names></name> <name><surname>Vitek</surname> <given-names>J.</given-names></name></person-group> (<year>2011</year>). <article-title>Scheduling real-time garbage collection on uniprocessors</article-title>. <source>ACM Trans. Comput. Syst.</source> <volume>29</volume>, <fpage>8</fpage>.<pub-id pub-id-type="doi">10.1145/2003690.2003692</pub-id></citation></ref>
<ref id="B37"><citation citation-type="web"><person-group person-group-type="author"><name><surname>Kegel</surname> <given-names>D.</given-names></name></person-group> (<year>2006</year>). <source>The C10K Problem</source>. Available at: <uri xlink:href="http://www.kegel.com/c10k.html">http://www.kegel.com/c10k.html</uri></citation></ref>
<ref id="B38"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Kerrisk</surname> <given-names>M.</given-names></name></person-group> (<year>2014</year>). <source>aio &#x02013; POSIX Asynchronous I/O Overview</source>, <edition>3.74 Edn</edition>. <publisher-name>Linux Man-Pages</publisher-name>. Available at: <uri xlink:href="https://www.kernel.org/doc/man-pages/">https://www.kernel.org/doc/man-pages/</uri></citation></ref>
<ref id="B39"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Kingston</surname> <given-names>Z. E.</given-names></name> <name><surname>Dantam</surname> <given-names>N. T.</given-names></name> <name><surname>Kavraki</surname> <given-names>L. E.</given-names></name></person-group> (<year>2015</year>). <article-title>&#x0201C;Kinematically constrained workspace control via linear optimization,&#x0201D;</article-title> in <source>International Conference on Humanoid Robots</source> (<publisher-loc>Seoul</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>758</fpage>&#x02013;<lpage>764</lpage>.<pub-id pub-id-type="doi">10.1109/HUMANOIDS.2015.7363455</pub-id></citation></ref>
<ref id="B40"><citation citation-type="web"><person-group person-group-type="author"><name><surname>Lea</surname> <given-names>D.</given-names></name></person-group> (<year>2000</year>). <source>A Memory Allocator</source>. Available at: <uri xlink:href="http://g.oswego.edu/dl/html/malloc.html">http://g.oswego.edu/dl/html/malloc.html</uri></citation></ref>
<ref id="B41"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lee</surname> <given-names>E. A.</given-names></name></person-group> (<year>2009</year>). <article-title>Computing needs time</article-title>. <source>Commun. ACM</source> <volume>52</volume>, <fpage>70</fpage>&#x02013;<lpage>79</lpage>.<pub-id pub-id-type="doi">10.1145/1506409.1506426</pub-id></citation></ref>
<ref id="B42"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lignos</surname> <given-names>C.</given-names></name> <name><surname>Raman</surname> <given-names>V.</given-names></name> <name><surname>Finucane</surname> <given-names>C.</given-names></name> <name><surname>Marcus</surname> <given-names>M.</given-names></name> <name><surname>Kress-Gazit</surname> <given-names>H.</given-names></name></person-group> (<year>2015</year>). <article-title>Provably correct reactive control from natural language</article-title>. <source>Auton. Robots</source> <volume>38</volume>, <fpage>89</fpage>&#x02013;<lpage>105</lpage>.<pub-id pub-id-type="doi">10.1007/s10514-014-9418-8</pub-id></citation></ref>
<ref id="B43"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Linton</surname> <given-names>M.</given-names></name> <name><surname>Price</surname> <given-names>C.</given-names></name></person-group> (<year>1993</year>). <article-title>&#x0201C;Building distributed user interfaces with fresco,&#x0201D;</article-title> in <source>Proceedings of the 7th X Technical Conference</source> (<conf-loc>Boston, MA</conf-loc>: <conf-name>O&#x02019;Reilly</conf-name>), <fpage>77</fpage>&#x02013;<lpage>87</lpage>.</citation></ref>
<ref id="B44"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Liu</surname> <given-names>J.</given-names></name> <name><surname>Ozay</surname> <given-names>N.</given-names></name> <name><surname>Topcu</surname> <given-names>U.</given-names></name> <name><surname>Murray</surname> <given-names>R. M.</given-names></name></person-group> (<year>2013</year>). <article-title>Synthesis of reactive switching protocols from temporal logic specifications</article-title>. <source>Trans. Autom. Control</source> <volume>58</volume>, <fpage>1771</fpage>&#x02013;<lpage>1785</lpage>.<pub-id pub-id-type="doi">10.1109/TAC.2013.2246095</pub-id></citation></ref>
<ref id="B45"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Masmano</surname> <given-names>M.</given-names></name> <name><surname>Ripoll</surname> <given-names>I.</given-names></name> <name><surname>Crespo</surname> <given-names>A.</given-names></name> <name><surname>Real</surname> <given-names>J.</given-names></name></person-group> (<year>2004</year>). <article-title>&#x0201C;TLSF: a new dynamic memory allocator for real-time systems,&#x0201D;</article-title> in <source>Euromicro Conference on Real-Time Systems</source> (<publisher-loc>Catania</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>79</fpage>&#x02013;<lpage>88</lpage>.</citation></ref>
<ref id="B46"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Metta</surname> <given-names>G.</given-names></name> <name><surname>Fitzpatrick</surname> <given-names>P.</given-names></name> <name><surname>Natale</surname> <given-names>L.</given-names></name></person-group> (<year>2006</year>). <article-title>YARP: yet another robot platform</article-title>. <source>Int. J. Adv. Rob. Syst.</source> <volume>3</volume>, <fpage>43</fpage>&#x02013;<lpage>48</lpage>.<pub-id pub-id-type="doi">10.5772/5761</pub-id></citation></ref>
<ref id="B47"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Nedunuri</surname> <given-names>S.</given-names></name> <name><surname>Prabhu</surname> <given-names>S.</given-names></name> <name><surname>Moll</surname> <given-names>M.</given-names></name> <name><surname>Chaudhuri</surname> <given-names>S.</given-names></name> <name><surname>Kavraki</surname> <given-names>L. E.</given-names></name></person-group> (<year>2014</year>). <article-title>&#x0201C;SMT-based synthesis of integrated task and motion plans from plan outlines,&#x0201D;</article-title> in <source>International Conference on Robotics and Automation</source> (<publisher-loc>Hong Kong</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>655</fpage>&#x02013;<lpage>662</lpage>.</citation></ref>
<ref id="B48"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Paikan</surname> <given-names>A.</given-names></name> <name><surname>Pattacini</surname> <given-names>U.</given-names></name> <name><surname>Domenichelli</surname> <given-names>D.</given-names></name> <name><surname>Randazzo</surname> <given-names>M.</given-names></name> <name><surname>Metta</surname> <given-names>G.</given-names></name> <name><surname>Natale</surname> <given-names>L.</given-names></name></person-group> (<year>2015</year>). <article-title>&#x0201C;A best-effort approach for run-time channel prioritization in real-time robotic application,&#x0201D;</article-title> in <source>2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)</source> (<publisher-loc>Hamburg</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>1799</fpage>&#x02013;<lpage>1805</lpage>.</citation></ref>
<ref id="B49"><citation citation-type="web"><collab>pkg-config</collab>. (<year>2013</year>). <source>pkg-config</source>. Available at: <uri xlink:href="http://www.freedesktop.org/wiki/Software/pkg-config/">http://www.freedesktop.org/wiki/Software/pkg-config/</uri></citation></ref>
<ref id="B50"><citation citation-type="web"><person-group person-group-type="author"><name><surname>Poettering</surname> <given-names>L.</given-names></name></person-group> (<year>2014</year>). <source>Revisiting How We Put Together Linux Systems</source>. Available at: <uri xlink:href="http://0pointer.net/blog/revisiting-how-we-put-together-linux-systems.html">http://0pointer.net/blog/revisiting-how-we-put-together-linux-systems.html</uri></citation></ref>
<ref id="B51"><citation citation-type="book"><collab>POSIX</collab>. (<year>2008</year>). <source>IEEE Std 1003.1-2008</source>. <publisher-name>The IEEE and The Open Group</publisher-name>. Available at: <uri xlink:href="http://pubs.opengroup.org/onlinepubs/9699919799/">http://pubs.opengroup.org/onlinepubs/9699919799/</uri></citation></ref>
<ref id="B52"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Quarterman</surname> <given-names>J. S.</given-names></name> <name><surname>Silberschatz</surname> <given-names>A.</given-names></name> <name><surname>Peterson</surname> <given-names>J. L.</given-names></name></person-group> (<year>1985</year>). <article-title>4.2 BSD and 4.3 BSD as examples of the UNIX system</article-title>. <source>ACM Comput. Surv. (CSUR)</source> <volume>17</volume>, <fpage>379</fpage>&#x02013;<lpage>418</lpage>.<pub-id pub-id-type="doi">10.1145/6041.6043</pub-id></citation></ref>
<ref id="B53"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Quigley</surname> <given-names>M.</given-names></name> <name><surname>Gerkey</surname> <given-names>B.</given-names></name> <name><surname>Conley</surname> <given-names>K.</given-names></name> <name><surname>Faust</surname> <given-names>J.</given-names></name> <name><surname>Foote</surname> <given-names>T.</given-names></name> <name><surname>Leibs</surname> <given-names>J.</given-names></name> <etal/></person-group> (<year>2009</year>). <article-title>&#x0201C;ROS: an open-source robot operating system,&#x0201D;</article-title> in <source>International Conference on Robotics and Automation, Workshop on Open Source Robotics</source> (<publisher-loc>Kobe</publisher-loc>: <publisher-name>IEEE</publisher-name>).</citation></ref>
<ref id="B54"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Raymond</surname> <given-names>E. S.</given-names></name></person-group> (<year>2003</year>). <source>The art of Unix Programming</source>. <publisher-loc>Boston, MA</publisher-loc>: <publisher-name>Addison-Wesley Professional</publisher-name>.</citation></ref>
<ref id="B55"><citation citation-type="web"><person-group person-group-type="author"><name><surname>Raymond</surname> <given-names>E. S.</given-names></name> <name><surname>Landley</surname> <given-names>R.</given-names></name></person-group> (<year>2008</year>). <source>OSI Position Paper on the SCO vs. IBM Complaint</source>. Available at: <uri xlink:href="http://www.catb.org/&#x0007E;esr/hackerlore/sco-vs-ibm.html">http://www.catb.org/&#x0007E;esr/hackerlore/sco-vs-ibm.html</uri></citation></ref>
<ref id="B56"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Rosenbaum</surname> <given-names>R.</given-names></name></person-group> (<year>1993</year>). <source>Using the Domain Name System To Store Arbitrary String Attributes</source>. <publisher-name>Internet Engineering Task Force</publisher-name>. Available at: <uri xlink:href="https://tools.ietf.org/html/rfc1464">https://tools.ietf.org/html/rfc1464</uri></citation></ref>
<ref id="B57"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Scheifler</surname> <given-names>R. W.</given-names></name></person-group> (<year>2004</year>). <source>X Window System Protocol</source>. <publisher-name>X Consortium, Inc</publisher-name>. Available at: <uri xlink:href="http://www.x.org/archive/X11R7.5/doc/x11proto/proto.pdf">http://www.x.org/archive/X11R7.5/doc/x11proto/proto.pdf</uri></citation></ref>
<ref id="B58"><citation citation-type="web"><person-group person-group-type="author"><name><surname>Siemon</surname> <given-names>D.</given-names></name></person-group> (<year>2013</year>). <article-title>Queueing in the linux network stack</article-title>. <source>Linux J.</source> Available at: <uri xlink:href="http://www.linuxjournal.com/content/queueing-linux-network-stack">http://www.linuxjournal.com/content/queueing-linux-network-stack</uri></citation></ref>
<ref id="B59"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Silberschatz</surname> <given-names>A.</given-names></name> <name><surname>Galvin</surname> <given-names>P. B.</given-names></name> <name><surname>Gagne</surname> <given-names>G.</given-names></name></person-group> (<year>2009</year>). <source>Operating System Concepts</source>. <publisher-loc>Danvers, MA</publisher-loc>: <publisher-name>J. Wiley &#x00026; Sons</publisher-name>.</citation></ref>
<ref id="B60"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Smith</surname> <given-names>J.</given-names></name> <name><surname>Stephen</surname> <given-names>D.</given-names></name> <name><surname>Lesman</surname> <given-names>A.</given-names></name> <name><surname>Pratt</surname> <given-names>J.</given-names></name></person-group> (<year>2014</year>). <article-title>&#x0201C;Real-time control of humanoid robots using OpenJDK,&#x0201D;</article-title> in <source>International Workshop on Java Technologies for Real-time and Embedded Systems</source> (<publisher-loc>Niagara Falls, NY</publisher-loc>: <publisher-name>ACM</publisher-name>), <fpage>29</fpage>.</citation></ref>
<ref id="B61"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Srinivasan</surname> <given-names>R.</given-names></name></person-group> (<year>1995</year>). <source>Binding Protocols for ONC RPC Version 2</source>. <publisher-name>Internet Engineering Task Force</publisher-name>. Available at: <uri xlink:href="https://tools.ietf.org/html/rfc1833">https://tools.ietf.org/html/rfc1833</uri></citation></ref>
<ref id="B62"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Stevens</surname> <given-names>W. R.</given-names></name> <name><surname>Rago</surname> <given-names>S. A.</given-names></name></person-group> (<year>2013</year>). <source>Advanced Programming in the UNIX Environment</source>. <publisher-loc>Indianapolis</publisher-loc>: <publisher-name>Addison-Wesley</publisher-name>.</citation></ref>
<ref id="B63"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sucan</surname> <given-names>I.</given-names></name> <name><surname>Moll</surname> <given-names>M.</given-names></name> <name><surname>Kavraki</surname> <given-names>L. E.</given-names></name></person-group> (<year>2012</year>). <article-title>The open motion planning library</article-title>. <source>Rob. Autom. Mag.</source> <volume>19</volume>, <fpage>72</fpage>&#x02013;<lpage>82</lpage>.<pub-id pub-id-type="doi">10.1109/MRA.2012.2205651</pub-id></citation></ref>
<ref id="B64"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Tanenbaum</surname> <given-names>A. S.</given-names></name> <name><surname>Bos</surname> <given-names>H.</given-names></name></person-group> (<year>2014</year>). <source>Modern Operating Systems</source>. <publisher-loc>Upper Saddle River, NJ</publisher-loc>: <publisher-name>Prentice Hall Press</publisher-name>.</citation></ref>
<ref id="B65"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Thomas</surname> <given-names>M.</given-names></name></person-group>, <person-group person-group-type="author"><name><surname>Lupu</surname> <given-names>E.</given-names></name></person-group>, and <person-group person-group-type="author"><name><surname>R&#x000FC;kert</surname> <given-names>D.</given-names></name></person-group> (<year>2003</year>). <source>Y: A Successor to the x Window System</source>. <publisher-name>Technical Report, Imperial College London</publisher-name>. Available at: <uri xlink:href="http://www3.imperial.ac.uk/pls/portallive/docs/1/18619743.PDF">http://www3.imperial.ac.uk/pls/portallive/docs/1/18619743.PDF</uri></citation></ref>
<ref id="B66"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Wang</surname> <given-names>Y.</given-names></name> <name><surname>Lafortune</surname> <given-names>S.</given-names></name> <name><surname>Kelly</surname> <given-names>T.</given-names></name> <name><surname>Kudlur</surname> <given-names>M.</given-names></name> <name><surname>Mahlke</surname> <given-names>S.</given-names></name></person-group> (<year>2009</year>). <article-title>&#x0201C;The theory of deadlock avoidance via discrete control,&#x0201D;</article-title> in <source>SIGPLAN Notices</source>, Vol. <volume>44</volume> (<publisher-loc>Savannah</publisher-loc>: <publisher-name>ACM</publisher-name>), <fpage>252</fpage>&#x02013;<lpage>263</lpage>.</citation></ref>
<ref id="B67"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yuasa</surname> <given-names>T.</given-names></name></person-group> (<year>1990</year>). <article-title>Real-time garbage collection on general-purpose machines</article-title>. <source>J. Syst. Software</source> <volume>11</volume>, <fpage>181</fpage>&#x02013;<lpage>198</lpage>.<pub-id pub-id-type="doi">10.1016/0164-1212(90)90084-Y</pub-id></citation></ref>
<ref id="B68"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zucker</surname> <given-names>M.</given-names></name> <name><surname>Joo</surname> <given-names>S.</given-names></name> <name><surname>Grey</surname> <given-names>M. X.</given-names></name> <name><surname>Rasmussen</surname> <given-names>C.</given-names></name> <name><surname>Huang</surname> <given-names>E.</given-names></name> <name><surname>Stilman</surname> <given-names>M.</given-names></name> <etal/></person-group> (<year>2015</year>). <article-title>A general-purpose system for teleoperation of the DRC-HUBO humanoid robot</article-title>. <source>J. Field Rob.</source> <volume>32</volume>, <fpage>336</fpage>&#x02013;<lpage>351</lpage>.<pub-id pub-id-type="doi">10.1002/rob.21570</pub-id></citation></ref>
</ref-list>
<app-group>
<app id="A1">
<title>Appendix</title>
<sec id="S7">
<title>A. Ach Multiplexing Example</title>
<p>Ach kernel channels can be multiplexed using the conventional <monospace>select</monospace>, <monospace>poll</monospace>, etc. functions. We provide an example program that multiplexes two Ach channels along with the program&#x02019;s standard input and echoes all data to standard output. This example demonstrates Ach&#x02019;s efficient handling of multiple data sources and compatibility with other forms of POSIX communication.</p>
<p><inline-graphic xlink:href="frobt-03-00006-i001a.tif"/></p>
<p><inline-graphic xlink:href="frobt-03-00006-i001b.tif"/></p>
</sec>
<sec id="S8">
<title>B. Configuration, Building, and Packaging</title>
<p>Software build systems and package managers are useful tools to address the system integration needs of humanoid robot software. Open source software distributions such as Debian and FreeBSD have developed approaches for integrating and maintaining enormous numbers of software packages. Their goal is to make software that is portable, that builds robustly, and that is easy to install, upgrade, and remove. These tools are general and suited to the needs of humanoids as well.</p>
<p>Different humanoid robots provide varying hardware capabilities and software environments, and it is important that humanoid software be adaptable across these different robots. A key step to achieving this portability is the <italic>configuration</italic> step of the build process, where the software adapts to conditions of the environment in which it must run. For example, configuration may determine whether to use the previously mentioned <monospace>epoll</monospace> or <monospace>kqueue</monospace> calls depending on whether it must run on Linux or FreeBSD, or it may determine how to interface with the fieldbus linking the robot&#x02019;s embedded electronics. In general, configuration chooses alternate implementations or optional components to build based on the available features of the host system. This adaptability is vital to building software that is portable and that builds robustly.</p>
<p>The two predominant build systems are the GNU Autotools and CMake. Overall, both offer similar capabilities with a number of superficial differences. There is, however, a difference in design philosophy that influences the use of these systems. Autotools assumes little about the host platform beyond a POSIX shell, testing at compile-time for essentially every other feature, an approach that is robust to new and changing platforms but requires additional time for the feature tests. In contrast, CMake maintains a database of modules for platforms and libraries, which can reduce compilation time by omitting feature tests but is unhelpful for differing platforms and dependencies. One can also maintain a build-system agnostic database of available libraries using pkg-config (pkg-config, <xref ref-type="bibr" rid="B49">2013</xref>), which works with CMake, Autotools, and other build systems. Additionally, projects using Autotools generally follow a strict set of conventions such that all can be configured, built, and installed by the same procedure (GNU Standards, <xref ref-type="bibr" rid="B24">2015</xref>). There are fewer established conventions for CMake so it is common for different CMake projects to require different steps in the build process. One should consider the need for adaptability, conformity, and configuration performance when selecting a build system.</p>
<p>We use Autotools to build Ach due to their maturity and strict conventions compared to CMake. In addition, Autotools enable more direct integration with the Make-based build system of the Linux kernel, which simplifies building and installing the Ach Linux kernel module (see Section <xref ref-type="sec" rid="S3-2">3.2</xref>).</p>
<p>To manage the large number of software packages on humanoid robots, package managers are an invaluable tool. Package managers handle the details of installation, cross-package dependencies, and package versioning. The two main styles of package managers are binary-based and source-based. Binary-based package managers download and install pre-compiled packages. Examples include Redhat&#x02019;s RPM, Debian&#x02019;s APT, and &#x02013; if viewed broadly &#x02013; &#x0201C;App Stores&#x0201D; such as that of Apple&#x02019;s iOS and Google Play. Source-based package managers download package source code and build it on the local machine. Examples include FreeBSD ports, Gentoo Portage, and Homebrew for MacOSX. The advantage of binary packages is that no time must be spent to compile the package on the local machine. The advantage of source-based package managers is that packages can be custom-configured with optional features based on the users preferences and fewer server resources are required to store the compiled binaries. The choice of a package manager is typically dictated by the operating system distribution of the user. For handling software deployment, these package managers are mature and useful tools.</p>
<p>Two new data storage tools offer the potential to improve existing build systems and package managers: distributed revision control &#x02013; e.g., git and mercurial &#x02013; and copy-on-write (COW) filesystems &#x02013; e.g., ZFS and BTRFS. Existing build systems and package managers were developed at a time when source code was typically downloaded as tarballs from a scattered collection of servers. Today, source code is often downloaded via a distributed version control system. Directly accessing the revision controlled files is a poor fit for Autotools&#x02019; approach of generating a portable configuration script, and it makes some features of current package managers redundant, such as hosting and distributing multiple tarball versions and applying patches before building. Second, COW filesystems provide the capability to make cheap, writable snapshots. This could be used to maintain multiple concurrent images of the operating system, for example to install different versions of one package or two different conflicting packages. One view on how these new tools could change build systems and packages managers is given by Poettering (<xref ref-type="bibr" rid="B50">2014</xref>). These new developments show that while existing build systems and package managers are useful and mature, there is room for ongoing development and new innovation.</p>
<p>ROS (Quigley et al., <xref ref-type="bibr" rid="B53">2009</xref>) provides a different view on build systems and package management, focusing on robots. ROS combines the build system and package manager into a single framework based on CMake (Catkin, <xref ref-type="bibr" rid="B6">2015</xref>); however, binary packages are still distributed using the existing APT package manager. This approach eliminates some duplication of metadata &#x02013; i.e., which files must be installed &#x02013; necessary with the traditional distinction between package managers and build systems. However, this is unhelpful if packages are to be installed on a non-ROS system. Additionally, packages are also constrained to use the given CMake-based build system which may not always be the best fit, e.g., for non-C/C&#x0002B;&#x0002B; packages, or provide necessary capabilities, e.g., the site-based configuration feature of Autotools. Still, ROS presents an interesting take on how we build and package software.</p>
</sec>
</app>
</app-group>
<fn-group>
<fn id="fn1"><p><sup>1</sup>Historically, the capitalized, trademarked &#x0201C;Unix&#x02122;&#x0201D; referred to operating systems based on the original code from AT&#x00026;T Bell Laboratories, while the terms &#x0201C;unix-like,&#x0201D; the lower-cased &#x0201C;unix,&#x0201D; and the wildcards &#x0201C;un&#x0002A;x,&#x0201D; &#x0201C;&#x0002A;nix,&#x0201D; etc. conventionally refer to the larger family of similar, often independently developed operating systems (Raymond, 2008). Currently, Unix&#x02122; is a trademark of The Open Group, which licenses the brand to certified, conforming operating systems (Gray v. Novell, 2011).</p></fn>
<fn id="fn2"><p><sup>2</sup><uri xlink:href="http://nginx.org/">http://nginx.org/</uri></p></fn>
<fn id="fn3"><p><sup>3</sup><uri xlink:href="http://libevent.org/">http://libevent.org/</uri></p></fn>
<fn id="fn4"><p><sup>4</sup>Benchmark code available at <uri xlink:href="http://github.com/golems/ach">http://github.com/golems/ach</uri></p></fn>
</fn-group>
</back>
</article>