Communication devices¶
Communication devices were included in the Stonefish library to account for the delays and directional character of different communication interfaces, in different mediums. They can be attached to all kinds of bodies, as well as directly to the world frame. All communication devices share the following properties:
Name: unique string
Device ID: unique number identifying the device
Type: type of the communication device
Origin: position and orientation of the device frame with respect to the parent frame
Link name: name of the link of the robot the device is attached to (for robots)
<comm name="{1}" device_id="{2}" type="{3}">
<!-- specific definitions here -->
<origin xyz="{4a}" rpy="{4b}"/>
<link name="{5}"/>
</comm>
Note
In the following sections, description of each specific implementation of a communication device is accompanied with an example of its instantiation through the XML syntax and the C++ code. It is assumed that the XML snippets are located inside the definition of a robot. In case of C++ code, it is assumed that an object sf::Robot* robot = new sf::Robot(...); was created before the device definition.
Acoustic modem¶
An acoustic modem is an underwater communication device based on an acoustic transducer. When creating an acoustic modem it is required to specify an id of the acoustic node it will be connected to. During the acoustic communication the directional characteristics of both the sender and the receiver are used to determine if both nodes can see each other. Moreover, an occlusion test is performed as default, to take into account the obstacles located on the path of the acoustic beam. The occlusion test can be disabled (it has to be done for both communicating nodes).
<comm name="Modem" device_id="5" type="acoustic_modem">
<specs min_vertical_fov="0.0" max_vertical_fov="220.0" range="1000.0"/>
<connect device_id="9" occlusion_test="true"/>
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
<link name="Link1"/>
</comm>
#include <Stonefish/comms/AcousticModem.h>
sf::AcousticModem* modem = new sf::AcousticModem("Modem", 5, 0.0, 220.0, 1000.0);
modem->Connect(9);
modem->setOcclusionTest(true);
robot->AddComm(modem, "Link1", sf::I4());
USBL¶
The ultra short baseline (USBL) is a device based on a tightly packed array of underwater acoustic transducers. It shares the same properties as the acoustic modem and extends upon them. It can be used for underwater communication as well as for localization of the signal source in 3D space. User can optionally define the standard deviation of the measurements of slant range, horizontal angle and vertical angle. Moreover, the resolution of the range and angle measurements can be set. Another feature of the USBL implementation is an automatic ping function used to update the measurements at a specified rate.
<comm name="USBL" device_id="5" type="usbl">
<specs min_vertical_fov="0.0" max_vertical_fov="220.0" range="1000.0"/>
<connect device_id="9" occlusion_test="false"/>
<autoping rate="1.0"/>
<noise range="0.05" horizontal_angle="0.2" vertical_angle="0.5"/>
<resolution range="0.1" angle="0.1"/>
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
<link name="Link1"/>
</comm>
#include <Stonefish/comms/USBL.h>
sf::USBL* usbl = new sf::USBL("USBL", 5, 0.0, 220.0, 1000.0);
usbl->Connect(9);
usbl->EnableAutoPing(1.0);
usbl->setOcclusionTest(false);
usbl->setNoise(0.05, 0.2, 0.5);
usbl->setResolution(0.1, 0.1);
robot->AddComm(usbl, "Link1", sf::I4());
Optical modem¶
An optical modem, sometimes called VLC (visual light communication) device, is a communication device based on a combination of strong LEDs and photodiodes. When creating an optical modem it is required to specify an id of the optical node it will be connected to. During the optical communication the directional characteristics of both the sender and the receiver are used to determine if both nodes can see each other. Moreover, an occlusion test is performed, to take into account the obstacles located on the path of the optical beam. Apart from geometrical limitations the optical modem is also implementing reception quality estimation and range limitation based on water turbidity, depth, and ambient light intensity. User can define a factor specifying how much the ambient light is affecting the reception quality.
<comm name="Modem" device_id="5" type="optical_modem">
<specs fov="120.0" range="50.0" ambient_light_sensitivity="0.5"/>
<connect device_id="9"/>
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
<link name="Link1"/>
</comm>
#include <Stonefish/comms/OpticalModem.h>
sf::OpticalModem* modem = new sf::OpticalModem("Modem", 5, 120.0, 50.0, 0.5);
modem->Connect(9);
robot->AddComm(modem, "Link1", sf::I4());