PySide6 SDK for QTM Real-Time Protocol
Project description
Qualisys PySide6 SDK
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 QTMdisconnectFromHost()— Close the connectionstreamFrames(components, frames="allframes", udp_port=None, udp_address=None)— Start streaming; passudp_portto receive frames over UDP instead of TCPstreamFramesStop()— Stop streaminggetParameters(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 thedisconnectedsignal to detect this. - Single-threaded.
QTMConnectionandQTMDiscoveryareQObjectsubclasses 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70620ef26316844b26d8df6dc611f640fc684abc405fc07ff07b6986ce49540a
|
|
| MD5 |
fce5933189a6219e45e40b913a74f569
|
|
| BLAKE2b-256 |
5a9a1c6282ff0cf7ef033870ab2ff3f5fdb7d2b0f7e8e9e68a34e583cb544593
|
Provenance
The following attestation bundles were made for qtm_rt_pyside6-1.0.0.tar.gz:
Publisher:
publish.yml on qualisys/qualisys_pyside6_sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qtm_rt_pyside6-1.0.0.tar.gz -
Subject digest:
70620ef26316844b26d8df6dc611f640fc684abc405fc07ff07b6986ce49540a - Sigstore transparency entry: 1472688452
- Sigstore integration time:
-
Permalink:
qualisys/qualisys_pyside6_sdk@b57c85e66e572a00305c7487fbbbb92e97d4c4a0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/qualisys
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b57c85e66e572a00305c7487fbbbb92e97d4c4a0 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb9ce6c51eb1cb6e0538baa686cb0266e35b00b8ec5b19df4b5ca84eb426076c
|
|
| MD5 |
69ca1bf47b69e68bafefef077dd25881
|
|
| BLAKE2b-256 |
9a92b526249b512a55c7c6766c838a261deb8c15ea750faa850cedef7748801c
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qtm_rt_pyside6-1.0.0-py3-none-any.whl -
Subject digest:
eb9ce6c51eb1cb6e0538baa686cb0266e35b00b8ec5b19df4b5ca84eb426076c - Sigstore transparency entry: 1472688575
- Sigstore integration time:
-
Permalink:
qualisys/qualisys_pyside6_sdk@b57c85e66e572a00305c7487fbbbb92e97d4c4a0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/qualisys
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b57c85e66e572a00305c7487fbbbb92e97d4c4a0 -
Trigger Event:
release
-
Statement type: