DTrackSDK  v2.9.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
DTrackSDK Class Reference

DTrack SDK main class derived from DTrackParser. More...

#include <DTrackSDK.hpp>

+ Inheritance diagram for DTrackSDK:
+ Collaboration diagram for DTrackSDK:

Public Types

enum  RemoteSystemType { SYS_DTRACK_UNKNOWN = 0, SYS_DTRACK, SYS_DTRACK_2 }
 Compatibility modes for older DTrack systems. More...
 
enum  Errors { ERR_NONE = 0, ERR_TIMEOUT, ERR_NET, ERR_PARSE }
 Error codes. More...
 

Public Member Functions

 DTrackSDK (const std::string &connection)
 Universal constructor. Can be used for any mode. Recommended for new applications. More...
 
 DTrackSDK (unsigned short data_port)
 Constructor. Use for pure listening mode. More...
 
 DTrackSDK (const std::string &server_host, unsigned short data_port)
 Constructor. Use for communicating mode with DTrack2/DTRACK3. More...
 
 DTrackSDK (const std::string &server_host, unsigned short server_port, unsigned short data_port)
 Constructor. Use for communicating mode with DTrack1. More...
 
 DTrackSDK (const std::string &server_host, unsigned short server_port, unsigned short data_port, RemoteSystemType remote_type, int data_bufsize=0, int data_timeout_us=0, int srv_timeout_us=0)
 General constructor. DEPRECATED. More...
 
 ~DTrackSDK ()
 Destructor.
 
bool isValid ()
 Returns if constructor was successful due to the wanted mode. More...
 
bool isDataInterfaceValid () const
 Returns if UDP socket is open to receive tracking data on local machine. More...
 
bool isUDPValid () const
 Alias for isDataInterfaceValid(). DEPRECATED. More...
 
bool isLocalDataPortValid () const
 Alias for isDataInterfaceValid(). DEPRECATED. More...
 
unsigned short getDataPort () const
 Get UDP data port where tracking data is received. More...
 
bool isCommandInterfaceValid () const
 Returns if TCP connection for DTrack2/DTRACK3 commands is active. More...
 
bool isTCPValid () const
 Alias for isCommandInterfaceValid(). DEPRECATED. More...
 
bool isCommandInterfaceFullAccess ()
 Returns if TCP connection has full access for DTrack2/DTRACK3 commands. More...
 
RemoteSystemType getRemoteSystemType () const
 Get current remote system type (e.g. DTrack1, DTrack2/DTRACK3). More...
 
bool setDataTimeoutUS (int timeout)
 Set UDP timeout for receiving tracking data. More...
 
bool setCommandTimeoutUS (int timeout)
 Set TCP timeout for exchanging commands with Controller. More...
 
bool setControllerTimeoutUS (int timeout)
 Alias for setCommandTimeoutUS(). DEPRECATED. More...
 
bool setDataBufferSize (int bufSize)
 Set UDP buffer size for receiving tracking data. More...
 
bool enableStatefulFirewallConnection (const std::string &senderHost, unsigned short senderPort=DTRACK2_PORT_UDPSENDER)
 Enable UDP connection through a stateful firewall. More...
 
bool receive ()
 Receive and process one tracking data packet. More...
 
bool processPacket (const std::string &data)
 Process one tracking packet manually. More...
 
std::string getBuf () const
 Get content of the UDP buffer. More...
 
Errors getLastDataError () const
 Get last error at receiving tracking data (data transmission). More...
 
Errors getLastServerError () const
 Get last error at exchanging commands with Controller (command transmission). More...
 
int getLastDTrackError () const
 Get last DTrack2/DTRACK3 command error code. More...
 
std::string getLastDTrackErrorDescription () const
 Get last DTrack2/DTRACK3 command error description. More...
 
bool startMeasurement ()
 Start measurement. More...
 
bool stopMeasurement ()
 Stop measurement. More...
 
