Giter Club home page Giter Club logo

qualisys_python_sdk's Introduction

Qualisys SDK for Python

The Qualisys SDK for Python implements our RealTime(RT) protocol and works with Python 3.5 and above.

Installation

The easiest way to install the qtm_rt package is by using pip:

python -m pip install pip --upgrade # Upgrade to latest pip
python -m pip install qtm-rt

It's also possible to install from github:

python -m pip install git+https://github.com/qualisys/qualisys_python_sdk.git

Or just clone the repo and copy the qtm_rt folder into you project folder,

Documentation

https://qualisys.github.io/qualisys_python_sdk/index.html

Examples

See the examples folder.

Missing RT features and limitations

Implementation only uses little endian, should connect to standard port 22223. Protocol version must be 1.8 or later.

GetCaptureC3D is not implemented. GetCaptureQTM is not implemented.

No support for selecting analog channel.

qualisys_python_sdk's People

Contributors

bdazl avatar capelliexp avatar dependabot[bot] avatar emilrosenquist avatar helmesjo avatar henrik-norgren avatar krichardsson avatar mbaytas avatar mgejke avatar mlveggo avatar nilzilch avatar qjgn avatar ulvs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

qualisys_python_sdk's Issues

qualisys_python_sdk on Ubuntu

Hello, sorry to bother you. I am a student using the Qualisys Motion capture for the qualisys_python_sdk on ubuntu system, and I execute the command as you :

python -m pip install pip --upgrade # Upgrade to latest pip
python -m pip install qtm

but there're problems to warning me, as following:

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/twisted/test/raiser.c -o build/temp.linux-x86_64-2.7/src/twisted/test/raiser.o

src/twisted/test/raiser.c:4:20: fatal error: Python.h: No such file or directory

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Can you help me ? thank you !!!

Feedback from QTM to python

One problem we face during feedback is that the 6d data which QTM is publishing in python has coordinates (x,y,z) and a rotation matrix. We need roll, pitch and yaw separately, also it will be good if we can receive velocity and acceleration data of any rigid body from QTM. Can you please help regarding it?

FrameNumber always at 1 in real-time

Hi, I'm using QTM (v 2021.2) and qtm_rt (v 3.0.1) with RT protocol on python (v1.23) on windows.
I have some issues with the example "stream_6dof_example.py" like explained in: https://www.qualisys.com/video-tutorials/how-to-use-the-python-sdk-for-qtm/ I hope someone can help.

When I run the example offline from a saved file, I have no problem with the number of frames, etc. But when I try to run the example live, the number of frame is always equal to one.

There's something wrong with my understanding but I can't work out what.
Thanks for your help!

Amedeo

Streaming examples broken in latest release

The new release of the python SDK seems to use protocol 1.19, and therefore does not appear to work with QTM 2018.1 (4300), which only supports up to 1.18, and which as far as I can tell is the latest release of QTM.

Discover() raises exception

Hi!
I have a problem using the lib and I get an exception when calling Discover()

Environment:
OSx 10.5.7
Python 3.8.5
py qtm 2.0.5

I get the following exception when calling qtm.Discover()

