MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::NDIProtocol Class Reference

The NDI Protocol class provides building and parsing of command strings and answers to and from a NDI tracking device. More...

#include <mitkNDIProtocol.h>

Inheritance diagram for mitk::NDIProtocol:
NDIProtocolTestClass

Public Types

typedef mitk::SerialCommunication::PortNumber PortNumber
 Port number of the serial connection.
 
typedef mitk::SerialCommunication::BaudRate BaudRate
 Baud rate of the serial connection.
 
typedef mitk::SerialCommunication::DataBits DataBits
 Number of data bits used in the serial connection.
 
typedef mitk::SerialCommunication::Parity Parity
 Parity mode used in the serial connection.
 
typedef mitk::SerialCommunication::StopBits StopBits
 Number of stop bits used in the serial connection.
 
typedef mitk::SerialCommunication::HardwareHandshake HardwareHandshake
 Hardware handshake mode of the serial connection.
 
typedef mitk::NDIPassiveTool::TrackingPriority TrackingPriority
 Tracking priority used for tracking a tool.
 

Public Member Functions

 mitkClassMacroItkParent (NDIProtocol, itk::Object)
 
 itkFactorylessNewMacro (Self)
 
 itkCloneMacro (Self)
 
 itkSetObjectMacro (TrackingDevice, NDITrackingDevice)
 
NDIErrorCode APIREV (std::string *revision)
 Gives information about the tool which is assosiated with the port handle. Writes portInfo to the string.
 
NDIErrorCode PHINF (std::string portHandle, std::string *portInfo)
 
NDIErrorCode PSOUT (std::string portHandle, std::string state)
 Set GPIO Output (Aurora)
 
NDIErrorCode COMM (mitk::SerialCommunication::BaudRate baudRate, mitk::SerialCommunication::DataBits dataBits, mitk::SerialCommunication::Parity parity, mitk::SerialCommunication::StopBits stopBits, mitk::SerialCommunication::HardwareHandshake hardwareHandshake)
 Change Serial Communication Parameters.
 
NDIErrorCode INIT ()
 Initialize the Measurement System.
 
NDIErrorCode DSTART ()
 Start the Diagnostic Mode.
 
NDIErrorCode DSTOP ()
 Stop the Diagnostic Mode.
 
NDIErrorCode IRINIT ()
 Initialize the System to Check for Infrared.
 
NDIErrorCode IRCHK (bool *IRdetected)
 This version of IRCHK uses only the simple "presence of infrared light" call, that returns a binary "IR detected/no IR detected" answer.
 
NDIErrorCode PHSR (PHSRQueryType queryType, std::string *portHandles)
 Port Handle Search. Will write returned port handles to the string portHandles.
 
NDIErrorCode PHF (std::string *portHandle)
 Port Handle Free. Frees the port handle.
 
NDIErrorCode PHRQ (std::string *portHandle)
 Port Handle Request. Will request a Port Handle for a wireless tool and return it in the string portHandle.
 
NDIErrorCode PVWR (std::string *portHandle, const unsigned char *sromData, unsigned int sromDataLength)
 Port Virtual Write. Writes an SROM Image data to a tool.
 
NDIErrorCode PINIT (std::string *portHandle)
 Port Initialize. Will initialize a Port that has been acquired with PHRQ and has been assigned a SROM File with PVWR.
 
NDIErrorCode PENA (std::string *portHandle, TrackingPriority prio)
 Port Enable. Will enable a port that has been initialized with PINIT.
 
NDIErrorCode PDIS (std::string *portHandle)
 Port Disable. Will disable a port that has been enabled with PENA.
 
NDIErrorCode IRATE (IlluminationActivationRate rate)
 Setting the illuminator rate. Will set the refresh rate for the illuminator for wireless tools.
 
NDIErrorCode BEEP (unsigned char count)
 Sounding the measurement system beeper. The tracking system will beep one to nine times.
 
NDIErrorCode SFLIST (std::string *info)
 Returns information about the supported feature of the tracking system.
 
NDIErrorCode TSTART (bool resetFrameCounter=false)
 Start Tracking Mode. The tracking system must be in setup mode and must be initialized.
 
NDIErrorCode TSTOP ()
 Stop Tracking Mode. The tracking system must be in Tracking mode.
 