bool sendDTrack1Command (const std::string &command)
 Send DTrack1 command via UDP. More...
 
bool sendCommand (const std::string &command)
 Alias for sendDTrack1Command(). DEPRECATED. More...
 
int sendDTrack2Command (const std::string &command, std::string *answer=NULL)
 Send DTrack2/DTRACK3 command to DTrack and receive answer (TCP command interface). More...
 
bool setParam (const std::string &category, const std::string &name, const std::string &value)
 Set DTrack2/DTRACK3 parameter. More...
 
bool setParam (const std::string &parameter)
 Set DTrack2/DTRACK3 parameter using a string containing parameter category, name and new value. More...
 
bool getParam (const std::string &category, const std::string &name, std::string &value)
 Get DTrack2/DTRACK3 parameter. More...
 
bool getParam (const std::string &parameter, std::string &value)
 Get DTrack2/DTRACK3 parameter using a string containing parameter category and name. More...
 
bool getMessage ()
 Get DTrack2/DTRACK3 event message from the Controller. More...
 
unsigned int getMessageFrameNr () const
 Get frame counter of last DTrack2/DTRACK3 event message. More...
 
unsigned int getMessageErrorId () const
 Get error id of last DTrack2/DTRACK3 event message. More...
 
std::string getMessageOrigin () const
 Get origin of last DTrack2/DTRACK3 event message. More...
 
std::string getMessageStatus () const
 Get status of last DTrack2/DTRACK3 event message. More...
 
std::string getMessageMsg () const
 Get message text of last DTrack2/DTRACK3 event message. More...
 
bool tactileFinger (int handId, int fingerId, double strength)
 Send tactile FINGERTRACKING command to set feedback on a specific finger of a specific hand. More...
 
bool tactileHand (int handId, const std::vector< double > &strength)
 Send tactile FINGERTRACKING command to set tactile feedback on all fingers of a specific hand. More...
 
bool tactileHandOff (int handId, int numFinger)
 Send tactile FINGERTRACKING command to turn off tactile feedback on all fingers of a specific hand. More...
 
bool flystickBeep (int flystickId, double durationMs, double frequencyHz)
 Send Flystick feedback command to start a beep on a specific Flystick. More...
 
bool flystickVibration (int flystickId, int vibrationPattern)
 Send Flystick feedback command to start a vibration pattern on a specific Flystick. More...
 
- Public Member Functions inherited from DTrackParser
unsigned int getFrameCounter () const
 Get frame counter. More...
 
double getTimeStamp () const
 Get timestamp since midnight. More...
 
unsigned int getTimeStampSec () const
 Get timestamp since Unix epoch (1970-01-01 00:00:00), seconds. More...
 
unsigned int getTimeStampUsec () const
 Get timestamp since Unix epoch (1970-01-01 00:00:00), microseconds. More...
 
unsigned int getLatencyUsec () const
 Get latency (delay between exposure and sending UDP data in Controller). More...
 
int getNumBody () const
 Get number of calibrated standard bodies (as far as known). More...
 
const DTrackBodygetBody (int id) const
 Get standard body data. More...
 
int getNumFlyStick () const
 Get number of calibrated Flysticks. More...
 
const DTrackFlyStickgetFlyStick (int id) const
 Get Flystick data. More...
 
int getNumMeaTool () const
 Get number of calibrated Measurement Tools. More...
 
const DTrackMeaToolgetMeaTool (int id) const
 Get Measurement Tool data. More...
 
int getNumMeaRef () const
 Get number of calibrated Measurement Tool references. More...
 
const DTrackMeaRefgetMeaRef (int id) const
 Get Measurement Tool reference data. More...
 
int getNumHand () const
 Get number of calibrated A.R.T. FINGERTRACKING hands (as far as known). More...
 
const DTrackHandgetHand (int id) const
 Get A.R.T. FINGERTRACKING hand data. More...
 
