|
|
# **RTIS Common Documentation - Table of Content**
|
|
|
|
|
|
- [General Usage](#general-usage)
|
|
|
- [Classes](#classes)
|
|
|
- [RTISClientObj](#rtisclientobj)
|
|
|
- [Pose](#pose)
|
... | ... | @@ -12,12 +13,75 @@ |
|
|
- [set_behaviour_active](#set_behaviour_active)
|
|
|
- [set_behaviour_passive](#set_behaviour_passive)
|
|
|
|
|
|
# **General Usage**
|
|
|
|
|
|
This is a library used by most parts of the RTIS Network including the CLients, Server and applications.
|
|
|
This documentation is mostly meant to explain how to use it to create your own applications.
|
|
|
|
|
|
Making a new application for the RTIS Network is rather straight forward.
|
|
|
Several functions are available to be used to gain information on the connected
|
|
|
RTIS Clients and Server and prepare your application for their data.
|
|
|
|
|
|
All the available commands are explained below.
|
|
|
|
|
|
For receiving the measurement data one should set up a TCP socket server with the
|
|
|
IP defined in the [serversettings.json](Config/serversettings.json) as _applicationIP_ with port `65444`.
|
|
|
|
|
|
For example:
|
|
|
|
|
|
```python
|
|
|
import socket
|
|
|
import pickle
|
|
|
|
|
|
serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
|
serverSocket.bind(('applicationIP', 65444))
|
|
|
serverSocket.listen(10)
|
|
|
print("Started data listener.")
|
|
|
while True:
|
|
|
try:
|
|
|
conn, address = serverSocket.accept()
|
|
|
data = []
|
|
|
while True:
|
|
|
packet = conn.recv(2048)
|
|
|
if not packet: break
|
|
|
data.append(packet)
|
|
|
dataPackage = pickle.loads(b"".join(data))
|
|
|
print("measurement #" + dataPackage[4] + " received!")
|
|
|
except socket.error as ex:
|
|
|
print("the RTIS Server aborted the data connection: " + str(ex))
|
|
|
except pickle.UnpicklingError as ex:
|
|
|
print("the RTIS Server aborted the data connection: " + str(ex))
|
|
|
except EOFError as ex:
|
|
|
print("The RTIS Server aborted the data connection: " + str(ex))
|
|
|
except KeyboardInterrupt:
|
|
|
print("Closing data listener...")
|
|
|
serverSocket.close()
|
|
|
```
|
|
|
|
|
|
The `dataPackage` that the RTIS Network Server sends contains a tuple with the following elements in this order:
|
|
|
- `ID`: string: The RTIS Client ID.
|
|
|
- `processedData`: numpy ndarray: The data matrix holding the optionally processed data.
|
|
|
- `rawData`: numpy ndarray: The data matrix holding the raw recording data samples as uint32.
|
|
|
- `timestamp`: float: Epoch timestamp of when the measurement was taken on the RTIS Client.
|
|
|
- `index`: int: The measurement index of this measurement for this RTIS Client.
|
|
|
- `behaviour`: int (0 or 1): The behaviour of the RTIS Client sonar mode. 0 means passive, 1 means active.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
# **Classes**
|
|
|
|
|
|
## **RTISClientObj**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>RTISClientObj</b>(<i>client_id, client_ip, network_version, firmware_version, client_online=True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L29">[source]</a>
|
|
|
<i>class</i> <b>RTISClientObj</b>(<i>client_id, client_ip, network_version, firmware_version, client_online=True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L82">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class describing a connected RTIS Client.
|
... | ... | @@ -83,7 +147,7 @@ Class describing a connected RTIS Client. |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>update_heartbeat</b>(<i>self, client_ip, client_configured, client_behaviour, client_inputDataQueueSize, client_outputDataQueueSize, client_internalCounter</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L113">[source]</a>
|
|
|
<i></i> <b>update_heartbeat</b>(<i>self, client_ip, client_configured, client_behaviour, client_inputDataQueueSize, client_outputDataQueueSize, client_internalCounter</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L166">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Method that is used by RTIS Server to update the status of a RTIS Client when a new heartbeat is received.
|
... | ... | @@ -127,7 +191,7 @@ Method that is used by RTIS Server to update the status of a RTIS Client when a |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>check_heartbeat</b>(<i>self, maximum_delta=15</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L151">[source]</a>
|
|
|
<i></i> <b>check_heartbeat</b>(<i>self, maximum_delta=15</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L204">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Method to check if a RTIS Client has timed out based on a check of it's previous received heartbeat.
|
... | ... | @@ -158,7 +222,7 @@ Method to check if a RTIS Client has timed out based on a check of it's previous |
|
|
## **Pose**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>Pose</b>(<i>x, y, z, pitch, yaw, roll</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L175">[source]</a>
|
|
|
<i>class</i> <b>Pose</b>(<i>x, y, z, pitch, yaw, roll</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L228">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class describing a 3D pose using the right-handed coordinate system where x points forward, Y points to the left
|
... | ... | @@ -207,7 +271,7 @@ x, y and z are in meters. Pitch, yaw and roll in degrees. |
|
|
## **dspSettings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>dspSettings</b>(<i>configName, dspFiles, workers, pdmEnable, matchedFilterEnable, beamformingEnable, enveloppeEnable, cleanEnable, version</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L245">[source]</a>
|
|
|
<i>class</i> <b>dspSettings</b>(<i>configName, dspFiles, workers, pdmEnable, matchedFilterEnable, beamformingEnable, enveloppeEnable, cleanEnable, version</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L298">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class describing all the recording and processing settings related to RTIS devices.
|
... | ... | @@ -220,6 +284,7 @@ Can be converted to a dictionary. |
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
... | ... | @@ -231,13 +296,14 @@ Can be converted to a dictionary. |
|
|
## **dsp_worker_process**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>dsp_worker_process</b>(<i>dspSettings, inputDataQueue, outputDataQueue, logger =None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L404">[source]</a>
|
|
|
<i>def</i> <b>dsp_worker_process</b>(<i>dspSettings, inputDataQueue, outputDataQueue, logger =None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L457">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The method to use als a `multiprocessing.Process` to perform a DSP pipeline on sonar measurements
|
|
|
using the RTIS CUDA library. This will run continiously until closed.
|
|
|
It will first prepare the DSP pipeline with the given settings. Afterwards it will process each measurement
|
|
|
placed on the input data queue and place the result on the output data queue.
|
|
|
This method should only be used the the RTIS Server and not by applications.
|
|
|
|
|
|
The resulting data on the output data queue will be a tuple with the following content:
|
|
|
- `ID`: string: The RTIS Client ID.
|
... | ... | @@ -278,10 +344,10 @@ The resulting data on the output data queue will be a tuple with the following c |
|
|
## **get_server_config**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_server_config</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L471">[source]</a>
|
|
|
<i>def</i> <b>get_server_config</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L525">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
A function to get the [`dspSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/wikis/home#dspsettings) currently used by the RTIS Server.
|
|
|
A method to connect to the RTIS Server and get the [`dspSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/wikis/home#dspsettings) currently used by the RTIS Server.
|
|
|
Usefull for connected applications.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
... | ... | @@ -314,10 +380,11 @@ Usefull for connected applications. |
|
|
## **get_clients_and_configs**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_clients_and_configs</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L547">[source]</a>
|
|
|
<i>def</i> <b>get_clients_and_configs</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L601">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
A method to get all the active connected RTIS Clients with and their respective [`dspSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/wikis/home#dspsettings).
|
|
|
A method to connect to the RTIS Server and get all the active connected RTIS Clients
|
|
|
with and their respective [`dspSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/wikis/home#dspsettings).
|
|
|
Usefull for connected applications.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
... | ... | @@ -350,10 +417,10 @@ Usefull for connected applications. |
|
|
## **get_client_pose**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_client_pose</b>(<i>serverIp, client_id, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L642">[source]</a>
|
|
|
<i>def</i> <b>get_client_pose</b>(<i>serverIp, client_id, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L697">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
A function to get the [`Pose`](https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/wikis/home#pose) of a particular RTIS Client with.
|
|
|
A method to connect to the RTIS Server and get the [`Pose`](https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/wikis/home#pose) of a particular RTIS Client with.
|
|
|
Usefull for connected applications.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
... | ... | @@ -390,10 +457,11 @@ Usefull for connected applications. |
|
|
## **set_behaviour_active**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_behaviour_active</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L691">[source]</a>
|
|
|
<i>def</i> <b>set_behaviour_active</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L746">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Tell all connected RTIS Clients to set their sonar behaviour to active.
|
|
|
A method to connect to the RTIS Server tell all connected RTIS Clients to set their sonar behaviour to active.
|
|
|
Usefull for connected applications.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
... | ... | @@ -418,10 +486,11 @@ Tell all connected RTIS Clients to set their sonar behaviour to active. |
|
|
## **set_behaviour_passive**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_behaviour_passive</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L717">[source]</a>
|
|
|
<i>def</i> <b>set_behaviour_passive</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtiscommon/RTISCommon2.py#L773">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Tell all connected RTIS Clients to set their sonar behaviour to passive.
|
|
|
A method to connect to the RTIS Server tell all connected RTIS Clients to set their sonar behaviour to passive.
|
|
|
Usefull for connected applications.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
... | ... | |