Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • RTIS Common Library RTIS Common Library
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • RTIS Software
  • RTIS Common LibraryRTIS Common Library
  • Wiki
  • Home

Home · Changes

Page history
Update home authored Aug 05, 2022 by Wouter Jansen's avatar Wouter Jansen
Hide whitespace changes
Inline Side-by-side
home.md
View page @ 92c2efd7
# **RTIS Common Documentation - Table of Content** # **RTIS Common Documentation - Table of Content**
- [General Usage](#general-usage)
- [Classes](#classes) - [Classes](#classes)
- [RTISClientObj](#rtisclientobj) - [RTISClientObj](#rtisclientobj)
- [Pose](#pose) - [Pose](#pose)
...@@ -18,12 +19,61 @@ ...@@ -18,12 +19,61 @@
- [set_behaviour_active](#set_behaviour_active) - [set_behaviour_active](#set_behaviour_active)
- [set_behaviour_passive](#set_behaviour_passive) - [set_behaviour_passive](#set_behaviour_passive)
# **General Usage**
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 in the source documentation or on the Wiki.
For receiving the measurement data one should set up a TCP socket server with the
IP defined in the serversettings.json of the RTIS Server 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.
# **Classes** # **Classes**
## **RTISClientObj** ## **RTISClientObj**
<p class="func-header"> <p class="func-header">
<i>class</i> <b>RTISClientObj</b>(<i>client_id, client_ip, network_version, firmware_version, required, client_online=True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L81">[source]</a> <i>class</i> <b>RTISClientObj</b>(<i>client_id, client_ip, network_version, firmware_version, required, client_online=True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L76">[source]</a>
</p> </p>
Class describing a connected RTIS Client. Class describing a connected RTIS Client.
...@@ -101,7 +151,7 @@ Class describing a connected RTIS Client. ...@@ -101,7 +151,7 @@ Class describing a connected RTIS Client.
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L188">[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/rtiscommon/-/blob/master/RTISCommon.py#L183">[source]</a>
</p> </p>
Method that is used by RTIS Server to update the status of a RTIS Client when a new heartbeat is received. Method that is used by RTIS Server to update the status of a RTIS Client when a new heartbeat is received.
...@@ -145,7 +195,7 @@ Method that is used by RTIS Server to update the status of a RTIS Client when a ...@@ -145,7 +195,7 @@ Method that is used by RTIS Server to update the status of a RTIS Client when a
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L224">[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/rtiscommon/-/blob/master/RTISCommon.py#L219">[source]</a>
</p> </p>
Method to check if a RTIS Client has timed out based on a check if it is previous received heartbeat. Method to check if a RTIS Client has timed out based on a check if it is previous received heartbeat.
...@@ -176,7 +226,7 @@ Method to check if a RTIS Client has timed out based on a check if it is previou ...@@ -176,7 +226,7 @@ Method to check if a RTIS Client has timed out based on a check if it is previou
<p class="func-header"> <p class="func-header">
<i></i> <b>check_stability</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L247">[source]</a> <i></i> <b>check_stability</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L242">[source]</a>
</p> </p>
Method to check if a RTIS Client is in the 'ready' configuration state for at least 1 minute Method to check if a RTIS Client is in the 'ready' configuration state for at least 1 minute
...@@ -201,7 +251,7 @@ to indicate it is fully ready and stable for operation. ...@@ -201,7 +251,7 @@ to indicate it is fully ready and stable for operation.
## **Pose** ## **Pose**
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L276">[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/rtiscommon/-/blob/master/RTISCommon.py#L271">[source]</a>
</p> </p>
Class describing a 3D pose using the right-handed coordinate system where x points forward, Y points to the left Class describing a 3D pose using the right-handed coordinate system where x points forward, Y points to the left
...@@ -250,7 +300,7 @@ x, y and z are in meters. Pitch, yaw and roll in degrees. ...@@ -250,7 +300,7 @@ x, y and z are in meters. Pitch, yaw and roll in degrees.
## **dspSettings** ## **dspSettings**
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L346">[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/rtiscommon/-/blob/master/RTISCommon.py#L341">[source]</a>
</p> </p>
Class describing all the recording and processing settings related to RTIS devices. Class describing all the recording and processing settings related to RTIS devices.
...@@ -274,7 +324,7 @@ Can be converted to a dictionary. ...@@ -274,7 +324,7 @@ Can be converted to a dictionary.
## **dsp_worker_process** ## **dsp_worker_process**
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L508">[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/rtiscommon/-/blob/master/RTISCommon.py#L503">[source]</a>
</p> </p>
The method to use als a `multiprocessing.Process` to perform a DSP pipeline on sonar measurements The method to use als a `multiprocessing.Process` to perform a DSP pipeline on sonar measurements
...@@ -322,7 +372,7 @@ The resulting data on the output data queue will be a tuple with the following c ...@@ -322,7 +372,7 @@ The resulting data on the output data queue will be a tuple with the following c
## **get_server_config** ## **get_server_config**
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L605">[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/rtiscommon/-/blob/master/RTISCommon.py#L600">[source]</a>
</p> </p>
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. 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.
...@@ -358,7 +408,7 @@ Useful for connected applications. ...@@ -358,7 +408,7 @@ Useful for connected applications.
## **get_clients_and_configs** ## **get_clients_and_configs**
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L682">[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/rtiscommon/-/blob/master/RTISCommon.py#L677">[source]</a>
</p> </p>
A method to connect to the RTIS Server and get all the active connected RTIS Clients A method to connect to the RTIS Server and get all the active connected RTIS Clients
...@@ -395,7 +445,7 @@ Useful for connected applications. ...@@ -395,7 +445,7 @@ Useful for connected applications.
## **get_client_pose** ## **get_client_pose**
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L779">[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/rtiscommon/-/blob/master/RTISCommon.py#L774">[source]</a>
</p> </p>
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. 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.
...@@ -435,7 +485,7 @@ Useful for connected applications. ...@@ -435,7 +485,7 @@ Useful for connected applications.
## **reload_config** ## **reload_config**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>reload_config</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L828">[source]</a> <i>def</i> <b>reload_config</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L823">[source]</a>
</p> </p>
Tell the RTIS Server to reload its serverconfig.json file and read in the new settings. Tell the RTIS Server to reload its serverconfig.json file and read in the new settings.
...@@ -464,7 +514,7 @@ Will also re-configure all connected RTIS Clients. ...@@ -464,7 +514,7 @@ Will also re-configure all connected RTIS Clients.
## **prepare** ## **prepare**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>prepare</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L855">[source]</a> <i>def</i> <b>prepare</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L850">[source]</a>
</p> </p>
Tell the RTIS Server and connected RTIS Clients to start all workers. Tell the RTIS Server and connected RTIS Clients to start all workers.
...@@ -492,7 +542,7 @@ Tell the RTIS Server and connected RTIS Clients to start all workers. ...@@ -492,7 +542,7 @@ Tell the RTIS Server and connected RTIS Clients to start all workers.
## **idle** ## **idle**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>idle</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L893">[source]</a> <i>def</i> <b>idle</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L888">[source]</a>
</p> </p>
Tell the RTIS Server and connected RTIS Clients to go idle Tell the RTIS Server and connected RTIS Clients to go idle
...@@ -521,7 +571,7 @@ and stop all measurements and kill all running workers. ...@@ -521,7 +571,7 @@ and stop all measurements and kill all running workers.
## **stop** ## **stop**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>stop</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L920">[source]</a> <i>def</i> <b>stop</b>(<i>serverIp, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L915">[source]</a>
</p> </p>
Tell the RTIS Server and connected RTIS Clients to stop any running measurements. Tell the RTIS Server and connected RTIS Clients to stop any running measurements.
...@@ -549,7 +599,7 @@ Tell the RTIS Server and connected RTIS Clients to stop any running measurements ...@@ -549,7 +599,7 @@ Tell the RTIS Server and connected RTIS Clients to stop any running measurements
## **start** ## **start**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>start</b>(<i>serverIp, measurements=0, frequency=0, active='0', logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L946">[source]</a> <i>def</i> <b>start</b>(<i>serverIp, measurements=0, frequency=0, active='0', logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L941">[source]</a>
</p> </p>
Tell the RTIS Server and connected RTIS Clients to stop any running measurements. Tell the RTIS Server and connected RTIS Clients to stop any running measurements.
...@@ -589,7 +639,7 @@ Tell the RTIS Server and connected RTIS Clients to stop any running measurements ...@@ -589,7 +639,7 @@ Tell the RTIS Server and connected RTIS Clients to stop any running measurements
## **set_counter** ## **set_counter**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>set_counter</b>(<i>serverIp, index=0, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L1054">[source]</a> <i>def</i> <b>set_counter</b>(<i>serverIp, index=0, logger=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtiscommon/-/blob/master/RTISCommon.py#L1049">[source]</a>
</p> </p>
A method to connect to the RTIS Server 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.
...@@ -622,7 +672,7 @@ Useful for connected applications. ...@@ -622,7 +672,7 @@ Useful for connected applications.
## **set_behaviour_active** ## **set_behaviour_active**
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L1084">[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/rtiscommon/-/blob/master/RTISCommon.py#L1079">[source]</a>
</p> </p>
A method to connect to the RTIS Server 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.
...@@ -651,7 +701,7 @@ Useful for connected applications. ...@@ -651,7 +701,7 @@ Useful for connected applications.
## **set_behaviour_passive** ## **set_behaviour_passive**
<p class="func-header"> <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/rtiscommon/-/blob/master/RTISCommon.py#L1111">[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/rtiscommon/-/blob/master/RTISCommon.py#L1106">[source]</a>
</p> </p>
A method to connect to the RTIS Server 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.
......
Clone repository
  • General Usage
  • Classes
    • RTISClientObj
    • Pose
    • dspSettings
  • Methods
    • dsp_worker_process
    • get_server_config
    • get_clients_and_configs
    • get_client_pose
    • reload_config
    • prepare
    • idle
    • stop
    • start
    • set_counter
    • set_behaviour_active
    • set_behaviour_passive