int getNumHuman () const
 Get number of calibrated ART-Human models. More...
 
const DTrackHumangetHuman (int id) const
 Get ART-Human model data. More...
 
int getNumInertial () const
 Get number of calibrated hybrid (optical-inertial) bodies. More...
 
const DTrackInertialgetInertial (int id) const
 Get hybrid (optical-inertial) data. More...
 
int getNumMarker () const
 Get number of tracked single markers. More...
 
const DTrackMarkergetMarker (int index) const
 Get single marker data. More...
 
bool isStatusAvailable () const
 Returns if system status data is available. More...
 
const DTrackStatusgetStatus () const
 Get system status data. More...
 

Static Public Attributes

static const int DTRACK2_PROT_MAXLEN = 200
 max. length of 'dtrack2' command
 

Additional Inherited Members

- Protected Member Functions inherited from DTrackParser
 DTrackParser ()
 Constructor.
 
virtual ~DTrackParser ()
 Destructor.
 
void startFrame ()
 Set default values at start of a new frame.
 
void endFrame ()
 Final adjustments after processing all data for a frame.
 
bool parseLine (char **line)
 Parses a single line of data in one tracking data packet. More...
 

Detailed Description

DTrack SDK main class derived from DTrackParser.

All methods to access tracking data are located in DTrackParser.

Definition at line 77 of file DTrackSDK.hpp.

Member Enumeration Documentation

◆ Errors

Error codes.

Enumerator
ERR_NONE 

No error.

ERR_TIMEOUT 

Timeout occured.

ERR_NET 

Network error.

ERR_PARSE 

Error while parsing command.

Definition at line 91 of file DTrackSDK.hpp.

◆ RemoteSystemType

Compatibility modes for older DTrack systems.

Enumerator
SYS_DTRACK_UNKNOWN 

Unknown system.

SYS_DTRACK 

DTrack1 system.

SYS_DTRACK_2 

DTrack2/DTRACK3 system.

Definition at line 84 of file DTrackSDK.hpp.

Constructor & Destructor Documentation

◆ DTrackSDK() [1/5]

DTrackSDK::DTrackSDK ( const std::string &  connection)

Universal constructor. Can be used for any mode. Recommended for new applications.

Refer to other constructors for details. Communicating mode just for DTrack2/DTRACK3.

Examples for connection string:

  • "5000" : Port number (UDP), use for pure listening mode.
  • "224.0.1.0:5000" : Multicast IP and port number (UDP), use for multicast listening mode.
  • "atc-301422002:5000" : Hostname of Controller and port number (UDP), use for communicating mode.
  • "192.168.0.1:5000" : IP address of Controller and port number (UDP), use for communicating mode.
  • "atc-301422002:5000:fw" : Hostname of C. and port number (UDP), use for listening mode with stateful firewall.
Parameters
[in]connectionConnection string ("<data port>" or "<ip/host>:<data port>" or "<ip/host>:<data port>:fw")

Definition at line 60 of file DTrackSDK.cpp.

◆ DTrackSDK() [2/5]

DTrackSDK::DTrackSDK ( unsigned short  data_port)

Constructor. Use for pure listening mode.

Using this constructor, only a UDP receiver to get tracking data from the Controller will be established. Please start measurement manually.

Parameters
[in]data_portPort number (UDP) to receive tracking data from DTrack (0 if to be chosen by SDK)

Definition at line 136 of file DTrackSDK.cpp.

References SYS_DTRACK_UNKNOWN.

◆ DTrackSDK() [3/5]

DTrackSDK::DTrackSDK ( const std::string &  server_host,
unsigned short  data_port 
)

Constructor. Use for communicating mode with DTrack2/DTRACK3.

Using this constructor, a UDP receiver to get tracking data from the Controller as well as a TCP connection with the Controller will be established. Automatically starts and stops measurement.

