Skip to main content

RTIS Dev Remote Python Wrapper

This is a wrapper of the RTIS Dev Remote library to use RTIS Dev remotely over IP from your Python interpreter. Quickly develop with connected RTIS devices. Almost all RTIS Dev functions are available as well as automatic conversion of RTIS Dev custom class objects.

This work is published under the CC BY-NC-SA 4.0 DEED license.

Installation

Dependencies

  • Python 3.6 or higher with modules:
    • Numpy
    • Scipy
  • Supported RTIS Dev version is v2.16.0.

From PyPi

You can install this module from the PyPi repository like any other:

pip install rtisdevremotepy

Install from source

Install all dependencies listed above. We suggest to always use pip:

pip install MODULE_NAME

When you clone this repository you will need to manually update the gitmodules to get the right version of RTIS Dev Remote. For example:

cd rtisdevremotepy
git submodule init
git submodule update

To install the Python Module so that you can use it in any Python script:

pip install .

Usage

Unavailable RTIS Dev methods

Here is a short list of the current RTIS Dev methods that aren't available through this wrapper:

Initial setup

When starting with this wrapper, first try to make a connection the remote RTIS Device. This both tests the connection as makes sure that the RTIS Dev version used on the remote device is supported by the version of this wrapper. The only required argument is the IP of the remote RTIS Device. To learn more about how to find out the IP, please see this guide.

import rtisdevremotepy

rtisdev = rtisdevremotepy.RTISDev("192.168.1.150")

Now the rtisdev object can be used to run RTIS Dev methods from.

Executing remote methods

After the connection is made and no errors were shown, you can now use all available RTIS Dev commands. Some don't work and are listed in the list above. Please use the RTIS Dev wiki to know which arguments to use. The commands should be called from the rtisdev objects. For example:

rtisdev.open_connection()

Arguments

Please see the RTIS Dev wiki to know which arguments are optional and which are required. They use the exact same naming formats.

rtisdev.set_recording_settings(callDuration=4.4, callMinimumFrequency=30000, callMaximumFrequency=60000)

When you provide wrong arguments or run into other exceptions to RTIS Dev, the Python wrapper will raise an exception listing and describing the problem.

Custom data types

Some methods return or require one of the RTIS Dev custom class object. The RTIS Dev Python wrapper will automatically convert these to Python dictionary objects. When these dictionary objects are provided as arguments, the wrapper will automatically convert them again, so it should all work straight out of the box!

settings = rtisdev.get_current_settings(configName=config_uuid)
rtisdev.set_settings_from_class(settings)

measurement_raw = rtisdev.get_raw_measurement(behaviour=true, configName=config_uuid)
measurement_processed_from_raw = rtisdev.process_measurement(measurement_raw, configName=config_uuid)

If one has RTIS Dev fully installed and imported, one can also use the function convert_to_rtis_class(rtis_dict) to convert the dictionary objects back to the full RTIS Dev custom class objects. For example:

import rtisdev as fullrtisdev
measurement_processed_from_raw = rtisdev.process_measurement(measurement_raw, configName=config_uuid)
measurement_processed_from_raw_converted = rtisdev.convert_to_rtis_class(measurement_processed_from_raw)

Full example

A bigger example showing how to connect, record and process a measurement and plot the RTIS Energyscape.

import matplotlib.pyplot as plt
import numpy as np
import rtisdevremotepy

# Connect and verify matching versions of RTIS Dev
rtisdev = rtisdevremotepy.RTISDev("192.168.1.150")

# Connect to RTIS Device
rtisdev.open_connection()

# Configure the recording and processing settings
config_uuid = rtisdev.set_recording_settings(microphoneSamples=163840, callMinimumFrequency=25000, callMaximumFrequency=50000)
rtisdev.set_processing_settings(directions=91, maxRange=5, configName=config_uuid)
settings = rtisdev.get_current_settings(configName=config_uuid)

# Get an ACTIVE measurement (protect your ears!) and process it
measurement_processed = rtisdev.get_processed_measurement(behaviour=True, configName=config_uuid)

# Plot the 2D energyscape of this processed measurement.
plt.imshow(np.transpose(measurement_processed['processedData']), cmap="hot", interpolation='nearest')
plt.xlabel("Directions (degrees)")
plt.ylabel("Range (meters)")
indexes_x = np.arange(0, measurement_processed['processedData'].shape[0], 20)
labels_x = np.round(np.rad2deg(settings['directions'][indexes_x, 0])).astype(int)
indexes_y = np.arange(0, measurement_processed['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()

Metadata

Release files for rtisdevremotepy 2.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rtisdevremotepy 2.16.0
File Size Uploaded
rtisdevremotepy-2.16.0.tar.gz 44.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rtisdevremotepy 2.16.0
File Interpreter ABI Platform
rtisdevremotepy-2.16.0-py3-none-any.whl Python 3 none any Details

Total release size: 89.6 kB

Release files / rtisdevremotepy-2.16.0.tar.gz

Download URL rtisdevremotepy-2.16.0.tar.gz
Size 44.4 kB
Tags Source
SHA-256 checksum
How to use checksums
67c8ca6242e70e375cd46c3d161a4e8c7ea388bd0cbd9b3c797383bb9ea6ffa0
BLAKE2b-256 checksum
How to use checksums
47d87ab3976ce0f843248c2a03b67799771bef340eb7f4d43ef1a83fe4f574e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.9

Release files / rtisdevremotepy-2.16.0-py3-none-any.whl

Download URL rtisdevremotepy-2.16.0-py3-none-any.whl
Size 45.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00fef08e40ab9a30ac4435959cdc3354798c33b233f38cf4c87cfa34343c0dde
BLAKE2b-256 checksum
How to use checksums
e8898c64e603e5be713b8f95284ac15002fa2ba0ae69b8a7490890b0d5c8d689
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.9

Release history Release notifications | RSS feed

This release

2.16.0 This release

2 release files

2.15.1

2 release files

2.15.0

2 release files

2.14.1

2 release files

2.14.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page