File "/Users/kristoffer/code/bitcraze/playground/qualisys_demo/test.py", line 94, in _discover
async for qtm_instance in qtm.Discover('0.0.0.0'):
File "/Users/kristoffer/.pyenv/versions/3.8.5/lib/python3.8/site-packages/qtm/discovery.py", line 78, in anext
_, protocol = await loop.create_datagram_endpoint(
File "/Users/kristoffer/.pyenv/versions/3.8.5/lib/python3.8/asyncio/base_events.py", line 1291, in create_datagram_endpoint
raise ValueError("Passing reuse_address=True is no "
ValueError: Passing reuse_address=True is no longer supported, as the usage of SO_REUSEPORT in UDP poses a significant security concern.

basic_example.py not working with version 2.1.0

I have updated qtm python sdk to version 2.1.0 and I have connection problem now. Version 2.0.6 was working fine. But with 2.1.0 when I run basic_example it gives me error.

python3 basic_example.py

2021-04-15 09:58:00,434 - qtm - INFO - Connected
2021-04-15 09:58:00,498 - qtm - ERROR - <class 'Exception'>

Start capture

Hi,

I'm actually able to stream frames in real time but i would like to start a new capture in QTM using the python sdk.
I setup the connection as you did in your advanced_exemple file. It works fine until i'm trying to use connection.set_qtm_event

I guess this is not the way to use it. Do you have any recommandation to take control of qtm and manage capture (start, stop, set filename) ?

Here the code i'm using :

connection = await qtm.connect(127.0.0.1, version="1.16")

async with qtm.TakeControl(connection, "password"):
    #logger.info('Password OK')
    state = await connection.get_state()
    if state != qtm.QRTEvent.EventConnected:
        await connection.new()
        try:
            await connection.await_event(qtm.QRTEvent.EventConnected, timeout=10)
        except asyncio.TimeoutError:
            #logger.warning("Failed to start new measurement | asyncio.TimeoutError")
            return -1

    await connection.set_qtm_event(qtm.QRTEvent.EventCaptureStarted)

Thank you !

Undefined functions in Markup.cpp

Some functions in Markup.cpp file are not defined. Please look into the matter and rectify.

I have build the code using CMake MinGW Makefiles (GUI) and encountering the following error while making the files using mingw32-make, in the Markup.cpp file.

`C:\Users\AMD\OneDrive - Indian Institute of Technology Jodhpur\Qualisys\qualisys_cpp_sdk-master\qualisys_cpp_sdk-master\build> mingw32-make`
`[ 20%] Building CXX object CMakeFiles/qualisys_cpp_sdk.dir/Markup.cpp.obj`
`C:\Users\AMD\OneDrive - Indian Institute of Technology Jodhpur\Qualisys\qualisys_cpp_sdk-master\qualisys_cpp_sdk-master\Markup.cpp: In member function 'std::__cxx11::string CMarkup::x_TextToDoc(const char*, bool) const':`
`C:\Users\AMD\OneDrive - Indian Institute of Technology Jodhpur\Qualisys\qualisys_cpp_sdk-master\qualisys_cpp_sdk-master\Markup.cpp:732:44: error: 'strcpy_s' was not declared in this scope`
`    strcpy_s(&pDest[nLen], nDestSize, pFound);`
`                                            ^`
`C:\Users\AMD\OneDrive - Indian Institute of Technology Jodhpur\Qualisys\qualisys_cpp_sdk-master\qualisys_cpp_sdk-master\Markup.cpp: In static member function 'static std::__cxx11::string CMarkup::Format(const char*, ...)':`
`C:\Users\AMD\OneDrive - Indian Institute of Technology Jodhpur\Qualisys\qualisys_cpp_sdk-master\qualisys_cpp_sdk-master\Markup.cpp:1182:80: error: '_vsnprintf_s' was not declared in this scope`
`         int nWritten = _vsnprintf_s(&buffer[0], buffer.size(), len, fmt, marker);`
`                                                                                ^`
`CMakeFiles\qualisys_cpp_sdk.dir\build.make:75: recipe for target 'CMakeFiles/qualisys_cpp_sdk.dir/Markup.cpp.obj' failed`
`mingw32-make[2]: *** [CMakeFiles/qualisys_cpp_sdk.dir/Markup.cpp.obj] Error 1`
`CMakeFiles\Makefile2:81: recipe for target 'CMakeFiles/qualisys_cpp_sdk.dir/all' failed`
`mingw32-make[1]: *** [CMakeFiles/qualisys_cpp_sdk.dir/all] Error 2`
`Makefile:134: recipe for target 'all' failed`
`mingw32-make: *** [all] Error 2`

basic_example wrong on ubuntu

Hello, I executed the example : basic_example, but it tips me that following message:

Connected to QTM with Version set to 1.13
'You must be master to issue this command'
Connection was closed cleanly.

What should I do ? Thank you !

Streaming Analog Data

Hello,

I am looking to stream analog data that is collected in QTM. Looking at the examples in the SDK folders, I have found the majority of information and examples on streaming marker data.

I have tried modifying the BasicExample.py file, to stream in analog data, but I keep receiving an error when I try to retrieve the analog parameter packet.

I have no issues with my connection to QTM, and am able to stream marker data using the basic example how it is intended.

I am fairly new to Python, and any help to better understand the code would be appreciated. Thank you in advance.

CODE:
"""
Minimal usage example
Connects to QTM and streams 3D data forever
(start QTM first, load file, Play->Play with Real-Time output)
"""

import asyncio
import qtm

def on_packet(packet):
""" Callback function that is called everytime a data packet arrives from QTM """
print("Framenumber: {}".format(packet.framenumber))
header, markers = packet.get_analog()
print("Component info: {}".format(header))

async def setup():
""" Main function """
connection = await qtm.connect("127.0.0.1")
if connection is None:
return

await connection.get_parameters(parameters=["analog"], on_packet=on_packet)

if name == "main":
asyncio.ensure_future(setup())
asyncio.get_event_loop().run_forever()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.