Can also be used for multicast listening mode. In this case only a UDP receiver to get tracking data from the Controller will be established. Please start measurement manually.

Parameters
[in]server_hostHostname or IP address of Controller, or multicast IP address
[in]data_portPort number (UDP) to receive tracking data from DTrack (0 if to be chosen by SDK)

Definition at line 146 of file DTrackSDK.cpp.

References SYS_DTRACK_2.

◆ DTrackSDK() [4/5]

DTrackSDK::DTrackSDK ( const std::string &  server_host,
unsigned short  server_port,
unsigned short  data_port 
)

Constructor. Use for communicating mode with DTrack1.

Parameters
[in]server_hostHostname or IP address of DTrack1 PC
[in]server_portPort number (UDP) of DTrack1 PC to send commands to
[in]data_portPort number (UDP) to receive tracking data from DTrack1 (0 if to be chosen by SDK)

Definition at line 156 of file DTrackSDK.cpp.

References SYS_DTRACK, and SYS_DTRACK_UNKNOWN.

◆ DTrackSDK() [5/5]

DTrackSDK::DTrackSDK ( const std::string &  server_host,
unsigned short  server_port,
unsigned short  data_port,
RemoteSystemType  remote_type,
int  data_bufsize = 0,
int  data_timeout_us = 0,
int  srv_timeout_us = 0 
)

General constructor. DEPRECATED.

Parameters
[in]server_hostHostname/IP of Controller/DTrack1 PC, or multicast IP (empty string if not used)
[in]server_portPort number (UDP) of DTrack1 PC to send commands to (0 if not used)
[in]data_portPort number (UDP) to receive tracking data from DTrack (0 if to be chosen)
[in]remote_typeType of system to connect to
[in]data_bufsizeBuffer size for receiving tracking data in bytes; 0 to set default (32768)
[in]data_timeout_usTimeout for receiving tracking data in us; 0 to set default (1.0 s)
[in]srv_timeout_usTimeout for reply of Controller in us; 0 to set default (10.0 s)

Definition at line 173 of file DTrackSDK.cpp.

References setCommandTimeoutUS(), setDataBufferSize(), and setDataTimeoutUS().

Member Function Documentation

◆ enableStatefulFirewallConnection()

bool DTrackSDK::enableStatefulFirewallConnection ( const std::string &  senderHost,
unsigned short  senderPort = DTRACK2_PORT_UDPSENDER 
)

Enable UDP connection through a stateful firewall.

In order to enable UDP traffic through a stateful firewall. Just necessary for listening modes, will be done automatically for communicating mode. Default port is working just for DTrack3 v3.1.1 or newer.

Parameters
[in]senderHostHostname or IP address of Controller
[in]senderPortPort number from which Controller is sending tracking data
Returns
Success? (i.e. valid address)

Definition at line 425 of file DTrackSDK.cpp.

◆ flystickBeep()

bool DTrackSDK::flystickBeep ( int  flystickId,
double  durationMs,
double  frequencyHz 
)

Send Flystick feedback command to start a beep on a specific Flystick.

Sends command to the sender IP address of the latest received UDP data, if no hostname or IP address of a Controller is defined.

Parameters
[in]flystickIdFlystick id, range 0 ..
[in]durationMsTime duration of the beep (in milliseconds)
[in]frequencyHzFrequency of the beep (in Hertz)
Returns
Success? (if not, a DTrack error message is available)

Definition at line 1025 of file DTrackSDK.cpp.

◆ flystickVibration()

bool DTrackSDK::flystickVibration ( int  flystickId,
int  vibrationPattern 
)

Send Flystick feedback command to start a vibration pattern on a specific Flystick.

Sends command to the sender IP address of the latest received UDP data, if no hostname or IP address of a Controller is defined.

Parameters
[in]flystickIdFlystick id, range 0 ..
[in]vibrationPatternVibration pattern id, range 1 ..
Returns
Success? (if not, a DTrack error message is available)