NDIErrorCode TX (bool trackIndividualMarkers=false, MarkerPointContainerType *markerPositions=nullptr)
 Report transformations in text mode. Optionally, individual markers can be tracked.
 
NDIErrorCode BX ()
 Report transformations in binary mode.
 
NDIErrorCode POS3D (MarkerPointContainerType *markerPositions)
 Report 3D Positions of single markers. can only be used in diagnostics mode.
 
NDIErrorCode VER (mitk::TrackingDeviceType &t)
 returns if the tracking device is a Polaris or an Aurora system
 
NDIErrorCode VSEL (mitk::TrackingDeviceData deviceData)
 Sets the tracking volume to the given type. Check available tracking volumes with SFLIST first.
 
NDIErrorCode TX1000 (MarkerPointContainerType *markerPositions)
 Report transformations in text mode.
 
unsigned int ByteToNbBitsOn (char &c) const
 
 itkGetConstMacro (UseCRC, bool)
 Get whether to append a CRC16 checksum to each message.
 
 itkSetMacro (UseCRC, bool)
 Set whether to append a CRC16 checksum to each message.
 
 itkBooleanMacro (UseCRC)
 Set whether to append a CRC16 checksum to each message.
 

Protected Member Functions

 NDIProtocol ()
 
 ~NDIProtocol () override
 
NDIErrorCode ParseOkayError ()
 
NDIErrorCode GenericCommand (const std::string command, const std::string *parameter=nullptr)
 
NDIErrorCode GetErrorCode (const std::string *input)
 returns the error code for an Error String returned from the NDI tracking device
 

Protected Attributes

NDITrackingDevicem_TrackingDevice
 tracking device to which the commands will be send
 
bool m_UseCRC
 whether to append a CRC16 checksum to each message
 

Detailed Description

The NDI Protocol class provides building and parsing of command strings and answers to and from a NDI tracking device.

Documentation

Definition at line 86 of file mitkNDIProtocol.h.

Member Typedef Documentation

◆ BaudRate

Baud rate of the serial connection.

Definition at line 95 of file mitkNDIProtocol.h.

◆ DataBits

Number of data bits used in the serial connection.

Definition at line 96 of file mitkNDIProtocol.h.

◆ HardwareHandshake

Hardware handshake mode of the serial connection.

Definition at line 99 of file mitkNDIProtocol.h.

◆ Parity

Parity mode used in the serial connection.

Definition at line 97 of file mitkNDIProtocol.h.

◆ PortNumber

Port number of the serial connection.

Definition at line 94 of file mitkNDIProtocol.h.

◆ StopBits

Number of stop bits used in the serial connection.

Definition at line 98 of file mitkNDIProtocol.h.

◆ TrackingPriority

Tracking priority used for tracking a tool.

Definition at line 100 of file mitkNDIProtocol.h.

Constructor & Destructor Documentation

◆ NDIProtocol()

mitk::NDIProtocol::NDIProtocol ( )
protected

Definition at line 24 of file mitkNDIProtocol.cpp.

◆ ~NDIProtocol()

mitk::NDIProtocol::~NDIProtocol ( )
overrideprotected

Definition at line 30 of file mitkNDIProtocol.cpp.

Member Function Documentation

◆ APIREV()

mitk::NDIErrorCode mitk::NDIProtocol::APIREV ( std::string * revision)

Gives information about the tool which is assosiated with the port handle. Writes portInfo to the string.

Definition at line 1585 of file mitkNDIProtocol.cpp.

◆ BEEP()

mitk::NDIErrorCode mitk::NDIProtocol::BEEP ( unsigned char count)

Sounding the measurement system beeper. The tracking system will beep one to nine times.

Definition at line 552 of file mitkNDIProtocol.cpp.

◆ BX()

mitk::NDIErrorCode mitk::NDIProtocol::BX ( )

Report transformations in binary mode.

Definition at line 1169 of file mitkNDIProtocol.cpp.

◆ ByteToNbBitsOn()

unsigned int mitk::NDIProtocol::ByteToNbBitsOn ( char & c) const

Definition at line 1447 of file mitkNDIProtocol.cpp.

◆ COMM()

Change Serial Communication Parameters.

Definition at line 35 of file mitkNDIProtocol.cpp.

◆ DSTART()

mitk::NDIErrorCode mitk::NDIProtocol::DSTART ( )

Start the Diagnostic Mode.

Definition at line 114 of file mitkNDIProtocol.cpp.

◆ DSTOP()

mitk::NDIErrorCode mitk::NDIProtocol::DSTOP ( )

Stop the Diagnostic Mode.

Definition at line 120 of file mitkNDIProtocol.cpp.

◆ GenericCommand()

mitk::NDIErrorCode mitk::NDIProtocol::GenericCommand ( const std::string command,
const std::string * parameter = nullptr )
protected

Documentation Sends the command command to the tracking system and checks for OKAY and ERROR as replies This is used by commands like INIT, DSTART, DSTOP,... that do not need parameters or special parsing of replies

Definition at line 1404 of file mitkNDIProtocol.cpp.

◆ GetErrorCode()

mitk::NDIErrorCode mitk::NDIProtocol::GetErrorCode ( const std::string * input)
protected

returns the error code for an Error String returned from the NDI tracking device

Documentation

Definition at line 1514 of file mitkNDIProtocol.cpp.

◆ INIT()

mitk::NDIErrorCode mitk::NDIProtocol::INIT ( )

Initialize the Measurement System.

Definition at line 108 of file mitkNDIProtocol.cpp.

◆ IRATE()

mitk::NDIErrorCode mitk::NDIProtocol::IRATE ( IlluminationActivationRate rate)

Setting the illuminator rate. Will set the refresh rate for the illuminator for wireless tools.

Definition at line 532 of file mitkNDIProtocol.cpp.

◆ IRCHK()

mitk::NDIErrorCode mitk::NDIProtocol::IRCHK ( bool * IRdetected)

This version of IRCHK uses only the simple "presence of infrared light" call, that returns a binary "IR detected/no IR detected" answer.

Definition at line 132 of file mitkNDIProtocol.cpp.

◆ IRINIT()

mitk::NDIErrorCode mitk::NDIProtocol::IRINIT ( )

Initialize the System to Check for Infrared.

Definition at line 126 of file mitkNDIProtocol.cpp.

◆ itkBooleanMacro()

mitk::NDIProtocol::itkBooleanMacro ( UseCRC )

Set whether to append a CRC16 checksum to each message.

◆ itkCloneMacro()

mitk::NDIProtocol::itkCloneMacro ( Self )

◆ itkFactorylessNewMacro()

mitk::NDIProtocol::itkFactorylessNewMacro ( Self )

◆ itkGetConstMacro()

mitk::NDIProtocol::itkGetConstMacro ( UseCRC ,
bool  )

Get whether to append a CRC16 checksum to each message.

◆ itkSetMacro()

mitk::NDIProtocol::itkSetMacro ( UseCRC ,
bool  )

Set whether to append a CRC16 checksum to each message.

◆ itkSetObjectMacro()

mitk::NDIProtocol::itkSetObjectMacro ( TrackingDevice ,
NDITrackingDevice  )

◆ mitkClassMacroItkParent()

mitk::NDIProtocol::mitkClassMacroItkParent ( NDIProtocol ,
itk::Object  )

◆ ParseOkayError()

mitk::NDIErrorCode mitk::NDIProtocol::ParseOkayError ( )
protected

Documentation Reads the reply from the tracking device and checks if it is either "OKAY" or "ERROR##". if it reads an error, it returns the equivalent NDIErrorCode Replies other than OKAY or ERROR result in an NDIUNEXPECTEDREPLY

Definition at line 1464 of file mitkNDIProtocol.cpp.

◆ PDIS()

mitk::NDIErrorCode mitk::NDIProtocol::PDIS ( std::string * portHandle)

Port Disable. Will disable a port that has been enabled with PENA.

Definition at line 520 of file mitkNDIProtocol.cpp.

◆ PENA()

mitk::NDIErrorCode mitk::NDIProtocol::PENA ( std::string * portHandle,
TrackingPriority prio )

Port Enable. Will enable a port that has been initialized with PINIT.

Definition at line 492 of file mitkNDIProtocol.cpp.

◆ PHF()

mitk::NDIErrorCode mitk::NDIProtocol::PHF ( std::string * portHandle)

Port Handle Free. Frees the port handle.

