|
|
# **RTIS Dev Documentation - Table of Content**
|
|
|
|
|
|
- [RTIS Dev Classes](#rtis-dev-classes)
|
|
|
- [General Example](#general-example)
|
|
|
- [Classes](#classes)
|
|
|
- [RTISMeasurement](#rtismeasurement)
|
|
|
- [RTISSettings](#rtissettings)
|
|
|
- [MeasureExternalTriggerQueueThread](#measureexternaltriggerqueuethread)
|
|
|
- [MeasureExternalTriggerCallbackThread](#measureexternaltriggercallbackthread)
|
|
|
- [RTIS Dev Methods](#rtis-dev-methods)
|
|
|
- [Methods](#methods)
|
|
|
- [open_connection](#open_connection)
|
|
|
- [close_connection](#close_connection)
|
|
|
- [set_recording_settings](#set_recording_settings)
|
... | ... | @@ -33,12 +34,69 @@ |
|
|
- [set_log_mode](#set_log_mode)
|
|
|
- [set_custom_logger](#set_custom_logger)
|
|
|
|
|
|
# **RTIS Dev Classes**
|
|
|
# **General Example**
|
|
|
|
|
|
Here is a small example that goes over most basic steps:
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
import matplotlib.pyplot as plt
|
|
|
import numpy as np
|
|
|
|
|
|
# Open a connection to the RTIS Device over the default serial port.
|
|
|
success_connect = rtisdev.open_connection(allowDebugMode=True)
|
|
|
|
|
|
# Set the default recording settings with 163840 samples and a call sweep between 25 and 50 KHz.
|
|
|
success_settings_record = rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
|
|
|
# Enable all processing steps and preload them with RTIS CUDA. This will produce a 2D energyscape with 181 directions
|
|
|
# with a maximum distance of 5m.
|
|
|
success_settings_processing = rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
|
|
|
# Get the used settings as a RTISSettings object.
|
|
|
settings = rtisdev.get_current_settings()
|
|
|
|
|
|
# Get an ACTIVE measurement (protect your ears!) in raw data.
|
|
|
measurement = rtisdev.get_raw_measurement(True)
|
|
|
|
|
|
# Store the raw data of that measurement as a binary file. This can be opened in another application for further work.
|
|
|
# For an example in MATLAB, see below.
|
|
|
raw_data_sonar = measurement.rawData.tobytes()
|
|
|
file_handle_data = open("test_measurement_ " + str(measurement.index) + ".bin", "wb")
|
|
|
file_handle_data.write(raw_data_sonar)
|
|
|
file_handle_data.close()
|
|
|
|
|
|
# Process that raw measurement to an energyscape using the configuration chosen earlier.
|
|
|
processed_measurement = rtisdev.process_measurement(measurement)
|
|
|
|
|
|
# Get a new ACTIVE measurement (protect your ears!) in both raw and processed data formats directly.
|
|
|
new_processed_measurement = rtisdev.get_processed_measurement(True)
|
|
|
plt.imshow(np.transpose(new_processed_measurement.processedData), cmap="hot", interpolation='nearest')
|
|
|
|
|
|
# Plot the 2D energyscape of this processed measurement.
|
|
|
plt.xlabel("Directions (degrees)")
|
|
|
plt.ylabel("Range (meters)")
|
|
|
indexes_x = np.arange(0, new_processed_measurement.processedData.shape[0], 20)
|
|
|
labels_x = np.round(np.rad2deg(settings.directions[indexes_x, 0])).astype(int)
|
|
|
indexes_y = np.arange(0, new_processed_measurement.processedData.shape[1], 100)
|
|
|
labels_y = settings.ranges[indexes_y]
|
|
|
fmt_x = lambda x: "{:.0f}°".format(x)
|
|
|
fmt_y = lambda x: "{:.2f}m".format(x)
|
|
|
plt.xticks(indexes_x, [fmt_x(i) for i in labels_x])
|
|
|
plt.yticks(indexes_y, [fmt_y(i) for i in labels_y])
|
|
|
plt.title("RTIS Dev - 2D Energyscape Example")
|
|
|
ax = plt.gca()
|
|
|
ax.invert_yaxis()
|
|
|
ax.set_aspect("auto")
|
|
|
plt.show()
|
|
|
```
|
|
|
|
|
|
# **Classes**
|
|
|
|
|
|
## **RTISMeasurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>RTISMeasurement</b>(<i>id: str='', timestamp: float=0, behaviour: bool=False, index: int=0, rawData: np.ndarray=None, processedData: np.ndarray=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L216">[source]</a>
|
|
|
<i>class</i> <b>RTISMeasurement</b>(<i>id: str='', timestamp: float=0, behaviour: bool=False, index: int=0, rawData: np.ndarray=None, processedData: np.ndarray=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L284">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class storing all data and information on an RTIS device measurement.
|
... | ... | @@ -84,7 +142,7 @@ Class storing all data and information on an RTIS device measurement. |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>update_processed_data</b>(<i>self, processedData: np.ndarray</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L272">[source]</a>
|
|
|
<i></i> <b>update_processed_data</b>(<i>self, processedData: np.ndarray</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L340">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
If only the processData needs to be updated, use this function.
|
... | ... | @@ -108,7 +166,7 @@ If only the processData needs to be updated, use this function. |
|
|
## **RTISSettings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>RTISSettings</b>(<i>firmwareVersion, configName=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L285">[source]</a>
|
|
|
<i>class</i> <b>RTISSettings</b>(<i>firmwareVersion, configName=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L353">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class describing all the processing and recording settings related to RTIS devices.
|
... | ... | @@ -122,10 +180,48 @@ Can be converted to a dictionary. |
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
#### Methods
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_recording_settings</b>(<i>self, adcSignal, dacSignal, microphoneSampleFrequency, dacSampleFrequency, microphoneSamples, callDuration, callMinimumFrequency, callMaximumFrequency, callEmissions</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L377">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_processing_settings</b>(<i>self, workers, pdmEnable, matchedFilterEnable, beamformingEnable, enveloppeEnable, cleanEnable, preloadToggle, delayMatrix, directions, ranges, microphoneLayout</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L398">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **MeasureExternalTriggerQueueThread**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>MeasureExternalTriggerQueueThread</b>(<i>*args, **kwargs</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L438">[source]</a>
|
|
|
<i>class</i> <b>MeasureExternalTriggerQueueThread</b>(<i>*args, **kwargs</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L506">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger.
|
... | ... | @@ -163,7 +259,7 @@ measure_thread.join() |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_queue</b>(<i>self, dataQueue</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L469">[source]</a>
|
|
|
<i></i> <b>set_queue</b>(<i>self, dataQueue</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L537">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the dataQueue to be used by the Thread to store the incoming [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects on.
|
... | ... | @@ -187,7 +283,7 @@ Set the dataQueue to be used by the Thread to store the incoming [`RTISMeasureme |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L480">[source]</a>
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L548">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Stop the measurement thread gracefully.
|
... | ... | @@ -204,7 +300,7 @@ Stop the measurement thread gracefully. |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L487">[source]</a>
|
|
|
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L555">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get status of the thread if it should be stopped or not.
|
... | ... | @@ -221,7 +317,7 @@ Get status of the thread if it should be stopped or not. |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L493">[source]</a>
|
|
|
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L561">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Main thread function to run continuously. Should not be used. Use `start()` instead.
|
... | ... | @@ -238,7 +334,7 @@ Main thread function to run continuously. Should not be used. Use `start()` inst |
|
|
## **MeasureExternalTriggerCallbackThread**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>MeasureExternalTriggerCallbackThread</b>(<i>*args, **kwargs</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L541">[source]</a>
|
|
|
<i>class</i> <b>MeasureExternalTriggerCallbackThread</b>(<i>*args, **kwargs</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L609">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger.
|
... | ... | @@ -264,13 +360,13 @@ Create a callback to save the measurement to disk. |
|
|
index = 0
|
|
|
|
|
|
def save_callback(measurement=None):
|
|
|
if measurement != None:
|
|
|
if measurement.rawData is not None:
|
|
|
data_sonar = measurement.rawData.tobytes()
|
|
|
file_handle_data = open(str(index) + ".bin","wb")
|
|
|
file_handle_data.write(data_sonar)
|
|
|
file_handle_data.close()
|
|
|
index = index + 1
|
|
|
if measurement != None:
|
|
|
if measurement.rawData is not None:
|
|
|
data_sonar = measurement.rawData.tobytes()
|
|
|
file_handle_data = open(str(index) + ".bin","wb")
|
|
|
file_handle_data.write(data_sonar)
|
|
|
file_handle_data.close()
|
|
|
index = index + 1
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
|
|
|
measure_thread.start()
|
... | ... | @@ -282,7 +378,7 @@ measure_thread.join() |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_callback</b>(<i>self, callback</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L578">[source]</a>
|
|
|
<i></i> <b>set_callback</b>(<i>self, callback</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L646">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
|
... | ... | @@ -306,7 +402,7 @@ measure_thread.join() |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L589">[source]</a>
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L657">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Stop the measurement thread gracefully.
|
... | ... | @@ -323,7 +419,7 @@ Stop the measurement thread gracefully. |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L596">[source]</a>
|
|
|
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L664">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get status of the thread if it should be stopped or not.
|
... | ... | @@ -340,7 +436,7 @@ Get status of the thread if it should be stopped or not. |
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L602">[source]</a>
|
|
|
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L670">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Main thread function to run continuously. Should not be used. Use `start()` instead.
|
... | ... | @@ -354,12 +450,12 @@ Main thread function to run continuously. Should not be used. Use `start()` inst |
|
|
|
|
|
|
|
|
|
|
|
# **RTIS Dev Methods**
|
|
|
# **Methods**
|
|
|
|
|
|
## **open_connection**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>open_connection</b>(<i>port: string='/dev/ttyACM0'</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L1838">[source]</a>
|
|
|
<i>def</i> <b>open_connection</b>(<i>port: string='/dev/ttyACM0', allowDebugMode: bool=False </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L1906">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to connect to the port of the RTIS Hardware.
|
... | ... | @@ -370,9 +466,13 @@ The function to connect to the port of the RTIS Hardware. |
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>port : <i>string (default '/dev/ttyACM0')</i></b>
|
|
|
<td class="field-body" width="100%"><b>port : <i>string (default = '/dev/ttyACM0')</i></b>
|
|
|
<p class="attr">
|
|
|
name of the port.
|
|
|
Name of the port.
|
|
|
</p>
|
|
|
<b>allowDebugMode : <i>bool (default = False)</i></b>
|
|
|
<p class="attr">
|
|
|
When enabled, if a connection can not be made to a real RTIS Deviceto the chosen port, it will instead automatically go into a debug mode where a virtual RTIS device is used instead of throwing a exception. This is mostly for debugging and testing of the library.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
... | ... | @@ -390,7 +490,7 @@ The function to connect to the port of the RTIS Hardware. |
|
|
## **close_connection**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>close_connection</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L1883">[source]</a>
|
|
|
<i>def</i> <b>close_connection</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L1967">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The public function to manually close the connection to the RTIS device.
|
... | ... | @@ -414,7 +514,7 @@ The public function to manually close the connection to the RTIS device. |
|
|
## **set_recording_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_recording_settings</b>(<i>premade: str=None, jsonPath: str=None, callCustom: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L1910">[source]</a>
|
|
|
<i>def</i> <b>set_recording_settings</b>(<i>premade: str=None, jsonPath: str=None, callCustom: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L1994">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set the recording settings. All parameters are optional and most have default values.
|
... | ... | @@ -547,7 +647,7 @@ rtisdev.set_processing_settings(callCustom="mycall.csv") |
|
|
## **set_processing_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_processing_settings</b>(<i>premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, microphoneSampleFrequency: int=4500000, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2091">[source]</a>
|
|
|
<i>def</i> <b>set_processing_settings</b>(<i>premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, microphoneSampleFrequency: int=4500000, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2175">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set the processing settings. All parameters are optional and most have default values.
|
... | ... | @@ -710,7 +810,7 @@ rtisdev.set_processing_settings(customPath="mysettingsfolder") |
|
|
## **get_current_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2297">[source]</a>
|
|
|
<i>def</i> <b>get_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2381">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object of the current settings for processing and recording.
|
... | ... | @@ -734,7 +834,7 @@ The function returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-so |
|
|
## **clear_current_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>clear_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2314">[source]</a>
|
|
|
<i>def</i> <b>clear_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2398">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to clear the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) configuration.
|
... | ... | @@ -751,7 +851,7 @@ The function to clear the current applied [`RTISSettings`](https://cosysgit.uant |
|
|
## **get_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_settings</b>(<i>recordingPremade: str=None, recordingJsonPath: str=None, recordingCallCustom: str=None, processingPremade: str=None, processingJsonPath: str=None, processingCustomPath: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2323">[source]</a>
|
|
|
<i>def</i> <b>get_settings</b>(<i>recordingPremade: str=None, recordingJsonPath: str=None, recordingCallCustom: str=None, processingPremade: str=None, processingJsonPath: str=None, processingCustomPath: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2407">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function returns a [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object with all chosen recording and processing settings based on the
|
... | ... | @@ -880,7 +980,7 @@ the settings object. |
|
|
## **set_settings_from_class**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_settings_from_class</b>(<i>settings: RTISSettings</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2522">[source]</a>
|
|
|
<i>def</i> <b>set_settings_from_class</b>(<i>settings: RTISSettings</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2606">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to set the wanted settings from an [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object. These can be created
|
... | ... | @@ -912,7 +1012,7 @@ with the get_custom_settings() or get_settings() functions. |
|
|
## **get_premade_processing_settings_list**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_premade_processing_settings_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2551">[source]</a>
|
|
|
<i>def</i> <b>get_premade_processing_settings_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2635">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to get a list of names of all the available premade settings for processing.
|
... | ... | @@ -936,7 +1036,7 @@ The function to get a list of names of all the available premade settings for pr |
|
|
## **get_premade_recording_settings_list**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_premade_recording_settings_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2566">[source]</a>
|
|
|
<i>def</i> <b>get_premade_recording_settings_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2650">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to get a list of names of all the available premade settings for recording.
|
... | ... | @@ -960,7 +1060,7 @@ The function to get a list of names of all the available premade settings for re |
|
|
## **prepare_processing**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>prepare_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2580">[source]</a>
|
|
|
<i>def</i> <b>prepare_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2664">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to start the CUDA workers for looped measurements. Not required for processing.
|
... | ... | @@ -985,7 +1085,7 @@ But speeds up the workflow significantly if doing many measurements. |
|
|
## **unload_processing**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>unload_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2605">[source]</a>
|
|
|
<i>def</i> <b>unload_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2689">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to stop the CUDA workers. Only required if actually using preloading of workers.
|
... | ... | @@ -1009,7 +1109,7 @@ The high level function to stop the CUDA workers. Only required if actually usin |
|
|
## **get_raw_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_raw_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2618">[source]</a>
|
|
|
<i>def</i> <b>get_raw_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2702">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to start an RTIS sonar measurement and return the raw data in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object.
|
... | ... | @@ -1048,7 +1148,7 @@ measurement = rtisdev.get_raw_measurement(True) |
|
|
## **get_signal_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_signal_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2650">[source]</a>
|
|
|
<i>def</i> <b>get_signal_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2734">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to start an RTIS sonar measurement and process it with only PDM filtering
|
... | ... | @@ -1089,7 +1189,7 @@ signal_measurement = rtisdev.get_signal_measurement(True) |
|
|
## **get_processed_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_processed_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2688">[source]</a>
|
|
|
<i>def</i> <b>get_processed_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2772">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to start an RTIS sonar measurement and process it and return the raw and processed data
|
... | ... | @@ -1130,7 +1230,7 @@ processed_measurement = rtisdev.get_processed_measurement(True) |
|
|
## **process_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>process_measurement</b>(<i>measurement: RTISMeasurement</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2726">[source]</a>
|
|
|
<i>def</i> <b>process_measurement</b>(<i>measurement: RTISMeasurement</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2810">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to process a raw RTIS sonar measurement from a [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object
|
... | ... | @@ -1173,7 +1273,7 @@ processed_measurement = rtisdev.process_measurement(measurement) |
|
|
## **set_counter**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_counter</b>(<i>newCount: int=0</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2765">[source]</a>
|
|
|
<i>def</i> <b>set_counter</b>(<i>newCount: int=0</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2849">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
High level function to set the internal measurement counter of the sonar hardware.
|
... | ... | @@ -1204,7 +1304,7 @@ High level function to set the internal measurement counter of the sonar hardwar |
|
|
## **set_behaviour**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_behaviour</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2788">[source]</a>
|
|
|
<i>def</i> <b>set_behaviour</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2872">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the behaviour of the sonar hardware to passive or active. This is only necessary if using external
|
... | ... | @@ -1238,7 +1338,7 @@ argument to define the sonar behaviour. |
|
|
## **get_firmware_version**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_firmware_version</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2813">[source]</a>
|
|
|
<i>def</i> <b>get_firmware_version</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2897">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get the firmware version of the internal RTIS firmware used on the device.
|
... | ... | @@ -1262,7 +1362,7 @@ Get the firmware version of the internal RTIS firmware used on the device. |
|
|
## **create_measure_external_trigger_queue**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>create_measure_external_trigger_queue</b>(<i>dataQueue </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2828">[source]</a>
|
|
|
<i>def</i> <b>create_measure_external_trigger_queue</b>(<i>dataQueue </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2912">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Thread that will be waiting for an external trigger to measure from
|
... | ... | @@ -1307,7 +1407,7 @@ measure_thread.join() |
|
|
## **create_measure_external_trigger_callback**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>create_measure_external_trigger_callback</b>(<i>callback: Callable[[ RTISMeasurement], any]</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2866">[source]</a>
|
|
|
<i>def</i> <b>create_measure_external_trigger_callback</b>(<i>callback: Callable[[ RTISMeasurement], any]</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2950">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Thread that will be waiting for an external trigger to measure from
|
... | ... | @@ -1342,13 +1442,13 @@ Create a callback to save the measurement to disk. |
|
|
index = 0
|
|
|
|
|
|
def save_callback(measurement=None):
|
|
|
if measurement != None:
|
|
|
if measurement.rawData is not None:
|
|
|
data_sonar = measurement.rawData.tobytes()
|
|
|
file_handle_data = open(str(index) + ".bin","wb")
|
|
|
file_handle_data.write(data_sonar)
|
|
|
file_handle_data.close()
|
|
|
index = index + 1
|
|
|
if measurement != None:
|
|
|
if measurement.rawData is not None:
|
|
|
data_sonar = measurement.rawData.tobytes()
|
|
|
file_handle_data = open(str(index) + ".bin","wb")
|
|
|
file_handle_data.write(data_sonar)
|
|
|
file_handle_data.close()
|
|
|
index = index + 1
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
|
|
|
measure_thread.start()
|
... | ... | @@ -1358,7 +1458,7 @@ measure_thread.join() |
|
|
## **toggle_amplifier**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>toggle_amplifier</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2913">[source]</a>
|
|
|
<i>def</i> <b>toggle_amplifier</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2997">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Enable/disable the high voltage amplifier's step up controller.
|
... | ... | @@ -1390,7 +1490,7 @@ It is enabled by default so has to be manually disabled if wanted. This will sav |
|
|
## **toggle_external_triggers**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>toggle_external_triggers</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2936">[source]</a>
|
|
|
<i>def</i> <b>toggle_external_triggers</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3020">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Enable/disable external triggers being able to start a measurement on the RTIS device.
|
... | ... | @@ -1422,7 +1522,7 @@ They are enabled by default so have to be manually disabled. |
|
|
## **reset_device**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>reset_device</b>(<i>stm32pin: int=7</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2959">[source]</a>
|
|
|
<i>def</i> <b>reset_device</b>(<i>stm32pin: int=7</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3043">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to reset the RTIS device hardware.
|
... | ... | @@ -1453,7 +1553,7 @@ The function to reset the RTIS device hardware. |
|
|
## **set_log_mode**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_log_mode</b>(<i>mode: int</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3007">[source]</a>
|
|
|
<i>def</i> <b>set_log_mode</b>(<i>mode: int</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3091">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set the logging level of the RTIS Dev module.
|
... | ... | @@ -1477,7 +1577,7 @@ The function to set the logging level of the RTIS Dev module. |
|
|
## **set_custom_logger**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_custom_logger</b>(<i>customLogger: logging.Logger</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3037">[source]</a>
|
|
|
<i>def</i> <b>set_custom_logger</b>(<i>customLogger: logging.Logger</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3121">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set a custom logger to be used by RTIS Dev.
|
... | ... | |