Definition at line 1040 of file DTrackSDK.cpp.

◆ getBuf()

std::string DTrackSDK::getBuf ( ) const

Get content of the UDP buffer.

Returns
Content of buffer as string

Definition at line 537 of file DTrackSDK.cpp.

◆ getDataPort()

unsigned short DTrackSDK::getDataPort ( ) const

Get UDP data port where tracking data is received.

Returns
Data port.

Definition at line 321 of file DTrackSDK.cpp.

References DTrackNet::UDP::getPort().

◆ getLastDataError()

DTrackSDK::Errors DTrackSDK::getLastDataError ( ) const

Get last error at receiving tracking data (data transmission).

Returns
Error code (success = 0)

Definition at line 549 of file DTrackSDK.cpp.

◆ getLastDTrackError()

int DTrackSDK::getLastDTrackError ( ) const

Get last DTrack2/DTRACK3 command error code.

Returns
Error code

Definition at line 567 of file DTrackSDK.cpp.

◆ getLastDTrackErrorDescription()

std::string DTrackSDK::getLastDTrackErrorDescription ( ) const

Get last DTrack2/DTRACK3 command error description.

Returns
Error description

Definition at line 576 of file DTrackSDK.cpp.

◆ getLastServerError()

DTrackSDK::Errors DTrackSDK::getLastServerError ( ) const

Get last error at exchanging commands with Controller (command transmission).

Returns
Error code (success = 0)

Definition at line 558 of file DTrackSDK.cpp.

◆ getMessage()

bool DTrackSDK::getMessage ( )

Get DTrack2/DTRACK3 event message from the Controller.

Updates internal message structures. Use the appropriate methods to get the contents of the message.

Returns
Message available?

Definition at line 864 of file DTrackSDK.cpp.

References sendDTrack2Command(), and SYS_DTRACK_2.

◆ getMessageErrorId()

unsigned int DTrackSDK::getMessageErrorId ( ) const

Get error id of last DTrack2/DTRACK3 event message.

Returns
Error id

Definition at line 931 of file DTrackSDK.cpp.

◆ getMessageFrameNr()

unsigned int DTrackSDK::getMessageFrameNr ( ) const

Get frame counter of last DTrack2/DTRACK3 event message.

Returns
Frame counter

Definition at line 922 of file DTrackSDK.cpp.

◆ getMessageMsg()

std::string DTrackSDK::getMessageMsg ( ) const

Get message text of last DTrack2/DTRACK3 event message.

Returns
Message text

Definition at line 958 of file DTrackSDK.cpp.

◆ getMessageOrigin()

std::string DTrackSDK::getMessageOrigin ( ) const

Get origin of last DTrack2/DTRACK3 event message.

Returns
Origin

Definition at line 940 of file DTrackSDK.cpp.

◆ getMessageStatus()

std::string DTrackSDK::getMessageStatus ( ) const

Get status of last DTrack2/DTRACK3 event message.

Returns
Status

Definition at line 949 of file DTrackSDK.cpp.

◆ getParam() [1/2]

bool DTrackSDK::getParam ( const std::string &  category,
const std::string &  name,
std::string &  value 
)

Get DTrack2/DTRACK3 parameter.

Parameters
[in]categoryParameter category
[in]nameParameter name
[out]valueParameter value
Returns
Success? (if not, a DTrack error message is available)

Definition at line 826 of file DTrackSDK.cpp.

Referenced by isCommandInterfaceFullAccess().

◆ getParam() [2/2]

bool DTrackSDK::getParam ( const std::string &  parameter,
std::string &  value 
)

Get DTrack2/DTRACK3 parameter using a string containing parameter category and name.

Parameters
[in]parameterComplete parameter string without starting "dtrack get "
[out]valueParameter value
Returns
Success? (if not, a DTrack error message is available)

Definition at line 835 of file DTrackSDK.cpp.

