ROS and MQTT

In a situation such as a smart home we might be using MQTT for home sensor notifications and ROS for gathering sensor information from a robot and sending the robot control messages. In order for a TeleoR agent to work in such an environment we need to be able to communicate between the agent and other systems using either ROS or MQTT (or both).

In the examples folder there are two subfolders ROS and MQTT that contain example C-level interface code that is intended to run as another node in the system that communicates with the agent using Pedro and the other nodes using ROS or MQTT. The consequence of this is that each time percepts are sent to the agent two messages are required and the same goes for robotic action messages.

This approach means communication is a little slower than if, say, ROS is used for all communications but we feel this is not a problem for TeleoR agents for the following reasons.

The first reason is that TeleoR agents are not intended to be used in applications where it needs to react at a very high speed (a reflex reaction). The TeleoR agent is intended to control robots and other devices at a reasonably high-level, leaving the details of how this is to be achieved by low-level code, perhaps at the C-level. Even so, timing suggests that this communication is running at millisecond speeds.

The second reason is that typically some conversion between low-level sensor information and the high-level percepts is required and doing this conversion in this node effectively removes one step in communication. The same could be argued for converting robotic actions into low-level control commands.

The third reason is that this approach provides a standard interface to the TeleoR system and avoids having to worry about potential race conditions that might arise if ROS or MQTT were embedded in Qulog itself.