Definition at line 526 of file mitkNDIProtocol.cpp.

◆ PHINF()

mitk::NDIErrorCode mitk::NDIProtocol::PHINF ( std::string portHandle,
std::string * portInfo )

Definition at line 503 of file mitkNDIProtocol.cpp.

◆ PHRQ()

mitk::NDIErrorCode mitk::NDIProtocol::PHRQ ( std::string * portHandle)

Port Handle Request. Will request a Port Handle for a wireless tool and return it in the string portHandle.

Definition at line 297 of file mitkNDIProtocol.cpp.

◆ PHSR()

mitk::NDIErrorCode mitk::NDIProtocol::PHSR ( PHSRQueryType queryType,
std::string * portHandles )

Port Handle Search. Will write returned port handles to the string portHandles.

Definition at line 213 of file mitkNDIProtocol.cpp.

◆ PINIT()

mitk::NDIErrorCode mitk::NDIProtocol::PINIT ( std::string * portHandle)

Port Initialize. Will initialize a Port that has been acquired with PHRQ and has been assigned a SROM File with PVWR.

Definition at line 412 of file mitkNDIProtocol.cpp.

◆ POS3D()

mitk::NDIErrorCode mitk::NDIProtocol::POS3D ( MarkerPointContainerType * markerPositions)

Report 3D Positions of single markers. can only be used in diagnostics mode.

Definition at line 1238 of file mitkNDIProtocol.cpp.

◆ PSOUT()

mitk::NDIErrorCode mitk::NDIProtocol::PSOUT ( std::string portHandle,
std::string state )

Set GPIO Output (Aurora)

Definition at line 643 of file mitkNDIProtocol.cpp.

◆ PVWR()

mitk::NDIErrorCode mitk::NDIProtocol::PVWR ( std::string * portHandle,
const unsigned char * sromData,
unsigned int sromDataLength )

Port Virtual Write. Writes an SROM Image data to a tool.

Definition at line 359 of file mitkNDIProtocol.cpp.

◆ SFLIST()

mitk::NDIErrorCode mitk::NDIProtocol::SFLIST ( std::string * info)

Returns information about the supported feature of the tracking system.

Definition at line 1656 of file mitkNDIProtocol.cpp.

◆ TSTART()

mitk::NDIErrorCode mitk::NDIProtocol::TSTART ( bool resetFrameCounter = false)

Start Tracking Mode. The tracking system must be in setup mode and must be initialized.

Definition at line 627 of file mitkNDIProtocol.cpp.

◆ TSTOP()

mitk::NDIErrorCode mitk::NDIProtocol::TSTOP ( )

Stop Tracking Mode. The tracking system must be in Tracking mode.

Definition at line 637 of file mitkNDIProtocol.cpp.

◆ TX()

mitk::NDIErrorCode mitk::NDIProtocol::TX ( bool trackIndividualMarkers = false,
MarkerPointContainerType * markerPositions = nullptr )

Report transformations in text mode. Optionally, individual markers can be tracked.

Definition at line 650 of file mitkNDIProtocol.cpp.

◆ TX1000()

mitk::NDIErrorCode mitk::NDIProtocol::TX1000 ( MarkerPointContainerType * markerPositions)

Report transformations in text mode.

Definition at line 923 of file mitkNDIProtocol.cpp.

◆ VER()

mitk::NDIErrorCode mitk::NDIProtocol::VER ( mitk::TrackingDeviceType & t)

returns if the tracking device is a Polaris or an Aurora system

Definition at line 1176 of file mitkNDIProtocol.cpp.

◆ VSEL()

mitk::NDIErrorCode mitk::NDIProtocol::VSEL ( mitk::TrackingDeviceData deviceData)

Sets the tracking volume to the given type. Check available tracking volumes with SFLIST first.

Definition at line 1795 of file mitkNDIProtocol.cpp.

Member Data Documentation

◆ m_TrackingDevice

NDITrackingDevice* mitk::NDIProtocol::m_TrackingDevice
protected

tracking device to which the commands will be send

Definition at line 158 of file mitkNDIProtocol.h.

◆ m_UseCRC

bool mitk::NDIProtocol::m_UseCRC
protected

whether to append a CRC16 checksum to each message

Definition at line 159 of file mitkNDIProtocol.h.


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