References ERR_PARSE, and sendDTrack2Command().

◆ getRemoteSystemType()

DTrackSDK::RemoteSystemType DTrackSDK::getRemoteSystemType ( ) const

Get current remote system type (e.g. DTrack1, DTrack2/DTRACK3).

Returns
Type of remote system

Definition at line 356 of file DTrackSDK.cpp.

◆ isCommandInterfaceFullAccess()

bool DTrackSDK::isCommandInterfaceFullAccess ( )

Returns if TCP connection has full access for DTrack2/DTRACK3 commands.

Returns
Got full access to command interface?

Definition at line 341 of file DTrackSDK.cpp.

References getParam(), and isCommandInterfaceValid().

Referenced by isValid().

◆ isCommandInterfaceValid()

bool DTrackSDK::isCommandInterfaceValid ( ) const

Returns if TCP connection for DTrack2/DTRACK3 commands is active.

Returns
Command interface is active?

Definition at line 330 of file DTrackSDK.cpp.

References DTrackNet::TCP::isValid().

Referenced by isCommandInterfaceFullAccess(), isTCPValid(), and sendDTrack2Command().

◆ isDataInterfaceValid()

bool DTrackSDK::isDataInterfaceValid ( ) const

Returns if UDP socket is open to receive tracking data on local machine.

Needed to receive DTrack UDP data, but does not guarantee this. Especially in case no data is sent to this port.

Returns
Socket is open?

Definition at line 310 of file DTrackSDK.cpp.

References DTrackNet::UDP::isValid().

Referenced by isLocalDataPortValid(), isUDPValid(), isValid(), receive(), and sendDTrack1Command().

◆ isLocalDataPortValid()

bool DTrackSDK::isLocalDataPortValid ( ) const
inline

Alias for isDataInterfaceValid(). DEPRECATED.

Due to compatibility to DTrackSDK v2.0.0 - v2.5.0.

Returns
Socket is open?

Definition at line 214 of file DTrackSDK.hpp.

References isDataInterfaceValid().

◆ isTCPValid()

bool DTrackSDK::isTCPValid ( ) const
inline

Alias for isCommandInterfaceValid(). DEPRECATED.

Due to compatibility to DTrackSDK v2.0.0.

Returns
Command interface is active?

Definition at line 237 of file DTrackSDK.hpp.

References isCommandInterfaceValid().

◆ isUDPValid()

bool DTrackSDK::isUDPValid ( ) const
inline

Alias for isDataInterfaceValid(). DEPRECATED.

Due to compatibility to DTrackSDK v2.0.0.

Returns
Socket is open?

Definition at line 205 of file DTrackSDK.hpp.

References isDataInterfaceValid().

◆ isValid()

bool DTrackSDK::isValid ( )

Returns if constructor was successful due to the wanted mode.

Convenience routine, checks:

To get more information about a failure call above routines separately.

Returns
Successful?

Definition at line 294 of file DTrackSDK.cpp.

References isCommandInterfaceFullAccess(), isDataInterfaceValid(), and SYS_DTRACK_2.

◆ processPacket()

bool DTrackSDK::processPacket ( const std::string &  data)

Process one tracking packet manually.

This requires no connection to a Controller. Updates internal data structures.

Parameters
[in]dataData packet to be processed
Returns
Processing succeeded?

Definition at line 493 of file DTrackSDK.cpp.

References DTrackParser::endFrame(), ERR_NONE, ERR_PARSE, DTrackParser::parseLine(), and DTrackParser::startFrame().

◆ receive()

bool DTrackSDK::receive ( )

Receive and process one tracking data packet.

This method waits until a data packet becomes available, but no longer than the timeout. Updates internal data structures.

Returns
Receive succeeded?

Definition at line 441 of file DTrackSDK.cpp.

References DTrackParser::endFrame(), ERR_NET, ERR_NONE, ERR_PARSE, ERR_TIMEOUT, isDataInterfaceValid(), DTrackParser::parseLine(), DTrackNet::UDP::receive(), and DTrackParser::startFrame().

