qualisys
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
qualisys::Driver Class Reference

#include <Driver.hpp>

Inheritance diagram for qualisys::Driver:

Public Member Functions

 Driver ()
 
 ~Driver ()
 
void connect (const std::string &host, const unsigned int base_port=22222)
 connect to qualisys server More...
 
void loadParameters (std::vector< std::string > &labels)
 load marker configuration data from the server More...
 
void startStreamData (const std::string &label)
 start streaming marker data from the QTM Server More...
 
void stopStreamData ()
 stop streaming of marker data More...
 
bool getTransform (base::Time &time, base::Affine3d &transform)
 read a marker packet More...
 

Protected Member Functions

bool setQTMVersion (int major, int minor)
 
bool readQTMString (std::string &qtmstring)
 
std::string getBufferString ()
 
bool readQTMPacket (QTMHeader::EPacketType type)
 
void writeQTMCommand (const std::string &cmd)
 
void writeQTMCommand (uint8_t const *buffer, size_t size)
 
int extractPacket (uint8_t const *buffer, size_t size) const
 

Protected Attributes

uint8_t * buffer
 
size_t buffer_size
 
int body_idx
 

Static Protected Attributes

static const size_t MAX_MARKERS = 64
 maximum number of markers supported More...
 

Constructor & Destructor Documentation

◆ Driver()

Driver::Driver ( )

◆ ~Driver()

Driver::~Driver ( )

Member Function Documentation

◆ connect()

void Driver::connect ( const std::string &  host,
const unsigned int  base_port = 22222 
)

connect to qualisys server

Connect to qualisys server using the given host and base_port. Will throw if connection attempt is not successful.

Parameters
hosthost of the qualisys server
base_portthe base port number of the server. This is not the actual port it is connecting to, as this is determined by the endianess of the connecting machine.

◆ extractPacket()

int Driver::extractPacket ( uint8_t const *  buffer,
size_t  size 
) const
protected

◆ getBufferString()

std::string Driver::getBufferString ( )
protected

◆ getTransform()

bool Driver::getTransform ( base::Time &  time,
base::Affine3d &  transform 
)

read a marker packet

Reads a marker packet and store the transformation for the given marker_idx in the given transform reference. The marker/body index is selected in the startStreamData call.

Parameters
time[out] timestamp of the read packet
transform[out] body to world transform of the given marker index

◆ loadParameters()

void Driver::loadParameters ( std::vector< std::string > &  labels)

load marker configuration data from the server

loads the marker/body configuration data from the server, and fills the labels array with a list of found labels.

◆ readQTMPacket()

bool Driver::readQTMPacket ( QTMHeader::EPacketType  type)
protected

◆ readQTMString()

bool Driver::readQTMString ( std::string &  result)
protected

reads a packet from the stream and interprets it as a string

◆ setQTMVersion()

bool Driver::setQTMVersion ( int  major,
int  minor 
)
protected

write a version command

◆ startStreamData()

void Driver::startStreamData ( const std::string &  label)

start streaming marker data from the QTM Server

if connected, this will get the QTMServer to start streaming the processed marker data. The data can be read using the getTransform() method.

◆ stopStreamData()

void Driver::stopStreamData ( )

stop streaming of marker data

◆ writeQTMCommand() [1/2]

void Driver::writeQTMCommand ( const std::string &  cmd)
protected

◆ writeQTMCommand() [2/2]

void Driver::writeQTMCommand ( uint8_t const *  buffer,
size_t  size 
)
protected

Member Data Documentation

◆ body_idx

int qualisys::Driver::body_idx
protected

◆ buffer

uint8_t* qualisys::Driver::buffer
protected

◆ buffer_size

size_t qualisys::Driver::buffer_size
protected

◆ MAX_MARKERS

const size_t qualisys::Driver::MAX_MARKERS = 64
staticprotected

maximum number of markers supported


The documentation for this class was generated from the following files: