Skip to main content

PySide6 SDK for QTM Real-Time Protocol

Project description

Qualisys PySide6 SDK

PyPI

PySide6-based SDK for the Qualisys Real-Time (RT) protocol. Stream motion capture data from QTM using Qt's native networking and signals/slots.

Installation

Requires Python 3.10+ and PySide6 6.0+.

We recommend using a virtual environment to avoid conflicts with other packages:

# Create and activate a virtual environment
python -m venv .venv

# Windows
.venv\Scripts\activate

# macOS / Linux
source .venv/bin/activate

Then install the package:

pip install qtm-rt-pyside6

Quick Start

import sys
from PySide6.QtCore import QCoreApplication
from qtm_rt_pyside6 import QTMConnection, QRTPacket

def on_packet(packet: QRTPacket):
    print(f"Frame {packet.framenumber}")
    result = packet.get_3d_markers()
    if result:
        header, markers = result
        for marker in markers:
            print(f"  {marker.x}, {marker.y}, {marker.z}")

app = QCoreApplication(sys.argv)

connection = QTMConnection()
connection.connected.connect(lambda: connection.streamFrames(["3d"]))
connection.packetReceived.connect(on_packet)
connection.error.connect(lambda msg: print(f"Error: {msg}"))
connection.connectToHost("127.0.0.1")

sys.exit(app.exec())

API

QTMConnection Signals

Signal Description
connected() Successfully connected and version negotiated
disconnected() Disconnected from QTM
error(str) Connection or protocol error
packetReceived(QRTPacket) Data packet during streaming
eventReceived(QRTEvent) QTM event (capture started, etc.)
responseReceived(str, object) Command response (command_name, data)

QTMConnection Methods

Core methods to get started:

  • connectToHost(host, port=22223, version="1.25", timeout_ms=5000) — Connect to QTM
  • disconnectFromHost() — Close the connection
  • streamFrames(components, frames="allframes", udp_port=None, udp_address=None) — Start streaming; pass udp_port to receive frames over UDP instead of TCP
  • streamFramesStop() — Stop streaming
  • getParameters(parameters) — Request current configuration as XML

See the class docstring or run help(QTMConnection) for the full method list — control, load/save, trigger, LED, quit, XML settings, etc.

Components

Valid streaming components: 2d, 2dlin, 3d, 3dres, 3dnolabels, 3dnolabelsres, analog, analogsingle, force, forcesingle, 6d, 6dres, 6deuler, 6deulerres, gazevector, eyetracker, image, timecode, skeleton, skeleton:global

Examples

Ready-to-run scripts live in examples/ — see examples/README.md for what each one demonstrates and how to run it. basic_example.py is the shortest path to verify your setup; the GUI examples (gui_example.py and gui_3d_example/) show how to wire the SDK into a desktop application.

Known Limitations

  • No automatic reconnection. If the connection drops, you must call connectToHost() again. Listen to the disconnected signal to detect this.
  • Single-threaded. QTMConnection and QTMDiscovery are QObject subclasses and must be used from the thread that created them (typically the main thread). Use Qt signals for cross-thread communication.
  • Password sent in plain text. takeControl(password) transmits the password unencrypted over TCP. This is a QTM protocol limitation — use on trusted networks only.

Development

To work on the SDK itself:

git clone https://github.com/qualisys/qualisys_pyside6_sdk.git
cd qualisys_pyside6_sdk

# Create and activate a virtual environment
python -m venv .venv

# Windows
.venv\Scripts\activate

# macOS / Linux
source .venv/bin/activate

# Install dev dependencies (pytest, pytest-qt, ruff, build) and the package
pip install -r requirements-dev.txt
pip install -e .

Run tests and linting:

pytest -v
ruff check .
ruff format --check .

License

MIT — see LICENSE and THIRD_PARTY_LICENSES.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qtm_rt_pyside6-1.0.0.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qtm_rt_pyside6-1.0.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file qtm_rt_pyside6-1.0.0.tar.gz.

File metadata

  • Download URL: qtm_rt_pyside6-1.0.0.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qtm_rt_pyside6-1.0.0.tar.gz
Algorithm Hash digest
SHA256 70620ef26316844b26d8df6dc611f640fc684abc405fc07ff07b6986ce49540a
MD5 fce5933189a6219e45e40b913a74f569
BLAKE2b-256 5a9a1c6282ff0cf7ef033870ab2ff3f5fdb7d2b0f7e8e9e68a34e583cb544593

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtm_rt_pyside6-1.0.0.tar.gz:

Publisher: publish.yml on qualisys/qualisys_pyside6_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qtm_rt_pyside6-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: qtm_rt_pyside6-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qtm_rt_pyside6-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb9ce6c51eb1cb6e0538baa686cb0266e35b00b8ec5b19df4b5ca84eb426076c
MD5 69ca1bf47b69e68bafefef077dd25881
BLAKE2b-256 9a92b526249b512a55c7c6766c838a261deb8c15ea750faa850cedef7748801c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtm_rt_pyside6-1.0.0-py3-none-any.whl:

Publisher: publish.yml on qualisys/qualisys_pyside6_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page