<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Archiving and Interchange DTD v2.3 20070202//EN" "archivearticle.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="data-paper">
<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.2017.00073</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Robotics and AI</subject>
<subj-group>
<subject>Code</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>The Event-Driven Software Library for YARP&#x02014;With Algorithms and iCub Applications</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name><surname>Glover</surname> <given-names>Arren</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/269413"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Vasco</surname> <given-names>Valentina</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<uri xlink:href="http://frontiersin.org/people/u/270549"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Iacono</surname> <given-names>Massimiliano</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<uri xlink:href="http://frontiersin.org/people/u/509776"/>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name><surname>Bartolozzi</surname> <given-names>Chiara</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/21102"/>
</contrib>
</contrib-group>
<aff id="aff1"><sup>1</sup><institution>iCub Facility, Istituto Italiano di Tecnologia</institution>, <addr-line>Genova</addr-line>, <country>Italy</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Lorenzo Jamone, Queen Mary University of London, United Kingdom</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Garrick Orchard, National University of Singapore, Singapore; Hanme Kim, Imperial College London, United Kingdom</p></fn>
<corresp content-type="corresp" id="cor1">&#x0002A;Correspondence: Arren Glover, <email>arren.glover&#x00040;iit.it</email>; Chiara Bartolozzi, <email>chiara.bartolozzi&#x00040;iit.it</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>16</day>
<month>01</month>
<year>2018</year>
</pub-date>
<pub-date pub-type="collection">
<year>2017</year>
</pub-date>
<volume>4</volume>
<elocation-id>73</elocation-id>
<history>
<date date-type="received">
<day>26</day>
<month>07</month>
<year>2017</year>
</date>
<date date-type="accepted">
<day>12</day>
<month>12</month>
<year>2017</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2018 Glover, Vasco, Iacono and Bartolozzi.</copyright-statement>
<copyright-year>2018</copyright-year>
<copyright-holder>Glover, Vasco, Iacono and Bartolozzi</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>Event-driven (ED) cameras are an emerging technology that sample the visual signal based on changes in the signal magnitude, rather than at a fixed-rate over time. The change in paradigm results in a camera with a lower latency, that uses less power, has reduced bandwidth, and higher dynamic range. Such cameras offer many potential advantages for on-line, autonomous, robots; however, the sensor data do not directly integrate with current &#x0201C;image-based&#x0201D; frameworks and software libraries. The iCub robot uses Yet Another Robot Platform (YARP) as middleware to provide modular processing and connectivity to sensors and actuators. This paper introduces a library that incorporates an event-based framework into the YARP architecture, allowing event cameras to be used with the iCub (and other YARP-based) robots. We describe the philosophy and methods for structuring <italic>events</italic> to facilitate processing, while maintaining low-latency and real-time operation. We also describe several processing modules made available open-source, and three example demonstrations that can be run on the neuromorphic iCub.</p>
</abstract>
<kwd-group>
<kwd>iCub</kwd>
<kwd>neuromorphic engineering</kwd>
<kwd>event-driven vision</kwd>
<kwd>software</kwd>
<kwd>humanoid robotics</kwd>
</kwd-group>
<contract-num rid="cn01">231467, 284553</contract-num>
<contract-sponsor id="cn01">Seventh Framework Programme<named-content content-type="fundref-id">10.13039/100011102</named-content></contract-sponsor>
<counts>
<fig-count count="5"/>
<table-count count="0"/>
<equation-count count="0"/>
<ref-count count="23"/>
<page-count count="7"/>
<word-count count="4361"/>
</counts>
</article-meta>
</front>
<body>
<sec id="S1" sec-type="introduction">
<label>1</label> <title>Introduction</title>
<p>Conventional vision sensors used in robotics rely on the acquisition of sequences of static images at fixed temporal intervals. Such a sensor provides the most information when the temporal dynamics of the scene match the sample-rate. If the dynamics are slower (e.g., a mostly static scene), only a small percentage of pixels change between two consecutive frames, leading to redundant acquisition and processing. Alternatively, if the scene dynamics are much faster (e.g., a falling object), information between images can be distorted by motion blur, or missed entirely.</p>
<p>A newly emerging technology, &#x0201C;event-driven&#x0201D; (ED) cameras, are vision sensors that produce digital &#x0201C;events&#x0201D; only when the amount of light falling on a pixel changes. The result is that the cameras detect only contrast changes (Lichtsteiner et al., <xref ref-type="bibr" rid="B11">2008</xref>) that occur due to the relative motion between the environment and the sensor. There is no fixed sampling rate over time, instead, the sensor adapts to the scene dynamics. Redundant data are simply not produced in slow dynamic scenes, and the sensor output still manages to finely trace the movement of any fast stimuli. Specifically, the camera hardware latency is only 15&#x02009;&#x003BC;s (Lichtsteiner et al., <xref ref-type="bibr" rid="B11">2008</xref>) and the temporal resolution at which an event can be timestamped is under 1&#x02009;&#x003BC;s. Events are also produced asynchronously for each pixel, such that processing operations can start without the need to read the entire sensor array, and a low-latency processing pipeline can be realized.</p>
<p>ED cameras provide many potential advantages for robotics applications. The removal of redundant processing can give mobile robots longer operating times and frees computational resources for other tasks. Fast-moving stimuli can always be detected, and visual dynamics estimated with more accuracy than with conventionally available cameras. This low-latency can enable extremely fast reaction times between environmental change and the response of the robot. In addition, each pixel has a high dynamic range (143&#x02009;dB (Posch et al., <xref ref-type="bibr" rid="B16">2011</xref>)) which allows robots to operate in both bright and dark environments, and in conditions with widely varying intra-scene lighting. The sensor is low-power, promoting longer operation times for untethered mobile robots.</p>
<p>The <italic>neuromorphic iCub</italic> (Bartolozzi et al., <xref ref-type="bibr" rid="B1">2011</xref>) is a humanoid robot that has a vision system comprised of two event cameras. The iCub robot is supported, in software, by the Yet Another Robot Platform (YARP) middleware (Metta et al., <xref ref-type="bibr" rid="B12">2006</xref>), upon which the iCub low-level and application-level modules have matured using standard cameras, and also utilized other freely available algorithms (e.g., using OpenCV). However, due to the asynchronous nature of the event-stream, and its fundamental differences from 2D frame sequences (see Figure <xref ref-type="fig" rid="F1">1</xref>), traditional computer vision algorithms and image processing frameworks cannot be directly applied.</p>
<fig id="F1" position="float">
<label>Figure 1</label>
<caption><p>The <bold>(A)</bold> iCub robot performing ball tracking and gazing toward the ball position and <bold>(B)</bold> the corresponding stream of events over time superimposed with approximate frame-captures for a hypothetical 10&#x02009;Hz frame-based camera.</p></caption>
<graphic xlink:href="frobt-04-00073-g001.tif"/>
</fig>
<p>This paper introduces the event-driven software libraries and infrastructure that is built upon YARP and integrates with the iCub robot. The library takes advantage of the YARP framework, which enables the distributed processing of events within multiple interchangeable modules spread across multiple networked machines. Modules include pre-processing utilities, visualization, low-level event-driven vision processing algorithms (e.g., corner detection), and robot behavior applications. These modules can be run and used by anyone for purely vision-based tasks, without the need for an iCub robot by using: pre-recorded datasets, a &#x0201C;stand-alone&#x0201D; camera with a compatible FPGA, a &#x0201C;stand-alone&#x0201D; camera with the compatible USB connection, or by contributing a custom camera interface to the open-source library. As the processing is modular, the exact method of event acquisition is transparent to the remainder of the library. This paper also describes several iCub applications that have been built upon the ED cameras and library and highlights some recent experimental results. We begin with a brief description of the current state-of-the-art in ED vision for robotics.</p>
</sec>
<sec id="S2">
<label>2</label> <title>Event-Driven Vision for Robots</title>
<p>Recent work using event cameras show promising results for fast, low-latency robotic vision. The latency of an event-based visual attention was two order less than frame-based one (Rea et al., <xref ref-type="bibr" rid="B17">2013</xref>). Recognition of playing-card suit was achieved as a deck was flicked through (30&#x02009;ms exposure) (Serrano-Gotarredona and Linares-Barranco, <xref ref-type="bibr" rid="B20">2015</xref>). Detection of a moving ball by a moving robot was achieved at rates of over 500&#x02009;Hz (Glover and Bartolozzi, <xref ref-type="bibr" rid="B6">2016</xref>). Visual tracking of features was shown at a rate higher than standard cameras (Vasco et al., <xref ref-type="bibr" rid="B22">2016a</xref>) and also features position could be updated &#x0201C;between frames&#x0201D; of a standard camera (Kueng et al., <xref ref-type="bibr" rid="B10">2016</xref>).</p>
<p>The extreme low-latency of event cameras enabled fast close-loop control (e.g., inverse pendulum balancing (Conradt et al., <xref ref-type="bibr" rid="B3">2009</xref>) and goal keeping with 3&#x02009;ms reaction time and only 4% CPU utilization (Delbruck and Lang, <xref ref-type="bibr" rid="B5">2013</xref>)). High-frequency visual feedback (&#x0003E;1&#x02009;kHz) enabled stable manipulator control at micrometer scale (Ni et al., <xref ref-type="bibr" rid="B15">2012</xref>). On-board pose estimation during flips and rolls of a quadrotor has been shown to be plausible using event-driven vision (Mueggler et al., <xref ref-type="bibr" rid="B14">2015</xref>). Finally, robotic navigation and mapping systems include a real-time 2-DOF SLAM system for a mobile robot (Hoffmann et al., <xref ref-type="bibr" rid="B8">2013</xref>), and 6-DOF parallel tracking and mapping algorithms (Kim et al., <xref ref-type="bibr" rid="B9">2016</xref>; Rebecq et al., <xref ref-type="bibr" rid="B18">2016</xref>).</p>
<p>Some of the above experiments used the Java-based jAER (Delbruck, <xref ref-type="bibr" rid="B4">2008</xref>); however, Java is typically less suited to on-line robotics due to computational overheads. jAER is also designed to process events from a camera directly connected to a single machine; however, robotics platforms have come to rely on a middleware that distributes processing over a computer network. A middleware allows the modular connection of sensors, algorithms and controls, which are shared within the robotics community to more quickly advance the state-of-the-art. Perhaps the most well known is the Robot Operating System (ROS), in which some support for event cameras has been made available.<xref ref-type="fn" rid="fn1"><sup>1</sup></xref> In this paper, we present the open-source libraries for event camera integration with the YARP middleware that is used on iCub.</p>
</sec>
<sec id="S3">
<label>3</label> <title>The Event-Driven Library</title>
<p>ED cameras encode information as a stream of asynchronous events with sub-&#x003BC;s resolution. When a pixel detects an illumination change beyond a threshold, it emits a digital pulse that can be assigned a timestamp and pixel address (using Address Event Representation (AER) (Mortara, <xref ref-type="bibr" rid="B13">1998</xref>)) by a clock-based digital interface (e.g., FPGA or microcontroller). The entire visual information is, therefore, encoded within the relative timing and pixel position between events. An example event-stream is shown in Figure <xref ref-type="fig" rid="F1">1</xref>.</p>
<p>This event-driven library is designed to read events from the cameras, interface to communications for distributed processing, and provide event-based visual processing algorithms toward low-latency robotic vision. The library is written in C&#x0002B;&#x0002B;, uses the <monospace>ev</monospace> namespace, and is integrated with the YARP middleware.</p>
<sec id="S3-1">
<label>3.1</label> <title>Representing an Event</title>
<p>The basic element representing an event is a <monospace>ev::vEvent</monospace>, which only stores the timestamp, i.e., <italic>when</italic> an event occurred. The information about <italic>what</italic> occurred is instead stored in the member variables of classes that are inherited from a <monospace>ev::vEvent</monospace>, see Figure <xref ref-type="fig" rid="F2">2</xref>. Events produced by the event cameras are called <monospace>ev::AddressEvent</monospace>, which consist of pixel location (x,y) and pixel polarity (p: darker/lighter) in addition to the camera channel (c: left/right). Algorithmic processing of events can be used to append additional information to an event, such as adding the velocity from an optical-flow algorithm. Currently used additional event-types include optical-flow events (<monospace>ev::FlowEvent</monospace>), class-labeled events (<monospace>ev::LabelledAE</monospace>), and events with a spatial distribution (<monospace>ev::GaussianAE</monospace>).</p>
<fig id="F2" position="float">
<label>Figure 2</label>
<caption><p>Event-types and inheritance, purple/dashed boxes show possible additions to the library to support the integration of other sensory modalities and information from additional computing modules.</p></caption>
<graphic xlink:href="frobt-04-00073-g002.tif"/>
</fig>
<p>An instantiated <monospace>ev::vEvent</monospace> is wrapped in a C&#x0002B;&#x0002B;11 <monospace>shared_ptr</monospace> such that memory is automatically managed, and events can be referenced in multiple threaded environments without duplicated memory allocation. The event-driven library provides a set of wrapper functions to ensure the <monospace>shared_ptr</monospace>s are correctly handled (see Listing <xref ref-type="fig" rid="F4">1</xref>).</p>
<fig position="float" id="F4">
<label>Listing 1</label>
<caption><p>Instantiating events using shared pointer wrappers and dynamic casting. The outcome of the code-snippet will be the allocation of <monospace>v1</monospace> as an <monospace>ev</monospace><bold><monospace>:</monospace></bold><monospace>:AddressEvent</monospace> and (an identical) <monospace>v2</monospace> as a <monospace>ev</monospace><bold><monospace>:</monospace></bold><monospace>:labelledAE</monospace>, while <monospace>v3</monospace> and <monospace>v4</monospace> will be pointers to <monospace>v2</monospace>, but interpreted as <monospace>ev</monospace><bold><monospace>:</monospace></bold><monospace>:AddressEvent</monospace>s.</p></caption>
<graphic xlink:href="frobt-04-00073-g004.tif"/>
</fig>
<p>These event-types can be easily extended through inheritance, and by defining the required additional member variables. Packet encoding and decoding methods are also required for transmission (described below). The framework is designed to be fully future compatible with the integration of different event-driven sensors (e.g., tactile and audio) by extending the base <monospace>ev::vEvent</monospace> class.</p>
</sec>
<sec id="S3-2">
<label>3.2</label> <title>Event-Packets in YARP</title>
<p>On the iCub robot, a Linux driver reads the events from the camera FPGA interface and the <monospace>zynqGrabber</monospace> module exposes the data on a YARP port. A packet of events is sent in a <monospace>ev::vBottle</monospace> (a specialized type of <monospace>yarp::os::Bottle</monospace>) such that the bit-coding of the AER is preserved: to retain data-compression and compatibility with other AER-based hardware. A module that receives a <monospace>ev::vBottle</monospace> can decode the AER and instantiate a <monospace>ev::vEvent</monospace> easily, as event decoding is provided by each event class. Encoding/decoding typically involves bit-shifts and a typecast to interpret a specific range of bits as the correct data type. The decoded events are stored in a <monospace>ev::vQueue</monospace> which wraps a <monospace>std::deque</monospace>&#x0003C;<monospace>event</monospace>&#x0003C;<monospace>vEvent</monospace>&#x0003E;&#x0003E;. The procedure to obtain the event-stream is, therefore, transparent to the processing module. Reading <monospace>ev::vBottle</monospace> from a port is typically done using callback functionality (i.e., only where data is present) as the event-stream is asynchronous. An example code-snippet is provided <bold>in</bold> Listing <xref ref-type="fig" rid="F5">2</xref>.</p>
<fig position="float" id="F5">
<label>Listing 2</label>
<caption><p>An example class for reading, decoding, and structuring events. This code will produce a small &#x0201C;surface&#x0201D; of events decoded from the AER representation automatically using the <monospace>ev</monospace><bold><monospace>:</monospace></bold><monospace>:vBottle</monospace><bold><monospace>:</monospace></bold><monospace>:get()</monospace> command, and the <monospace>ev</monospace><bold><monospace>:</monospace></bold><monospace>:vBottle</monospace> is read asynchronously as the packets arrive.</p></caption>
<graphic xlink:href="frobt-04-00073-g005.tif"/>
</fig>
<p>Events can be saved and loaded from a file using the standard tools in YARP as an event-packet is fully interpretable as a standard <monospace>yarp::os::Bottle</monospace>. Therefore, it is easy to save a dataset using the <monospace>yarpdatadumper</monospace> and replay it using the <monospace>yarpdataplayer</monospace>. This is done externally to the event-driven library, simply by connecting the event-stream to/from the aforementioned modules using YARP connections.</p>
</sec>
<sec id="S3-3">
<label>3.3</label> <title>Structuring the Event-Stream</title>
<p>The desired approach to ED processing is to perform a small, lightweight computation as each event is received; however, a single event (a single pixel) does not provide sufficient information on its own for many complex visual algorithms. Often it is necessary to store a sequence of events in order to extract useful information from their spatiotemporal structure. The type of structure used depends on the conditions, limitations and assumptions of the task or algorithm. For example, the length (in time) of a <italic>ev::Temporal Window</italic> can be tuned to respond to a target object moving at a certain velocity, but may fail if the target&#x02019;s velocity cannot be constrained. A <italic>ev::Fixed Surface</italic> of <italic>N</italic> events will be invariant to the speed of an object, but can fail if the target size and shape are unknown, a <italic>ev::Surface</italic> can access a spatial region-of-interest faster than a <italic>ev::Temporal Window</italic>, as long as the temporal order of events is not important. The event-driven library includes a range of methods to organize and structure the event-stream; an example code-snippet that combines port-callback functionality, event-packet decoding and event data structuring is shown in Listing <xref ref-type="fig" rid="F5">2</xref>.</p>
<p>In a distributed processing network, network latency, packet loss, and module synchronization become relevant issues, especially when it is desirable to take advantage of the intrinsic low-latency of the sensor. Processing needs to be performed in real-time to ensure robot behavior is decided from an up-to-date estimation of the world. The ATIS cameras will produce &#x02248;10&#x02009;kV/s when a small object is moving in the field of view but will produce &#x0003E;1,000&#x02009;kV/s if the camera itself is rotated quickly (e.g., when the iCub performs a saccade). These numbers double for a stereo camera set-up. Real-time constraints can be broken if processing algorithms are dependent on processing every single event and the processing power is not sufficient.</p>
<p>In the YARP event-driven library, a multi-threaded event structure is provided to de-couple the process of reading events into a data structure from that of running the algorithm. Modules are constructed such that the entire history of events is accounted for, but the processing algorithm runs only at the rate at which it maintains real-time operation. The result is that chunks of events are not <italic>randomly</italic> lost within the communication pipeline; instead the rate at which the algorithm can output a result is reduced under high event-load. Our algorithms still typically run at rates of 100 to 1,000&#x02009;s of Hertz; higher than the frame-rate of a standard camera. Importantly, the algorithm update-rate is not bottlenecked by the sensor update-rate (e.g., a frame-based camera), and the update-rate can be increased by adding computational power. The library classes <monospace>ev::queueAllocator, ev::tWinThread</monospace> and <monospace>ev::hSurfThread</monospace> manage real-time operation, and examples can be found in the documentation.</p>
<p>&#x0201C;Event-by-event&#x0201D; processing is also always possible in the YARP event-driven library and can be used to enforce a deterministic result to evaluate algorithm performance off-line, without the need to consider real-time constraints.</p>
</sec>
<sec id="S3-4">
<label>3.4</label> <title>Low-Level Processing</title>
<p>Processing modules take the raw AER data and extract useful, higher-level information. The output of the modules will be a stream of events augmented with the additional information, as in Figure <xref ref-type="fig" rid="F2">2</xref>. The modules currently available in the event-driven repository are:
<list list-type="bullet">
<list-item><p>Optical Flow&#x02014;an estimate of visual flow velocity is given by the rate at which the position of events change over time. Local velocity can be extracted by fitting planes to the resulting spatiotemporal manifolds (Benosman et al., <xref ref-type="bibr" rid="B2">2014</xref>). The vFlow module converts the ED camera output <monospace>ev::AddressEvent</monospace> to <monospace>ev::FlowEvent</monospace>.</p></list-item>
<list-item><p>Cluster Tracking&#x02014;The movement of an object across the visual field of an ED camera produces a detailed, unbroken trace of events. This module tracks clusters of events that belong to the same trace (Valeiras et al., <xref ref-type="bibr" rid="B21">2015</xref>). The cluster center and distribution statistics is output from the <monospace>vCluster</monospace> module as a <monospace>ev::GaussianAE</monospace> event.</p></list-item>
<list-item><p>Corner Detection&#x02014;using an event-driven Harris algorithm, the event-stream is filtered to leave only the events on the corners of objects (Vasco et al., <xref ref-type="bibr" rid="B22">2016a</xref>). Corner events provide unique features that can be tracked over time. Compared to a traditional camera, the ED corner algorithm requires less processing, as shown in Figure <xref ref-type="fig" rid="F3">3</xref>B. Corner events are represented by <monospace>ev::LabelledAE</monospace>s.</p></list-item>
<list-item><p>Circle Detection&#x02014;detection of circular shapes in the event-stream can be performed using an ED Hough transform. As the camera moves on a robot, many background events clutter the detection algorithm. The <monospace>vCircle</monospace> module reduces the false positive detections by incorporating optical-flow information (Glover and Bartolozzi, <xref ref-type="bibr" rid="B6">2016</xref>). The detection results are shown in Figure <xref ref-type="fig" rid="F3">3</xref>A. Circle events are described by <monospace>ev::GaussianAE</monospace>s.</p></list-item>
<list-item><p>Particle filtering&#x02014;the particle filter achieves tracking that is robust to variations in the speed of the target, by also sampling within the temporal dimension (Glover and Bartolozzi, <xref ref-type="bibr" rid="B7">2017</xref>). Ball tracking is implemented and the results are shown in Figure <xref ref-type="fig" rid="F3">3</xref>A.</p></list-item>
</list></p>
<fig id="F3" position="float">
<label>Figure 3</label>
<caption><p>The <bold>(A)</bold> tracking/detection accuracy of <monospace>ev::vCircle</monospace> (blue) and <monospace>ev::vParticleFiler</monospace> (green) compared to ground truth (black). Both algorithms can be used to control the iCub in gaze and grasping demonstrations. The <bold>(B)</bold> computation performance comparison between <monospace>ev::vCorner</monospace> and hypothetical frame-based Harris corner detection (red dashed line). A lower computational requirement is beneficial to resource contained on-line robotics. These figures can be generated using the scripts found in the datasets section.</p></caption>
<graphic xlink:href="frobt-04-00073-g003.tif"/>
</fig>
<p>The library also includes additional tools for:
<list list-type="bullet">
<list-item><p>Camera Calibration&#x02014;the intrinsic parameters of the camera can be estimated using a static fiducial and standard visual geometry techniques.</p></list-item>
<list-item><p>Pre-processing&#x02014;this module can apply a salt-and-pepper filter, flipping horizontal/vertical axes, applying camera distortion removal, and splitting a combined stereo event-stream into a left stream and a right stream.</p></list-item>
<list-item><p>Visualization&#x02014;the event-stream is asynchronous and does not inherently form &#x0201C;images&#x0201D; that can be viewed in the same way as a traditional camera. The <monospace>vFramer</monospace> uses a <monospace>ev::TemporalWindow</monospace> to accumulate events over time and produce a visualization of the event-stream. Different drawing methods exist for different event-types, which can be overlaid onto a single image (as shown in Figure <xref ref-type="fig" rid="F1">1</xref>).</p></list-item>
</list></p>
</sec>
</sec>
<sec id="S4">
<label>4</label> <title>Demonstrations, Code, and Datasets</title>
<p>The neuromorphic iCub and event-driven library have been used for several studies and robot demonstrations that can be run using <monospace>yarpmanager</monospace>. The modules are designed such that the robot begins performing the task once all required modules are running and the port connections have been made. Detailed instructions on how to run the demonstrations are provided in the online documentation<xref ref-type="fn" rid="fn2"><sup>2</sup></xref> available with the code<xref ref-type="fn" rid="fn3"><sup>3</sup></xref> on GitHub. An <monospace>xml</monospace> file is provided for each application to correctly launch and connect modules in <monospace>yarpmanager</monospace>. Known issues with the applications can also be found online. An overview of some of the applications is given below:
<list list-type="bullet">
<list-item><p><bold>Ball Gazing and Grasping</bold>&#x02014;The module <monospace>vCircle</monospace> (desribed more in Glover and Bartolozzi (<xref ref-type="bibr" rid="B6">2016</xref>)) or <monospace>vParticleFilter</monospace> (described more in Glover and Bartolozzi (<xref ref-type="bibr" rid="B7">2017</xref>)) can be used to produce events describing the visual position of a ball, e.g., see Figure <xref ref-type="fig" rid="F3">3</xref>A. The <monospace>vGazeDemo</monospace> uses the <monospace>iKinGazeCtrl</monospace> (Roncone et al., <xref ref-type="bibr" rid="B19">2016</xref>) to calculate the 3D position of the ball and the focus of the iCub&#x02019;s gaze can be directed to the location using the head and eye motors. Alternatively, the output of the ball position can be sent to the classic <monospace>DemoRedBall<xref ref-type="fn" rid="fn4"><sup>4</sup></xref></monospace> application to have the robot also move the arm to grasp the ball.</p></list-item>
<list-item><p><bold>Stereo Vergence</bold>&#x02014;Automatic control of stereo vergence of the iCub to focus on an object within the field of view was implemented using biologically inspired methods (Vasco et al., <xref ref-type="bibr" rid="B23">2016b</xref>). The <monospace>vVergence</monospace> application accepts stereo ev::AddressEvents and moves the vergence to minimize the response of stereo Gabor filters.</p></list-item>
<list-item><p><bold>Attention and Micro-saccade</bold>&#x02014;A simple, yet effective, attention module is demonstrated that only requires the presence of events to perform a saccade to gaze at an external stimulus. If the event-rate is instead below a threshold, the <monospace>autosaccade</monospace> application generates small eye movements to visualize the static scene.</p></list-item>
</list></p>
<p>The documentation includes a project overview, instructions to run demonstration applications, descriptions and parameters of processing modules, and class and function descriptions. The code is only dependent on YARP and uses the <monospace>iCubContrib</monospace> to install the project in a manner compatible with YARP and iCub environment.</p>
<p>Datasets of event-driven data can be found in the tutorials section of the online documentation. The datasets consist of the event-streams used in several of the experiments presented in this paper. The datasets enable the processing of event-driven algorithms if a physical camera is not available.</p>
</sec>
<sec id="S5">
<label>5</label> <title>Conclusion</title>
<p>This paper presents the YARP-integrated event-driven library, specifically toward enabling ED robotics using a robot middleware. The data structures, multi-threaded approach and algorithm design are aimed toward real-time operation under a wide range of conditions and in uncontrolled environment, toward robust robotic behavior. The paper has presented the YARP interface, the low-level vision algorithms, and the applications on the iCub robot.</p>
<p>Event cameras are now available as an add-on plug-in and new iCub robots can potentially come equipped with neuromorphic hardware; alongside traditional cameras, or as the sole form of vision. Alternatively, the software package can be used through a USB interface to the ATIS camera, or through off-line datasets. The contribution of alternative camera interfaces is possible (and welcome) as the processing modules are transparent to the source of the events, and the package is provided as an open-source project.</p>
</sec>
<sec id="S6" sec-type="author-contributor">
<title>Author Contributions</title>
<p>All authors contributed to the writing and proofing of the article, as well as documentation of the code. CB was the major contributor to the hardware interfaces and AG was the major contributor to the libraries and applications. VV and MI contributed to modules and applications.</p>
</sec>
<sec id="S7">
<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.</p>
</sec>
</body>
<back>
<ack>
<p>The authors would like to thank Ugo Pattacini, Charles Clerq, and Francesco Rea for early contributions to the event-driven libraries, and Francesco Diotalevi, Marco Maggiali, and Andrea Mura for hardware and FPGA development, and for the integration of event cameras on the iCub.</p>
</ack>
<fn-group>
<fn fn-type="financial-disclosure">
<p><bold>Funding.</bold> This research has received funding from the European Union Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 231467 (eMorph) and no. 284553 (SICODE).</p></fn>
</fn-group>
<ref-list>
<title>References</title>
<ref id="B1"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Bartolozzi</surname> <given-names>C.</given-names></name> <name><surname>Rea</surname> <given-names>F.</given-names></name> <name><surname>Clercq</surname> <given-names>C.</given-names></name> <name><surname>Hofst&#x000E4;tter</surname> <given-names>M.</given-names></name> <name><surname>Fasnacht</surname> <given-names>D.</given-names></name> <name><surname>Indiveri</surname> <given-names>G.</given-names></name> <etal/></person-group> (<year>2011</year>). <article-title>&#x0201C;Embedded neuromorphic vision for humanoid robots,&#x0201D;</article-title> in <conf-name>IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)</conf-name> (<conf-loc>Colorado Springs, CO</conf-loc>: <conf-sponsor>IEEE</conf-sponsor>), <fpage>129</fpage>&#x02013;<lpage>135</lpage>.</citation></ref>
<ref id="B2"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Benosman</surname> <given-names>R.</given-names></name> <name><surname>Clercq</surname> <given-names>C.</given-names></name> <name><surname>Lagorce</surname> <given-names>X.</given-names></name> <name><surname>Ieng</surname> <given-names>S.-H.</given-names></name> <name><surname>Bartolozzi</surname> <given-names>C.</given-names></name></person-group> (<year>2014</year>). <article-title>Event-based visual flow</article-title>. <source>IEEE Trans. Neural Netw. Learn. Syst.</source> <volume>25</volume>, <fpage>407</fpage>&#x02013;<lpage>417</lpage>.<pub-id pub-id-type="doi">10.1109/TNNLS.2013.2273537</pub-id><pub-id pub-id-type="pmid">24807038</pub-id></citation></ref>
<ref id="B3"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Conradt</surname> <given-names>J.</given-names></name> <name><surname>Cook</surname> <given-names>M.</given-names></name> <name><surname>Berner</surname> <given-names>R.</given-names></name> <name><surname>Lichtsteiner</surname> <given-names>P.</given-names></name> <name><surname>Douglas</surname> <given-names>R. J.</given-names></name> <name><surname>Delbruck</surname> <given-names>T.</given-names></name></person-group> (<year>2009</year>). <article-title>&#x0201C;A pencil balancing robot using a pair of AER dynamic vision sensors,&#x0201D;</article-title> in <conf-name>IEEE International Symposium on Circuits and Systems</conf-name> (<conf-loc>Taipei, Taiwan</conf-loc>), <fpage>781</fpage>&#x02013;<lpage>784</lpage>.</citation></ref>
<ref id="B4"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Delbruck</surname> <given-names>T.</given-names></name></person-group> (<year>2008</year>). <article-title>&#x0201C;Frame-free dynamic digital vision,&#x0201D;</article-title> in <conf-name>Proceedings of International Symposium on Secure-Life Electronics, Advanced Electronics for Quality Life and Society</conf-name> (<conf-loc>Tokyo, Japan</conf-loc>), <fpage>21</fpage>&#x02013;<lpage>26</lpage>.</citation></ref>
<ref id="B5"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Delbruck</surname> <given-names>T.</given-names></name> <name><surname>Lang</surname> <given-names>M.</given-names></name></person-group> (<year>2013</year>). <article-title>Robotic goalie with 3 ms reaction time at 4% CPU load using event-based dynamic vision sensor</article-title>. <source>Front. Neurosci.</source> <volume>7</volume>:<fpage>223</fpage>.<pub-id pub-id-type="doi">10.3389/fnins.2013.00223</pub-id><pub-id pub-id-type="pmid">24311999</pub-id></citation></ref>
<ref id="B6"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Glover</surname> <given-names>A.</given-names></name> <name><surname>Bartolozzi</surname> <given-names>C.</given-names></name></person-group> (<year>2016</year>). <article-title>&#x0201C;Event-driven ball detection and gaze fixation in clutter,&#x0201D;</article-title> in <conf-name>IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)</conf-name> (<conf-loc>Daejeon, South Korea</conf-loc>), <fpage>2203</fpage>&#x02013;<lpage>2208</lpage>.</citation></ref>
<ref id="B7"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Glover</surname> <given-names>A.</given-names></name> <name><surname>Bartolozzi</surname> <given-names>C.</given-names></name></person-group> (<year>2017</year>). <article-title>&#x0201C;Robust visual tracking with a freely-moving event camera,&#x0201D;</article-title> in <conf-name>IEEE International Conference on Intelligent Robots and Systems</conf-name> (<conf-loc>Vancouver, Canada</conf-loc>: <conf-sponsor>IEEE</conf-sponsor>).</citation></ref>
<ref id="B8"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Hoffmann</surname> <given-names>R.</given-names></name> <name><surname>Weikersdorfer</surname> <given-names>D.</given-names></name> <name><surname>Conradt</surname> <given-names>J.</given-names></name></person-group> (<year>2013</year>). <article-title>&#x0201C;Autonomous indoor exploration with an event-based visual SLAM system,&#x0201D;</article-title> in <conf-name>European Conference on Mobile Robots, ECMR 2013 &#x02013; Conference Proceedings</conf-name> (<conf-loc>Barcelona, Spain</conf-loc>), <fpage>38</fpage>&#x02013;<lpage>43</lpage>.</citation></ref>
<ref id="B9"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Kim</surname> <given-names>H.</given-names></name> <name><surname>Leutenegger</surname> <given-names>S.</given-names></name> <name><surname>Davison</surname> <given-names>A. J.</given-names></name></person-group> (<year>2016</year>). <article-title>&#x0201C;Real-time 3D reconstruction and 6-DoF tracking with and event camera,&#x0201D;</article-title> in <conf-name>European Conference on Computer Vision</conf-name>, <conf-loc>Amsterdam</conf-loc>, <fpage>349</fpage>&#x02013;<lpage>364</lpage>.</citation></ref>
<ref id="B10"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Kueng</surname> <given-names>B.</given-names></name> <name><surname>Mueggler</surname> <given-names>E.</given-names></name> <name><surname>Gallego</surname> <given-names>G.</given-names></name> <name><surname>Scaramuzza</surname> <given-names>D.</given-names></name></person-group> (<year>2016</year>). <article-title>&#x0201C;Low-latency visual odometry using event-based feature tracks,&#x0201D;</article-title> in <conf-name>IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)</conf-name> (<conf-loc>Daejeon, South Korea</conf-loc>).</citation></ref>
<ref id="B11"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lichtsteiner</surname> <given-names>P.</given-names></name> <name><surname>Posch</surname> <given-names>C.</given-names></name> <name><surname>Delbruck</surname> <given-names>T.</given-names></name></person-group> (<year>2008</year>). <article-title>An 128x128 120dB 15<italic>&#x003BC;</italic>s-latency temporal contrast vision sensor</article-title>. <source>IEEE J. Solid State Circuits</source> <volume>43</volume>, <fpage>566</fpage>&#x02013;<lpage>576</lpage>.<pub-id pub-id-type="doi">10.1109/JSSC.2007.914337</pub-id></citation></ref>
<ref id="B12"><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. Robot. Syst.</source> <volume>3</volume>, <fpage>043</fpage>&#x02013;<lpage>048</lpage>.<pub-id pub-id-type="doi">10.5772/5761</pub-id></citation></ref>
<ref id="B13"><citation citation-type="book"><person-group person-group-type="author"><name><surname>Mortara</surname> <given-names>A.</given-names></name></person-group> (<year>1998</year>). <article-title>&#x0201C;A pulsed communication/computation framework for analog VLSI perceptive systems,&#x0201D;</article-title> in <source>Neuromorphic Systems Engineering</source>, ed. <person-group person-group-type="editor"><name><surname>Lande</surname> <given-names>T.</given-names></name></person-group> (<publisher-loc>Norwell, MA</publisher-loc>: <publisher-name>Kluwer Academic</publisher-name>), <fpage>217</fpage>&#x02013;<lpage>228</lpage>.</citation></ref>
<ref id="B14"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Mueggler</surname> <given-names>E.</given-names></name> <name><surname>Gallego</surname> <given-names>G.</given-names></name> <name><surname>Scaramuzza</surname> <given-names>D.</given-names></name></person-group> (<year>2015</year>). <article-title>&#x0201C;Continuous-time trajectory estimation for event-based vision sensors,&#x0201D;</article-title> in <conf-name>Proceedings of Robotics: Science and Systems</conf-name>, <conf-loc>Rome</conf-loc>.<pub-id pub-id-type="doi">10.15607/RSS.2015.XI.036</pub-id></citation></ref>
<ref id="B15"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ni</surname> <given-names>Z.</given-names></name> <name><surname>Bolopion</surname> <given-names>A.</given-names></name> <name><surname>Agnus</surname> <given-names>J.</given-names></name> <name><surname>Benosman</surname> <given-names>R.</given-names></name> <name><surname>R&#x000E9;gnier</surname> <given-names>S.</given-names></name></person-group> (<year>2012</year>). <article-title>Asynchronous event-based visual shape tracking for stable haptic feedback in microrobotics</article-title>. <source>IEEE Trans. Robot.</source> <volume>28</volume>, <fpage>1081</fpage>&#x02013;<lpage>1089</lpage>.<pub-id pub-id-type="doi">10.1109/TRO.2012.2198930</pub-id></citation></ref>
<ref id="B16"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Posch</surname> <given-names>C.</given-names></name> <name><surname>Matolin</surname> <given-names>D.</given-names></name> <name><surname>Wohlgenannt</surname> <given-names>R.</given-names></name></person-group> (<year>2011</year>). <article-title>A QVGA 143 dB dynamic range frame-free PWM image sensor with lossless pixel-level video compression and time-domain CDS</article-title>. <source>IEEE J. Solid State Circuits</source> <volume>46</volume>, <fpage>259</fpage>&#x02013;<lpage>275</lpage>.<pub-id pub-id-type="doi">10.1109/JSSC.2010.2085952</pub-id></citation></ref>
<ref id="B17"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Rea</surname> <given-names>F.</given-names></name> <name><surname>Metta</surname> <given-names>G.</given-names></name> <name><surname>Bartolozzi</surname> <given-names>C.</given-names></name></person-group> (<year>2013</year>). <article-title>Event-driven visual attention for the humanoid robot iCub</article-title>. <source>Front. Neurosci.</source> <volume>7</volume>:<fpage>234</fpage>.<pub-id pub-id-type="doi">10.3389/fnins.2013.00234</pub-id><pub-id pub-id-type="pmid">24379753</pub-id></citation></ref>
<ref id="B18"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Rebecq</surname> <given-names>H.</given-names></name> <name><surname>Horstschaefer</surname> <given-names>T.</given-names></name> <name><surname>Gallego</surname> <given-names>G.</given-names></name> <name><surname>Scaramuzza</surname> <given-names>D.</given-names></name></person-group> (<year>2016</year>). <article-title>EVO: a geometric approach to event-based 6-DoF parallel tracking and mapping in real-time</article-title>. <source>IEEE Robot. Autom. Lett.</source> <volume>2</volume>, <fpage>593</fpage>&#x02013;<lpage>600</lpage>.<pub-id pub-id-type="doi">10.1109/LRA.2016.2645143</pub-id></citation></ref>
<ref id="B19"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Roncone</surname> <given-names>A.</given-names></name> <name><surname>Pattacini</surname> <given-names>U.</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>2016</year>). <article-title>&#x0201C;A cartesian 6-DoF gaze controller for humanoid robots,&#x0201D;</article-title> in <conf-name>Proceedings of Robotics: Science and Systems</conf-name>, <conf-loc>AnnArbor</conf-loc>.<pub-id pub-id-type="doi">10.15607/RSS.2016.XII.022</pub-id></citation></ref>
<ref id="B20"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Serrano-Gotarredona</surname> <given-names>T.</given-names></name> <name><surname>Linares-Barranco</surname> <given-names>B.</given-names></name></person-group> (<year>2015</year>). <article-title>Poker-DVS and MNIST-DVS. Their history, how they were made, and other details</article-title>. <source>Front. Neurosci.</source> <volume>9</volume>:<fpage>481</fpage>.<pub-id pub-id-type="doi">10.3389/fnins.2015.00481</pub-id><pub-id pub-id-type="pmid">26733794</pub-id></citation></ref>
<ref id="B21"><citation citation-type="web"><person-group person-group-type="author"><name><surname>Valeiras</surname> <given-names>D. R.</given-names></name> <name><surname>Lagorce</surname> <given-names>X.</given-names></name> <name><surname>Clady</surname> <given-names>X.</given-names></name> <name><surname>Bartolozzi</surname> <given-names>C.</given-names></name> <name><surname>Ieng</surname> <given-names>S.-H.</given-names></name> <name><surname>Benosman</surname> <given-names>R.</given-names></name></person-group> (<year>2015</year>). <article-title>&#x0201C;An asynchronous neuromorphic event-driven visual part-based shape tracking,&#x0201D;</article-title> in <source>IEEE Transactions on Neural Networks and Learning Systems</source>, <fpage>1</fpage>&#x02013;<lpage>15</lpage>. Available at: <uri xlink:href="http://ieeexplore.ieee.org/document/7063246/">http://ieeexplore.ieee.org/document/7063246/</uri></citation></ref>
<ref id="B22"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Vasco</surname> <given-names>V.</given-names></name> <name><surname>Glover</surname> <given-names>A.</given-names></name> <name><surname>Bartolozzi</surname> <given-names>C.</given-names></name></person-group> (<year>2016a</year>). <article-title>&#x0201C;Fast event-based Harris corner detection exploiting the advantages of event-driven cameras,&#x0201D;</article-title> in <conf-name>IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)</conf-name> (<conf-loc>Daejeon, South Korea</conf-loc>), <fpage>4144</fpage>&#x02013;<lpage>4149</lpage>.</citation></ref>
<ref id="B23"><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Vasco</surname> <given-names>V.</given-names></name> <name><surname>Glover</surname> <given-names>A.</given-names></name> <name><surname>Tirupachuri</surname> <given-names>Y.</given-names></name> <name><surname>Solari</surname> <given-names>F.</given-names></name> <name><surname>Chessa</surname> <given-names>M.</given-names></name> <name><surname>Bartolozzi</surname> <given-names>C.</given-names></name></person-group> (<year>2016b</year>). <article-title>&#x0201C;Vergence control with a neuromorphic iCub,&#x0201D;</article-title> in <conf-name>IEEE-RAS International Conference on Humanoid Robots (Humanoids)</conf-name> (<conf-loc>Cancun, Mexico</conf-loc>: <conf-sponsor>IEEE</conf-sponsor>), <fpage>732</fpage>&#x02013;<lpage>738</lpage>.</citation></ref>
</ref-list>
<fn-group>
<fn id="fn1"><p><sup>1</sup><uri xlink:href="https://github.com/uzh-rpg/rpg_dvs_ros">github.com/uzh-rpg/rpg_dvs_ros</uri>.</p></fn>
<fn id="fn2"><p><sup>2</sup><uri xlink:href="http://robotology.github.io/event-driven/doxygen/doc/html/index.html">http://robotology.github.io/event-driven/doxygen/doc/html/index.html</uri>.</p></fn>
<fn id="fn3"><p><sup>3</sup><uri xlink:href="https://github.com/robotology/event-driven">https://github.com/robotology/event-driven</uri>.</p></fn>
<fn id="fn4"><p><sup>4</sup><uri xlink:href="https://github.com/robotology/icub-basic-demos">https://github.com/robotology/icub-basic-demos</uri>.</p></fn>
</fn-group>
</back>
</article>