| Literature DB >> 29614772 |
Pedro Sánchez1, Bárbara Álvarez2, Elías Antolinos3, Diego Fernández4, Andrés Iborra5.
Abstract
The Internet of Things (IoT) is one of today's main disruptive technologies and, although massive research has been carried out in recent years, there are still some open issues such as the consideration of software engineering methods and tools. We propose the adoption of the Teleo-Reactive approach in order to facilitate the development of Internet of Things systems as a set of communicating Teleo-Reactive nodes. The software behavior of the nodes is specified in terms of goals, perceptions and actions over the environment, achieving higher abstraction than using general-purpose programming languages and therefore, enhancing the involvement of non-technical users in the specification process. Throughout this paper, we describe the elements of a Teleo-Reactive node and a systematic procedure for translating Teleo-Reactive specifications into executable code for Internet of Things devices. The case study of a robotic agent is used in order to validate the whole approach.Entities:
Keywords: Internet of Things; Teleo-Reactive programming; multi-agent systems
Year: 2018 PMID: 29614772 PMCID: PMC5948476 DOI: 10.3390/s18041059
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.576
Structure of a generic TR program.
| Condition | Action | |
|---|---|---|
|
| → |
|
|
| → |
|
| … | ||
|
| → |
|
| … | ||
|
| → |
|
Figure 1Multi-threaded TeleoR architecture (taken from [9]).
Figure 2TR node modules.
Figure 3Example of a possible TR architecture based on the TR nodes. TR node (a) has a moisture sensor attached. Data measurements are assessed by the node and sent to the LCN, which gathers data from many different nodes and makes decisions or sends it to the CN. The CN can obtain data from both the LCNs and the Internet by service requests, and if the behavior is specified in its TR code, it can send an order to the TR node (b) to open or close the valve attached to it.
Figure 4Communications between two TR nodes: modules involved in the implementation.
TeleoR specification of a bottle collecting robot.
From TeleoR goal (left) to Erlang function (right).
From TeleoR percept/belief (left) to Erlang equivalent (right): general scheme.
From TeleoR percept/belief (up) to Erlang equivalent (down): bottle collecting robot.
From TeleoR condition on variables (left) to Erlang equivalent (right).
From TeleoR condition on variables (up) to Erlang equivalent (down).
TeleoR variable update (left). Erlang variable update (right).
TeleoR variable update (up). Erlang variable update (down).
TeleoR managing messages (up) and Erlang equivalent (b).
Functions managing the BS.
API functions definitions for the BeliefStore module.
API functions that work as an interface.
Main correspondences between TR programs and the Erlang implementation.
| Concept in TR Program | Artifact in Erlang |
|---|---|
| goal | function declaration with |
| rule | function clause |
| rule condition | guard sequence |
| rule action | function call |
| variable, percept, belief | variable accessible through the BS |
| arithmetic expression | arithmetic expression on function calls accessing the BS |
| assignment statement in rule | function call updating the BS |
| message to another agent | message to an Erlang process |
| message handle | clause of the |
| remember/forget operation | ad hoc implementations of Erlang functions for accessing the BS |
| ad hoc implementations of Erlang functions for extending the rule conditions | |
| timed sequence of rule durative actions | sequence of function calls triggering alarms for finishing the action execution |
| enums | atoms |
Figure 5TR program editor implemented using Eclipse, Xtext and Xtend.
Figure 6Raspberry Pi used pins scheme.
Pins, attached devices and associated actions/states for the Raspberry Pi circuit.
| Pin | I/O Attached | Action | States |
|---|---|---|---|
| L0 | Red LED | move | |
| L1 | Green LED | turn | |
| L2 | Orange LED | gripper is open | |
| L4 | Yellow LED | bottle is collected | |
| L3 | Switch A | touching | |
| L5 | Switch B | see drop | |
| L6 | Switch C | see bottle | |
| L7 | Switch D | over drop |
Figure 7Final circuit for the simulation of a bottle collecting robot using a TR node.
Figure 8Different states of the robot as a result of the emulation: (a) alternating between turning and moving; (b) moving forward; (c) over the drop and openning the gripper
Figure 9Raspberry Pi CPU load with the Erlang implementation.
Figure 10Raspberry Pi CPU load with the Python implementation.
Figure 11Raspberry Pi RAM memory with the Erlang implementation.
Figure 12Raspberry RAM memory with the Python implementation.
Power consumption for both implementations.
| Version | Pi State | Power Consumption (Input 5 V) |
|---|---|---|
| Python | powering on | 100–440 mA (0.5–2.2 W) |
| idle | 320–330 mA (1.6–1.65 W) | |
| running the robot example | 340–370 mA (1.7–1.85 W) | |
| Erlang interpreter | powering on | 107–400 mA (0.535–2 W) |
| idle | 310–330 mA (1.55–1.65 W) | |
| running the robot example | 414–450 mA (2.07–2.25 W) |
Figure 13Statechart representing the behaviour implemented for the robot example.