◆ sendCommand()

bool DTrackSDK::sendCommand ( const std::string &  command)
inline

Alias for sendDTrack1Command(). DEPRECATED.

Due to compatibility to DTrackSDK v2.0.0 - v2.6.0.

Parameters
[in]commandCommand string
Returns
Sending command succeeded? If not, a DTrack error is available

Definition at line 392 of file DTrackSDK.hpp.

References sendDTrack1Command().

◆ sendDTrack1Command()

bool DTrackSDK::sendDTrack1Command ( const std::string &  command)

Send DTrack1 command via UDP.

Answer is not received and therefore not processed.

Parameters
[in]commandCommand string
Returns
Sending command succeeded? If not, a DTrack error is available

Definition at line 633 of file DTrackSDK.cpp.

References ERR_NET, ERR_NONE, isDataInterfaceValid(), DTrackNet::UDP::send(), startMeasurement(), stopMeasurement(), and SYS_DTRACK_2.

Referenced by sendCommand(), startMeasurement(), and stopMeasurement().

◆ sendDTrack2Command()

int DTrackSDK::sendDTrack2Command ( const std::string &  command,
std::string *  answer = NULL 
)

Send DTrack2/DTRACK3 command to DTrack and receive answer (TCP command interface).

Answers like "dtrack2 ok" and "dtrack2 err .." are processed. Both cases are reflected in the return value. getLastDTrackError() and getLastDTrackErrorDescription() will return more information.

Parameters
[in]commandDTrack2 command string
[out]answerBuffer for answer; NULL if specific answer is not needed
Returns
0 Specific answer, needs to be parsed
1 Answer is "dtrack2 ok"
2 Answer is "dtrack2 err ..". Refer to getLastDTrackError() and getLastDTrackErrorDescription().
<0 if error occured (-1 receive timeout, -2 wrong system type, -3 command too long, -9 broken tcp connection, -10 tcp connection invalid, -11 send command failed)

Definition at line 685 of file DTrackSDK.cpp.

References DTRACK2_PROT_MAXLEN, ERR_NET, ERR_NONE, ERR_PARSE, ERR_TIMEOUT, isCommandInterfaceValid(), DTrackNet::TCP::receive(), DTrackNet::TCP::send(), and SYS_DTRACK_2.

Referenced by getMessage(), getParam(), setParam(), startMeasurement(), and stopMeasurement().

◆ setCommandTimeoutUS()

bool DTrackSDK::setCommandTimeoutUS ( int  timeout)

Set TCP timeout for exchanging commands with Controller.

Parameters
[in]timeoutTimeout for reply of Controller in us; 0 to set default (10.0 s)
Returns
Success? (i.e. valid timeout)

Definition at line 382 of file DTrackSDK.cpp.

Referenced by DTrackSDK(), and setControllerTimeoutUS().

◆ setControllerTimeoutUS()

bool DTrackSDK::setControllerTimeoutUS ( int  timeout)
inline

Alias for setCommandTimeoutUS(). DEPRECATED.

Due to compatibility to DTrackSDK v2.0.0 - v2.5.0.

Parameters
[in]timeoutTimeout for reply of Controller in us; 0 to set default (10.0 s)
Returns
Success? (i.e. valid timeout)

Definition at line 277 of file DTrackSDK.hpp.

References setCommandTimeoutUS().

◆ setDataBufferSize()

bool DTrackSDK::setDataBufferSize ( int  bufSize)

Set UDP buffer size for receiving tracking data.

Parameters
[in]bufSizeBuffer size for receiving tracking data in bytes; 0 to set default (32768)
Returns
Success? (i.e. valid size)

Definition at line 399 of file DTrackSDK.cpp.

Referenced by DTrackSDK().

◆ setDataTimeoutUS()

