|
|
# RTIS Dev Documentation - Table of Content
|
|
|
- [**RTIS Dev Classes**](#rtis-dev-classes)
|
|
|
- [**RTISMeasurement**](#rtismeasurement)
|
|
|
- [**RTISSettings**](#rtissettings)
|
|
|
- [**MeasureExternalTriggerQueueThread**](#measureexternaltriggerqueuethread)
|
|
|
- [**MeasureExternalTriggerCallbackThread**](#measureexternaltriggercallbackthread)
|
|
|
- [**RTIS Dev Methods**](#rtis-dev-methods)
|
|
|
- [**open_connection**](#open_connection)
|
|
|
- [**close_connection**](#close_connection)
|
|
|
- [**set_recording_settings**](#set_recording_settings)
|
|
|
- [**set_processing_settings**](#set_processing_settings)
|
|
|
- [**get_current_settings**](#get_current_settings)
|
|
|
- [**set_settings_from_class**](#set_settings_from_class)
|
|
|
- [**get_premade_processing_settings_list**](#get_premade_processing_settings_list)
|
|
|
- [**get_premade_recording_settings_list**](#get_premade_recording_settings_list)
|
|
|
- [**prepare_processing**](#prepare_processing)
|
|
|
- [**unload_processing**](#unload_processing)
|
|
|
- [**get_raw_measurement**](#get_raw_measurement)
|
|
|
- [**get_signal_measurement**](#get_signal_measurement)
|
|
|
- [**get_processed_measurement**](#get_processed_measurement)
|
|
|
- [**process_measurement**](#process_measurement)
|
|
|
- [**set_counter**](#set_counter)
|
|
|
- [**set_behaviour**](#set_behaviour)
|
|
|
- [**get_firmware_version**](#get_firmware_version)
|
|
|
- [**create_measure_external_trigger_queue**](#create_measure_external_trigger_queue)
|
|
|
- [**create_measure_external_trigger_callback**](#create_measure_external_trigger_callback)
|
|
|
- [**toggle_amplifier**](#toggle_amplifier)
|
|
|
- [**toggle_external_triggers**](#toggle_external_triggers)
|
|
|
- [**reset_device**](#reset_device)
|
|
|
- [**set_log_mode**](#set_log_mode)
|
|
|
- [**set_custom_logger**](#set_custom_logger)
|
|
|
# **RTIS Dev Classes**
|
|
|
## **RTISMeasurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>RTISMeasurement</b>(<i>id, timestamp, behaviour, index, rawData, processedData=None </i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L100">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class storing all data and information on an RTIS device measurement.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Attributes:</b></td>
|
|
|
<td class="field-body" width="100%"><b>id : <i>string</i></b>
|
|
|
<p class="attr">
|
|
|
The unique identifier to identify this RTIS Client by.
|
|
|
</p>
|
|
|
<b>timestamp : <i>float</i></b>
|
|
|
<p class="attr">
|
|
|
The epoch timestamp of the measurement.
|
|
|
</p>
|
|
|
<b>behaviour : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
The sonar behaviour (active or passive).
|
|
|
</p>
|
|
|
<b>index : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
The internal measurement index.
|
|
|
</p>
|
|
|
<b>rawData : <i>Numpy ndarray</i></b>
|
|
|
<p class="attr">
|
|
|
This stores the raw data returned by the RTIS Device. This is stored as a list of uint32 values.
|
|
|
</p>
|
|
|
<b>processedData : <i>Numpy ndarray</i></b>
|
|
|
<p class="attr">
|
|
|
This stores the (partially) processed data that has gone through the processing pipeline as configured by the user.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
#### Methods
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>update_processed_data</b>(<i>self, processedData</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L162">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
If only the processData needs to be updated, use this function.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>processedData : <i>Numpy ndarray (None by default)</i></b>
|
|
|
<p class="attr">
|
|
|
This stores the (partially) processed data that has gone through the processing pipeline as configured by the user.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **RTISSettings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>RTISSettings</b>(<i>firmwareVersion</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L175">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class describing all the processing and recording settings related to RTIS devices.
|
|
|
Too many variables to describe here. Check the source-code for more information on which variables are available.
|
|
|
Can be converted to a dictionary.
|
|
|
|
|
|
<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="rtisdev/RTISDev.py#L327">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger.
|
|
|
To set the data queue correctly use `set_queue(dataQueue)` function.
|
|
|
the [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement) objects will then be put on this queue.
|
|
|
To start the thread use the `start()` function. To stop use the `stop_thread()` function.
|
|
|
By default using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) will gracefully end the script.
|
|
|
|
|
|
Use [`create_measure_external_trigger_queue(dataQueue)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#create_measure_external_trigger_queue) to make an easy to use the class.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a queue to save the measurement to and assign it to the thread.
|
|
|
|
|
|
```python
|
|
|
from multiprocessing import Process, Manager
|
|
|
|
|
|
manager = Manager()
|
|
|
dataQueue = manager.Queue()
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
```
|
|
|
|
|
|
#### Methods
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_queue</b>(<i>self, dataQueue</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L358">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the dataQueue to be used by the Thread to store the incoming [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement) objects on.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>dataQueue : <i>multiprocessing.Manager.Queue</i></b>
|
|
|
<p class="attr">
|
|
|
This is the data queue that will be used to store the RTISMeasurement objects on.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L369">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Stop the measurement thread gracefully.
|
|
|
|
|
|
<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>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L376">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get status of the thread if it should be stopped or not.
|
|
|
|
|
|
<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>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L382">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Main thread function to run continuously. Should not be used. Use `start()` instead.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **MeasureExternalTriggerCallbackThread**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>MeasureExternalTriggerCallbackThread</b>(<i>*args, **kwargs</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L428">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger.
|
|
|
To set the callback function correctly use `set_callback(callback)` function.
|
|
|
Your callback function should only have one argument, the [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement) data package.
|
|
|
To start the thread use the `start()` function. To stop use the `stop_thread()` function.
|
|
|
By default using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) will gracefully end the script.
|
|
|
|
|
|
Use [`create_measure_external_trigger_callback(save_callback)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#create_measure_external_trigger_callback) to make an easy to use the class.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a callback to save the measurement to disk.
|
|
|
|
|
|
```python
|
|
|
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
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
```
|
|
|
|
|
|
#### Methods
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_callback</b>(<i>self, callback</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L465">[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">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>callback : <i>method with one argument (RTISMeasurement)</i></b>
|
|
|
<p class="attr">
|
|
|
This is the method that will be used as a callback when a new measurement is triggered by the external trigger. This function should only require one argument, the <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement"><code>RTISMeasurement</code></a> object containing the measurement data.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L476">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Stop the measurement thread gracefully.
|
|
|
|
|
|
<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>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L483">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get status of the thread if it should be stopped or not.
|
|
|
|
|
|
<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>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L489">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Main thread function to run continuously. Should not be used. Use `start()` instead.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
# **RTIS Dev Methods**
|
|
|
## **open_connection**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>open_connection</b>(<i>port='/dev/ttyACM0'</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L1529">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to connect to the port of the RTIS Hardware.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<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>
|
|
|
<p class="attr">
|
|
|
name of the port.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **close_connection**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>close_connection</b>(<i></i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L1575">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The public function to manually close the connection to the RTIS device.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **set_recording_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_recording_settings</b>(<i>premade=None, jsonPath=None, callCustom=None, microphoneSamples=163840, microphoneSampleFrequency=4500000, callSampleFrequency=450000, callDuration=2.5, callMinimumFrequency= 25000, callMaximumFrequency=50000, callEmissions=1</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L1591">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set the recording settings. All parameters are optional and most have default values.
|
|
|
Please read their decription carefully.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>premade : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
When using get_premade_recording_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
</p>
|
|
|
<b>jsonPath : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can also store the recording settings in a json file. To load the recording settings from a json file, please use the absolute path to this json file with this argument. See the README.md for more information.
|
|
|
</p>
|
|
|
<b>callCustom : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can use a custom call pulse to emmit from the RTIS Device in active mode. To load the custom pulse, use the absolute path to the csv file with this argument. See the README.md for more information.
|
|
|
</p>
|
|
|
<b>microphoneSamples : <i>int (default = 163840)</i></b>
|
|
|
<p class="attr">
|
|
|
The amount of microphone samples. Must be dividable by 32768.
|
|
|
</p>
|
|
|
<b>microphoneSampleFrequency : <i>int (default = 4500000)</i></b>
|
|
|
<p class="attr">
|
|
|
The microphone sample frequency (without subsampling of PDM).
|
|
|
</p>
|
|
|
<b>callSampleFrequency : <i>int (default = 450000)</i></b>
|
|
|
<p class="attr">
|
|
|
The chosen sample frequency of the call. Must by larger then 160 KHz and smaller then 2 MHz.
|
|
|
</p>
|
|
|
<b>callDuration : <i>float (default = 2.5)</i></b>
|
|
|
<p class="attr">
|
|
|
The duration in miliseconds of the call.
|
|
|
</p>
|
|
|
<b>callMinimumFrequency : <i>int (default = 25000)</i></b>
|
|
|
<p class="attr">
|
|
|
The minimum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
</p>
|
|
|
<b>callMaximumFrequency : <i>int (default = 50000)</i></b>
|
|
|
<p class="attr">
|
|
|
The maximum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
</p>
|
|
|
<b>callEmissions : <i>int (default = 1)</i></b>
|
|
|
<p class="attr">
|
|
|
The amount of times the pulse should be emitted during one measurement.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create settings from a premade setup.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#get_premade_processing_settings_list).
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_recording_settings(premade="short_20_80")
|
|
|
```
|
|
|
|
|
|
Create settings from a json file.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use auto-generated pulse call to emit.
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneSamples" : 294912,
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"callSampleFrequency" : 450000,
|
|
|
"callDuration" : 2.5,
|
|
|
"callMinimumFrequency" : 25000,
|
|
|
"callMaximumFrequency" : 50000,
|
|
|
"callEmissions": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create settings from a json file.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use manually generated call.
|
|
|
It has to be available on the given path and have the right format!
|
|
|
An example of such a custom call can be found [here](config/premadeSettings/recording/flutter.csv).
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneSamples" : 16777216,
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"callSampleFrequency" : 450000,
|
|
|
"callCustom": "mycall.csv",
|
|
|
"callEmissions": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create full custom settings with the arguments. All arguments that aren't filled in will use default values.
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(microphoneSamples=294912, callDuration=3, callMinimumFrequency=25000,
|
|
|
callMaximumFrequency=80000)
|
|
|
```
|
|
|
|
|
|
Load in manually generated call. This requires the file to exist on the path and have the right format!
|
|
|
An example of such a custom call can be found [here](config/premadeSettings/recording/flutter.csv).
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(callCustom="mycall.csv")
|
|
|
```
|
|
|
|
|
|
## **set_processing_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_processing_settings</b>(<i>premade=None, jsonPath=None, customPath=None, microphoneLayout='eRTIS_V3.14159265', mode=1, directions=181, minRange= 0.5, maxRange=5, microphoneSampleFrequency=4500000, pdmEnable=True, matchedFilterEnable=True, beamformingEnable=True, enveloppeEnable=True, cleanEnable=True, preloadToggle=True</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L1751">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set the processing settings. All parameters are optional and most have default values.
|
|
|
Please read their decription carefully.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>premade : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
When using get_premade_processing_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
</p>
|
|
|
<b>jsonPath : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can also store the processing settings in a json file. To load the processing settings from a json file, please use the absolute path to this json file with this argument. See the README.md for more information.
|
|
|
</p>
|
|
|
<b>customPath : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can use a custom set of processing files (delaymatrix.csv, directions.csv and ranges.csv). To load the custom files use the absolute path to the folder where these csvs are located. See the README.md for more information.
|
|
|
</p>
|
|
|
<b>microphoneLayout : <i>String (default = eRTIS_V3.14159265)</i></b>
|
|
|
<p class="attr">
|
|
|
Identifier of the microphone layout used for this configuration.
|
|
|
</p>
|
|
|
<b>mode : <i>int (default = 1)</i></b>
|
|
|
<p class="attr">
|
|
|
Defines if using 3D or 2D processing. If set to 1 a 2D horizontal planedirection layout will be generated. When set to 0 a 3D equal distance direction layout will be generated.
|
|
|
</p>
|
|
|
<b>directions : <i>int (default = 181)</i></b>
|
|
|
<p class="attr">
|
|
|
Defines how many directions the layout should generate.
|
|
|
</p>
|
|
|
<b>minRange : <i>float (default = 0.5)</i></b>
|
|
|
<p class="attr">
|
|
|
The minimum distance in meters of the energyscape to generate.
|
|
|
</p>
|
|
|
<b>maxRange : <i>float (default = 5)</i></b>
|
|
|
<p class="attr">
|
|
|
The maximum distance in meters of the energyscape to generate.
|
|
|
</p>
|
|
|
<b>microphoneSampleFrequency : <i>int (default = 4500000)</i></b>
|
|
|
<p class="attr">
|
|
|
The microphone sample frequency (without subsampling of PDM).
|
|
|
</p>
|
|
|
<b>pdmEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for PDM filtering part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>matchedFilterEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for matched filter part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>beamformingEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for beamforming part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>enveloppeEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for enveloppe part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>cleanEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for cleaning part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>preloadToggle : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for using RTIS CUDA preloading
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create settings from a premade setup with all processing steps on.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#get_premade_processing_settings_list).
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(premade="3D_5m_3000", pdmEnable=True, matchedFilterEnable=True,
|
|
|
beamformingEnable=True, enveloppeEnable=True, cleanEnable=True, preloadToggle=True)
|
|
|
```
|
|
|
|
|
|
You don't have to define all the processing steps, as they are all on by default.
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(premade="3D_5m_3000")
|
|
|
```
|
|
|
|
|
|
Create settings from a premade setup with only part of the processing steps enabled and no preloading.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#get_premade_processing_settings_list).
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181", pdmEnable=True, matchedFilterEnable=True,
|
|
|
beamformingEnable=False, enveloppeEnable=False, cleanEnable=False)
|
|
|
```
|
|
|
|
|
|
Create settings from a json file with full processing settings on.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use auto-generated processing files.
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneLayout" : "eRTIS_V3.14159265",
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"minRange" : 0.5,
|
|
|
"maxRange" : 5,
|
|
|
"directions": 181,
|
|
|
"2D": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create settings from a json file with full processing settings on.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use manually generated processing files.
|
|
|
They have to be available on these paths and have the right format!
|
|
|
An example of such custom processing files can be found [here](config/premadeSettings/processing/).
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneLayout" : "eRTIS_V3.14159265",
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"directionsCustom": "./directions.csv",
|
|
|
"delayMatrixCustom": ".premade/delaymatrix.csv",
|
|
|
"rangesCustom": ".premade/ranges.csv"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create full custom settings with the arguments. All arguments that aren't filled in will use default values.
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(mode = 0, directions = 1337, minRange = 0.5, maxRange = 10)
|
|
|
```
|
|
|
|
|
|
Load in manually generated processing files. This requires 3 files to exist in the given path:
|
|
|
delaymatrix.csv, directions.csv and ranges.csv.
|
|
|
An example of such custom processing files can be found [here](config/premadeSettings/processing/).
|
|
|
|
|
|
```python
|
|
|
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="rtisdev/RTISDev.py#L1948">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtissettings) object of the current DSP Settings.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>settings : <i>RTISSettings</i></b>
|
|
|
<p class="attr">
|
|
|
The complete class containing all RTIS settings for measuring and processing. Returns 'None' on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **set_settings_from_class**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_settings_from_class</b>(<i>settings</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L1962">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to set the wanted DSP settings from an [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtissettings) object. These can be created
|
|
|
with the get_custom_settings() or get_settings() functions.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>settings : <i>RTISSettings</i></b>
|
|
|
<p class="attr">
|
|
|
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **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="rtisdev/RTISDev.py#L1991">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to get a list of names of all the available premade settings for processing.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>recordingSettings : <i>list of strings</i></b>
|
|
|
<p class="attr">
|
|
|
A list holding all the names of available settings that can be loaded.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **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="rtisdev/RTISDev.py#L2006">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to get a list of names of all the available premade settings for recording.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>recordingSettings : <i>list of strings</i></b>
|
|
|
<p class="attr">
|
|
|
A list holding all the names of available settings that can be loaded.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **prepare_processing**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>prepare_processing</b>(<i></i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2020">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to start the CUDA workers for looped measurements. Not required for processing!
|
|
|
But speeds up the workflow significantly if doing many measurements.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **unload_processing**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>unload_processing</b>(<i></i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2048">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to stop the CUDA workers. Only required if actually using preloading of workers.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **get_raw_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_raw_measurement</b>(<i>behaviour=False</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2061">[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#rtismeasurement) object.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>behaviour : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
A configuration toggle to read the required sonar behaviour (active or passive).
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the raw measurement of the RTIS device with the raw binary data under <code>measurement.rawData</code>.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a connection, set recording settings and make a raw measurement with passive behaviour.
|
|
|
|
|
|
```python
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
measurement = rtisdev.get_raw_measurement(True)
|
|
|
```
|
|
|
|
|
|
## **get_signal_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_signal_measurement</b>(<i>behaviour=False</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2095">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to start an RTIS sonar measurement and process it with only PDM filtering
|
|
|
and subsampling to get the (microphone) signals return them in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement) object.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>behaviour : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
A configuration toggle to read the required sonar behaviour (active or passive).
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the signal measurement of the RTIS device under <code>measurement.processedData</code> and the raw binary data under <code>measurement.rawData</code>.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a connection, set recording and processing settings and make a signal measurement with active behaviour.
|
|
|
|
|
|
```python
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
signal_measurement = rtisdev.get_signal_measurement(True)
|
|
|
```
|
|
|
|
|
|
## **get_processed_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_processed_measurement</b>(<i>behaviour=False</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2138">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to start an RTIS sonar measurement and process it and return the raw and processed data
|
|
|
in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement) object.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>behaviour : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
A configuration toggle to read the required sonar behaviour (active or passive).
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the processed measurement of the RTIS device under <code>measurement.processedData</code> and the raw binary data under <code>measurement.rawData</code>.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a connection, set recording and processing settings and make a processed measurement with active behaviour.
|
|
|
|
|
|
```python
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
processed_measurement = rtisdev.get_processed_measurement(True)
|
|
|
```
|
|
|
|
|
|
## **process_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>process_measurement</b>(<i>measurement</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2181">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The high level function to process a raw RTIS sonar measurement from a [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement) object
|
|
|
and return the raw and processed data in a new [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement) object.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the raw measurement of the RTIS device.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>packageOut : <i>RTISMeasurement object</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the processed measurement of the RTIS device under <code>measurement.processedData</code> and the raw binary data under <code>measurement.rawData</code>.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a connection, set recording and processing settings and make a raw measurement with active behaviour.
|
|
|
Then afterwards process it.
|
|
|
|
|
|
```python
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
measurement = rtisdev.get_raw_measurement(True)
|
|
|
processed_measurement = rtisdev.process_measurement(measurement)
|
|
|
```
|
|
|
|
|
|
## **set_counter**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_counter</b>(<i>newCount=0</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2225">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
High level function to set the internal measurement counter of the sonar hardware.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>newCount : <i>int (default = 0)</i></b>
|
|
|
<p class="attr">
|
|
|
The new count index to set.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **set_behaviour**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_behaviour</b>(<i>mode</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2248">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the behaviour of the sonar hardware to passive or active
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
the behaviour mode chosen. False = passive True = active
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **get_firmware_version**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_firmware_version</b>(<i></i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2270">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get the firmware version of the internal RTIS firmware used on the device.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>firmwareVersion : <i>string</i></b>
|
|
|
<p class="attr">
|
|
|
returns the firmware version as a string in 'vMajor.Minor.Bugfix' format. Returns 'undefined' on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **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="rtisdev/RTISDev.py#L2284">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Thread that will be waiting for an external trigger to measure from
|
|
|
the RTIS Device and afterwards put this measurement on a data queue.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>dataQueue : <i>multiprocessing.Manager.Queue</i></b>
|
|
|
<p class="attr">
|
|
|
On this queue the <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement"><code>RTISMeasurement</code></a> objects will be put after an external trigger starts a new measurement.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>th : <i>MeasureExternalTriggerQueueThread</i></b>
|
|
|
<p class="attr">
|
|
|
Class instance of the Thread super class that can then be started with '.start()' and waited for with <code>.join()</code> for example. It can be closed gracefully with the '.stop_thread()' function. This will also be done automatically when <code>signal.SIGINT</code> (ex. <kbd>CTRL</kbd>+<kbd>C</kbd>) is triggered.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a queue to save the measurement to and assign it to the thread.
|
|
|
|
|
|
```python
|
|
|
from multiprocessing import Process, Manager
|
|
|
|
|
|
manager = Manager()
|
|
|
dataQueue = manager.Queue()
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
```
|
|
|
|
|
|
## **create_measure_external_trigger_callback**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>create_measure_external_trigger_callback</b>(<i>callback</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2322">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Thread that will be waiting for an external trigger to measure from
|
|
|
the RTIS Device and afterwards put this measurement on a data queue.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>callback : <i>method with one argument of type RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
This is the method that will be used as a callback when a new measurement is triggered by the external trigger. This function should only require one argument, the <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev#rtismeasurement"><code>RTISMeasurement</code></a> object containing the measurement data.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>th : <i>MeasureExternalTriggerCallbackThread</i></b>
|
|
|
<p class="attr">
|
|
|
Class instance of the Thread super class that can then be started with <code>.start()</code> and waited for with <code>.join()</code> for example. It can be closed gracefully with the <code>.stop_thread()</code> function. This will also be done automatically when <em>signal.SIGINT</em> (ex. <kbd>CTRL</kbd>+<kbd>C</kbd>) is triggered.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a callback to save the measurement to disk.
|
|
|
|
|
|
```python
|
|
|
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
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
```
|
|
|
|
|
|
## **toggle_amplifier**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>toggle_amplifier</b>(<i>mode</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2368">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Enable/disable the high voltage amplifier's step up controller.
|
|
|
It is enabled by default so has to be manually disabled if wanted. This will save on power usage and heat production.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
the behaviour mode chosen. <code>False</code> = disable <code>True</code> = enable
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **toggle_external_triggers**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>toggle_external_triggers</b>(<i>mode</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2391">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Enable/disable external triggers being able to start a measurement on the RTIS device.
|
|
|
They are enabled by default so have to be manually disabled.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
the behaviour mode chosen. <code>False</code> = disable <code>True</code> = enable
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **reset_device**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>reset_device</b>(<i>stm32pin=7</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2414">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to reset the RTIS device hardware.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>stm32pin : <i>Integer (default = 7)</i></b>
|
|
|
<p class="attr">
|
|
|
Change the GPIO pin used for the STM32 connection. Please ask a CoSys-Lab member for the correct pin number if not working as intended with the default value.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, <code>False</code> on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **set_log_mode**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_log_mode</b>(<i>mode</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2462">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set the logging level of the RTIS Dev module.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
Disable or configure log the level. 0 = off 1 = only warnings and errors 2(default) = includes info 3 = includes debug
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **set_custom_logger**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_custom_logger</b>(<i>customLogger</i>) <a class="src-href" target="_blank" href="rtisdev/RTISDev.py#L2492">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set a custom logger to be used by RTIS Dev.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>customLogger : <i>logging.Logger</i></b>
|
|
|
<p class="attr">
|
|
|
The custom logger to use.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
https://cosysgit.uantwerpen.be/rtis-software/rtisdev |
|
|
\ No newline at end of file |