bool DTrackSDK::setDataTimeoutUS ( int  timeout)

Set UDP timeout for receiving tracking data.

Parameters
[in]timeoutTimeout for receiving tracking data in us; 0 to set default (1.0 s)
Returns
Success? (i.e. valid timeout)

Definition at line 365 of file DTrackSDK.cpp.

Referenced by DTrackSDK().

◆ setParam() [1/2]

bool DTrackSDK::setParam ( const std::string &  category,
const std::string &  name,
const std::string &  value 
)

Set DTrack2/DTRACK3 parameter.

Parameters
[in]categoryParameter category
[in]nameParameter name
[in]valueParameter value
Returns
Success? (if not, a DTrack error message is available)

Definition at line 807 of file DTrackSDK.cpp.

◆ setParam() [2/2]

bool DTrackSDK::setParam ( const std::string &  parameter)

Set DTrack2/DTRACK3 parameter using a string containing parameter category, name and new value.

Parameters
[in]parameterComplete parameter string without starting "dtrack set "
Returns
Success? (if not, a DTrack error message is available)

Definition at line 816 of file DTrackSDK.cpp.

References sendDTrack2Command().

◆ startMeasurement()

bool DTrackSDK::startMeasurement ( )

Start measurement.

Ensure via DTrack frontend that tracking data is sent to correct UDP data port.

Returns
Is command successful? If measurement is already running the return value is false.

Definition at line 595 of file DTrackSDK.cpp.

References sendDTrack1Command(), sendDTrack2Command(), and SYS_DTRACK.

Referenced by sendDTrack1Command().

◆ stopMeasurement()

bool DTrackSDK::stopMeasurement ( )

Stop measurement.

Returns
Is command successful? If measurement is not running return value is true.

Definition at line 615 of file DTrackSDK.cpp.

References sendDTrack1Command(), sendDTrack2Command(), and SYS_DTRACK.

Referenced by sendDTrack1Command().

◆ tactileFinger()

bool DTrackSDK::tactileFinger ( int  handId,
int  fingerId,
double  strength 
)

Send tactile FINGERTRACKING command to set feedback on a specific finger of a specific hand.

Has to be repeated at least every second; otherwise a timeout mechanism will turn off any feedback.

Sends command to the sender IP address of the latest received UDP data, if no hostname or IP address of a Controller is defined.

Parameters
[in]handIdHand id, range 0 ..
[in]fingerIdFinger id, range 0 ..
[in]strengthStrength of feedback, between 0.0 and 1.0
Returns
Success? (if not, a DTrack error message is available)

Definition at line 967 of file DTrackSDK.cpp.

References ERR_NET.

◆ tactileHand()

bool DTrackSDK::tactileHand ( int  handId,
const std::vector< double > &  strength 
)

Send tactile FINGERTRACKING command to set tactile feedback on all fingers of a specific hand.

Has to be repeated at least every second; otherwise a timeout mechanism will turn off any feedback.

Sends command to the sender IP address of the latest received UDP data, if no hostname or IP address of a Controller is defined.

Parameters
[in]handIdHand id, range 0 ..
[in]strengthStrength of feedback on all fingers, between 0.0 and 1.0
Returns
Success? (if not, a DTrack error message is available)

Definition at line 987 of file DTrackSDK.cpp.

References ERR_NET.

Referenced by tactileHandOff().

◆ tactileHandOff()

bool DTrackSDK::tactileHandOff ( int  handId,
int  numFinger 
)

Send tactile FINGERTRACKING command to turn off tactile feedback on all fingers of a specific hand.

Sends command to the sender IP address of the latest received UDP data, if no hostname or IP address of a Controller is defined.

Parameters
[in]handIdHand id, range 0 ..
[in]numFingerNumber of fingers
Returns
Success? (if not, a DTrack error message is available)

Definition at line 1012 of file DTrackSDK.cpp.

References tactileHand().


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