igstk::NDICommandInterpreter Class Reference

Mediate between a Tracker and its Communication object. More...

#include <igstkNDICommandInterpreter.h>

Inheritance diagram for igstk::NDICommandInterpreter:
Inheritance graph
[legend]
Collaboration diagram for igstk::NDICommandInterpreter:
Collaboration graph
[legend]

List of all members.

Public Types

enum  COMMBaudType {
  NDI_9600 = 0, NDI_14400 = 1, NDI_19200 = 2, NDI_38400 = 3,
  NDI_57600 = 4, NDI_115200 = 5
}
 

COMM() baud rates.

More...
enum  COMMDataType {
  NDI_8N1 = 0, NDI_8N2 = 1, NDI_8O1 = 10, NDI_8O2 = 11,
  NDI_8E1 = 20, NDI_8E2 = 21, NDI_7N1 = 100, NDI_7N2 = 101,
  NDI_7O1 = 110, NDI_7O2 = 111, NDI_7E1 = 120, NDI_7E2 = 121
}
 

COMM() data bits, parity and stop bits.

More...
enum  COMMHandshakeType { NDI_NOHANDSHAKE = 0, NDI_HANDSHAKE = 1 }
 

COMM() hardware handshaking.

More...
enum  VERModeType {
  NDI_CONTROL_FIRMWARE = 0, NDI_LEFT_SENSOR_FIRMWARE = 1, NDI_RIGHT_SENSOR_FIRMWARE = 2, NDI_TIU_FIRMWARE = 3,
  NDI_CONTROL_FIRMWARE_ENHANCED = 4
}
 

VER() reply mode types.

More...
enum  PHSRModeType {
  NDI_ALL_HANDLES = 0x00, NDI_STALE_HANDLES = 0x01, NDI_UNINITIALIZED_HANDLES = 0x02, NDI_UNENABLED_HANDLES = 0x03,
  NDI_ENABLED_HANDLES = 0x04
}
 

PHSR() handle types.

More...
enum  PENATrackingModeType { NDI_STATIC = 'S', NDI_DYNAMIC = 'D', NDI_BUTTON_BOX = 'B' }
 

PENA() tracking modes.

More...
enum  TXModeType {
  NDI_XFORMS_AND_STATUS = 0x0001, NDI_ADDITIONAL_INFO = 0x0002, NDI_SINGLE_STRAY = 0x0004, NDI_INCLUDE_OUT_OF_VOLUME = 0x0800,
  NDI_PASSIVE_STRAY = 0x1000
}
 

TX() & BX() reply mode bit definitions.

More...
enum  TXTransformType { NDI_UNOCCUPIED = 0x00, NDI_VALID = 0x01, NDI_MISSING = 0x02, NDI_DISABLED = 0x04 }
 

GetTXTransform() and general-purpose transform return values.

More...
enum  TXPortStatusType {
  NDI_TOOL_IN_PORT = 0x0001, NDI_SWITCH_1_ON = 0x0002, NDI_SWITCH_2_ON = 0x0004, NDI_SWITCH_3_ON = 0x0008,
  NDI_INITIALIZED = 0x0010, NDI_ENABLED = 0x0020, NDI_OUT_OF_VOLUME = 0x0040, NDI_PARTIALLY_IN_VOLUME = 0x0080,
  NDI_DISTURBANCE_DETECTED = 0x0200, NDI_SIGNAL_TOO_SMALL = 0x0400, NDI_SIGNAL_TOO_BIG = 0x0800, NDI_PROCESSING_EXCEPTION = 0x1000,
  NDI_PORT_HARDWARE_FAILURE = 0x2000
}
 

GetTXPortStatus() return value bits.

More...
enum  TXSystemStatusType {
  NDI_COMM_SYNC_ERROR = 0x0001, NDI_TOO_MUCH_EXTERNAL_INFRARED = 0x0002, NDI_COMM_CRC_ERROR = 0x0004, NDI_COMM_RECOVERABLE = 0x0008,
  NDI_HARDWARE_FAILURE = 0x0010, NDI_HARDWARE_CHANGE = 0x0020, NDI_PORT_OCCUPIED = 0x0040, NDI_PORT_UNOCCUPIED = 0x0080
}
 

GetTXSystemStatus() return value bits.

More...
enum  TXToolInfoType { NDI_BAD_TRANSFORM_FIT = 0x01, NDI_NOT_ENOUGH_MARKERS = 0x02, NDI_TOOL_FACE_USED = 0x70 }
 

GetTXToolInfo() return value bits.

More...
enum  TXMarkerInfoType { NDI_MARKER_MISSING = 0, NDI_MARKER_EXCEEDED_MAX_ANGLE = 1, NDI_MARKER_EXCEEDED_MAX_ERROR = 2, NDI_MARKER_USED = 3 }
 

GetTXMarkerInfo() return value bits.

More...
enum  LEDStateType { NDI_BLANK = 'B', NDI_FLASH = 'F', NDI_SOLID = 'S' }
 

LED() states.

More...
enum  PSOUTStateType { NDI_GPIO_OFF = 'O', NDI_GPIO_SOLID = 'S', NDI_GPIO_PULSE = 'P', NDI_GPIO_NO_CHANGE = 'N' }
 

PSOUT() states for General Purpose Input Output (GPIO).

More...
enum  PHINFModeType {
  NDI_BASIC = 0x0001, NDI_TESTING = 0x0002, NDI_PART_NUMBER = 0x0004, NDI_ACCESSORIES = 0x0008,
  NDI_MARKER_TYPE = 0x0010, NDI_PORT_LOCATION = 0x0020, NDI_GPIO_STATUS = 0x0040
}
 

PHINF() reply mode bits.

More...
enum  PHINFAccessoriesType {
  NDI_TOOL_IN_PORT_SWITCH = 0x01, NDI_SWITCH_1 = 0x02, NDI_SWITCH_2 = 0x04, NDI_SWITCH_3 = 0x08,
  NDI_TOOL_TRACKING_LED = 0x10, NDI_LED_1 = 0x20, NDI_LED_2 = 0x40, NDI_LED_3 = 0x80
}
 

GetPHINFAccessories() return value bits.

More...
enum  PHINFMarkerType {
  NDI_950NM = 0x00, NDI_850NM = 0x01, NDI_NDI_ACTIVE = 0x08, NDI_NDI_CERAMIC = 0x10,
  NDI_PASSIVE_ANY = 0x20, NDI_PASSIVE_SPHERE = 0x28, NDI_PASSIVE_DISC = 0x30
}
 

GetPHINFMarkerType() return value.

More...
enum  PHINFToolInfoType {
  NDI_TYPE_REFERENCE = 0x01, NDI_TYPE_POINTER = 0x02, NDI_TYPE_BUTTON = 0x03, NDI_TYPE_SOFTWARE = 0x04,
  NDI_TYPE_MICROSCOPE = 0x05, NDI_TYPE_CALIBRATION = 0x07, NDI_TYPE_DOCK = 0x08, NDI_TYPE_ISOLATION = 0x09,
  NDI_TYPE_CARM = 0x0A, NDI_TYPE_CATHETER = 0x0B
}
 

Tool type specifiers returned by GetPHINFToolType().

More...
enum  SSTATModeType { NDI_CONTROL = 0x0001, NDI_SENSORS = 0x0002, NDI_TIU = 0x0004 }
 

SSTAT() reply format bits.

More...
enum  SSTATControlType { NDI_EPROM_CODE_CHECKSUM = 0x01, NDI_EPROM_SYSTEM_CHECKSUM = 0x02 }
 

GetSSTATControl() return value bits.

More...
enum  STATSensorType {
  NDI_LEFT_ROM_CHECKSUM = 0x01, NDI_LEFT_SYNC_TYPE_1 = 0x02, NDI_LEFT_SYNC_TYPE_2 = 0x04, NDI_RIGHT_ROM_CHECKSUM = 0x10,
  NDI_RIGHT_SYNC_TYPE_1 = 0x20, NDI_RIGHT_SYNC_TYPE_2 = 0x40
}
 

GetSSTATSensor() return value bits.

More...
enum  STATTIUType {
  NDI_ROM_CHECKSUM = 0x01, NDI_OPERATING_VOLTAGES = 0x02, NDI_MARKER_SEQUENCING = 0x04, NDI_SYNC = 0x08,
  NDI_COOLING_FAN = 0x10, NDI_INTERNAL_ERROR = 0x20
}
 

GetSSTATTIU() return value bits.

More...
enum  IRCHKModeType { NDI_DETECTED = 0x0001, NDI_SOURCES = 0x0002 }
 

IRCHK() reply mode bits.

More...
enum  IRCHKSensorType { NDI_LEFT = 0, NDI_RIGHT = 1 }
 

GetIRCHKNumberOfSources(), GetIRCHKSourceXY() sensor arguments.

More...
enum  SFLISTModeType {
  NDI_FEATURE_SUMMARY = 0x00, NDI_ACTIVE_PORTS = 0x01, NDI_PASSIVE_PORTS = 0x02, NDI_VOLUMES = 0x03,
  NDI_TIP_PORTS = 0x04
}
 

SFLIST() reply mode.

More...
enum  SFLISTSummaryType { NDI_SUPPORTS_ACTIVE = 0x0001, NDI_SUPPORTS_PASSIVE = 0x0002, NDI_SUPPORTS_VOLUMES = 0x0004, NDI_SUPPORTS_SENSING = 0x0008 }
 

SFLIST() summary bits.

More...
typedef SerialCommunication CommunicationType
 Some required typedefs.

Public Member Functions

 igstkStandardClassTraitsMacro (NDICommandInterpreter, Object) public
 Macro with standard traits declarations.
void SetCommunication (CommunicationType *communication)
 Set the communication object that commands will be sent to.
CommunicationTypeGetCommunication ()
 Get the communication object.
const char * Command (const char *command)
 Send a text command to the device and receive a text reply.
void BEEP (int n)
 Cause the device to beep.
void COMM (COMMBaudType baud, COMMDataType dps, COMMHandshakeType handshake)
 Change the device communication parameters.
void DSTART ()
 Put the device into diagnostic mode.
void DSTOP ()
 Take the device out of diagnostic mode.
void INIT ()
 Initialize the device.
void IRCHK (int mode)
 Check for sources of environmental infrared.
void IRINIT ()
 Initialize the diagnostic environmental infrared checking system.
void LED (int ph, int led, LEDStateType state)
 Set a tool LED to a particular state.
void PDIS (int ph)
 Disable transform reporting on the specified port handle.
void PENA (int ph, int mode)
 Enable transform reporting on the specified port handle.
void PHF (int ph)
 Free the specified port handle.
void PHINF (int ph, int mode)
 Ask the device for information about a tool handle.
void PHRQ (const char *num, const char *sys, const char *tool, const char *port, const char *chan)
 Request a port handle given specific tool criteria.
void PHSR (PHSRModeType mode)
 List the port handles.
void PINIT (int ph)
 Initialize the tool on the specified port handle.
void PSOUT (int ph, int a, int b, int c)
 Set the three GPIO wire states for an AURORA tool.
void PVCLR (int port)
 Clear the virtual SROM for the specified port.
void PVWR (int ph, int a, const char *x)
 Write to a virtual SROM address on the specified port handle.
void RESET ()
 Send a serial break to reset the device.
void SFLIST (SFLISTModeType mode)
 Get a feature list for this device.
void SSTAT (int mode)
 Request status information from the device.
void TSTART ()
 Put the device into tracking mode.
void TSTOP ()
 Take the device out of tracking mode.
void TX (int mode)
 Request tracking information from the device.
void BX (int mode)
 Request tracking information from the device.
void VER (VERModeType n)
 Get a string that describes the device firmware version.
int GetError () const
 Get error code from the last command.
int GetPHRQHandle () const
 Get the port handle returned by a PHRQ() command.
int GetPHSRNumberOfHandles () const
 Get the number of port handles as returned by a PHSR() command.
int GetPHSRHandle (int i) const
 Get one of the port handles returned by a PHSR() command.
int GetPHSRInformation (int i) const
 Get the information for a port handle returned by a PHSR() command.
int GetPHINFPortStatus () const
 Get the 8-bit status value for the port handle.
int GetPHINFToolInfo (char information[32]) const
 Get a 31-byte string describing the tool.
int GetPHINFToolType () const
 Get an integer that describes the tool type.
unsigned int GetPHINFCurrentTest () const
 Return the results of a current test on the IREDS on an active POLARIS tool.
int GetPHINFPartNumber (char part[21]) const
 Get a 20-byte string that contains the part number of the tool.
int GetPHINFAccessories () const
 Get the 8-bit value specifying the tool accessories.
int GetPHINFMarkerType () const
 Get an 8-bit value describing the marker type for the tool.
int GetPHINFPortLocation (char location[15]) const
 Get a 14-byte description of the physical location of the tool on the system.
int GetPHINFGPIOStatus () const
 Get the 8-bit GPIO status for this tool.
int GetTXTransform (int ph, double transform[8]) const
 Get the transformation for the specified port.
int GetTXPortStatus (int ph) const
 Get the 16-bit status value for the specified port handle.
unsigned int GetTXFrame (int ph) const
 Get the camera frame number for the latest transform.
int GetTXToolInfo (int ph) const
 Get additional information about the tool transformation.
int GetTXMarkerInfo (int ph, int marker) const
 Get additional information about the tool markers.
int GetTXSingleStray (int ph, double coord[3]) const
 Get the coordinates of a stray marker on a wired POLARIS tool.
int GetTXNumberOfPassiveStrays () const
 Get the number of passive stray markers detected.
int GetTXPassiveStray (int i, double coord[3]) const
 Copy the coordinates of the specified stray marker into the supplied array.
int GetTXPassiveStrayOutOfVolume (int i) const
 Determine whether a passive stray is outside of the characterized volume.
int GetTXSystemStatus () const
 Get an 16-bit status bitfield for the system.
int GetBXTransform (int ph, double transform[8]) const
 Get the transformation for the specified port.
int GetBXPortStatus (int ph) const
 Get the 16-bit status value for the specified port handle.
unsigned int GetBXFrame (int ph) const
 Get the camera frame number for the latest transform.
int GetBXToolInfo (int ph) const
 Get additional information about the tool transformation.
int GetBXMarkerInfo (int ph, int marker) const
 Get additional information about the tool markers.
int GetBXSingleStray (int ph, double coord[3]) const
 Get the coordinates of a stray marker on a wired POLARIS tool.
int GetBXNumberOfPassiveStrays () const
 Get the number of passive stray markers detected.
int GetBXPassiveStray (int i, double coord[3]) const
 Copy the coordinates of the specified stray marker into the supplied array.
int GetBXPassiveStrayOutOfVolume (int i) const
 Determine whether a passive stray is outside of the characterized volume.
int GetBXSystemStatus () const
 Get an 16-bit status bitfield for the system.
int GetSSTATControl () const
 Get the status of the control processor.
int GetSSTATSensors () const
 Get the status of the sensor processors.
int GetSSTATTIU () const
 Get the status of the sensor processors.
const char * GetVERText () const
 Get the version information returned by the VER() command.
int GetIRCHKDetected () const
 Check to see whether environmental infrared was detected.
int GetIRCHKNumberOfSources (int side) const
 Get the number of infrared sources seen by one of the two sensors.
int GetIRCHKSourceXY (int side, int i, double xy[2]) const
 Get the coordinates of one of the infrared sources seen by one of the two sensors.

Static Public Member Functions

static const char * ErrorString (int errnum)
 Convert an error code returned by GetError() into a string that describes the error.
static char * HexEncode (char *cp, const void *data, int n)
 This function is used to convert raw binary data into a stream of hexadecimal digits that can be sent to the device.
static void * HexDecode (void *data, const char *cp, int n)
 This function converts a hex-encoded string into binary data.

Public Attributes

 ErrorCodeType

Protected Member Functions

 NDICommandInterpreter ()
 Constructor.
virtual ~NDICommandInterpreter ()
 Destructor.
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const
 Print object information.

Detailed Description

Mediate between a Tracker and its Communication object.

The NDICommandInterpreter serves to purposes: it formats and builds a CRC value for commands that are sent to the Polaris or Aurora, and it decomponses the replies from the Polaris or Aurora into numerical values.

The AuroraTracker and PolarisTracker classes should create a private instance of NDICommandInterpreter, and then pass their Communication objects to the NDICommandInterpreter.

Definition at line 43 of file igstkNDICommandInterpreter.h.


Member Typedef Documentation

Some required typedefs.

Definition at line 408 of file igstkNDICommandInterpreter.h.


Member Enumeration Documentation

COMM() baud rates.

Enumerator:
NDI_9600 
NDI_14400 
NDI_19200 
NDI_38400 
NDI_57600 
NDI_115200 

Definition at line 138 of file igstkNDICommandInterpreter.h.

COMM() data bits, parity and stop bits.

Enumerator:
NDI_8N1 
NDI_8N2 
NDI_8O1 
NDI_8O2 
NDI_8E1 
NDI_8E2 
NDI_7N1 
NDI_7N2 
NDI_7O1 
NDI_7O2 
NDI_7E1 
NDI_7E2 

Definition at line 149 of file igstkNDICommandInterpreter.h.

COMM() hardware handshaking.

Enumerator:
NDI_NOHANDSHAKE 
NDI_HANDSHAKE 

Definition at line 166 of file igstkNDICommandInterpreter.h.

VER() reply mode types.

Enumerator:
NDI_CONTROL_FIRMWARE 

control firmware

NDI_LEFT_SENSOR_FIRMWARE 

left sensor firmware

NDI_RIGHT_SENSOR_FIRMWARE 

right sensor firmware

NDI_TIU_FIRMWARE 

TIU firmware.

NDI_CONTROL_FIRMWARE_ENHANCED 

control firmware with enhanced versioning

Definition at line 173 of file igstkNDICommandInterpreter.h.

PHSR() handle types.

Enumerator:
NDI_ALL_HANDLES 
NDI_STALE_HANDLES 
NDI_UNINITIALIZED_HANDLES 
NDI_UNENABLED_HANDLES 
NDI_ENABLED_HANDLES 

Definition at line 184 of file igstkNDICommandInterpreter.h.

PENA() tracking modes.

Enumerator:
NDI_STATIC 

relatively immobile tool (reference)

NDI_DYNAMIC 

dynamic tool (most tools)

NDI_BUTTON_BOX 

tool with no IREDs (foot pedal)

Definition at line 194 of file igstkNDICommandInterpreter.h.

TX() & BX() reply mode bit definitions.

Enumerator:
NDI_XFORMS_AND_STATUS 

transforms and status

NDI_ADDITIONAL_INFO 

additional tool transform info

NDI_SINGLE_STRAY 

stray active marker reporting

NDI_INCLUDE_OUT_OF_VOLUME 

include out-of-volume tools

NDI_PASSIVE_STRAY 

stray passive marker reporting

Definition at line 202 of file igstkNDICommandInterpreter.h.

GetTXTransform() and general-purpose transform return values.

Enumerator:
NDI_UNOCCUPIED 

port unoccupied or no information

NDI_VALID 

transform has been returned

NDI_MISSING 

tool is out of view or otherwise missing

NDI_DISABLED 

port is disabled or tool was unplugged

Definition at line 212 of file igstkNDICommandInterpreter.h.

GetTXPortStatus() return value bits.

Enumerator:
NDI_TOOL_IN_PORT 
NDI_SWITCH_1_ON 
NDI_SWITCH_2_ON 
NDI_SWITCH_3_ON 
NDI_INITIALIZED 
NDI_ENABLED 
NDI_OUT_OF_VOLUME 
NDI_PARTIALLY_IN_VOLUME 
NDI_DISTURBANCE_DETECTED 
NDI_SIGNAL_TOO_SMALL 
NDI_SIGNAL_TOO_BIG 
NDI_PROCESSING_EXCEPTION 
NDI_PORT_HARDWARE_FAILURE 

Definition at line 221 of file igstkNDICommandInterpreter.h.

GetTXSystemStatus() return value bits.

Enumerator:
NDI_COMM_SYNC_ERROR 
NDI_TOO_MUCH_EXTERNAL_INFRARED 
NDI_COMM_CRC_ERROR 
NDI_COMM_RECOVERABLE 
NDI_HARDWARE_FAILURE 
NDI_HARDWARE_CHANGE 
NDI_PORT_OCCUPIED 
NDI_PORT_UNOCCUPIED 

Definition at line 239 of file igstkNDICommandInterpreter.h.

GetTXToolInfo() return value bits.

Enumerator:
NDI_BAD_TRANSFORM_FIT 
NDI_NOT_ENOUGH_MARKERS 
NDI_TOOL_FACE_USED 

Definition at line 252 of file igstkNDICommandInterpreter.h.

GetTXMarkerInfo() return value bits.

Enumerator:
NDI_MARKER_MISSING 
NDI_MARKER_EXCEEDED_MAX_ANGLE 
NDI_MARKER_EXCEEDED_MAX_ERROR 
NDI_MARKER_USED 

Definition at line 260 of file igstkNDICommandInterpreter.h.

LED() states.

Enumerator:
NDI_BLANK 

off

NDI_FLASH 

flashing

NDI_SOLID 

on

Definition at line 269 of file igstkNDICommandInterpreter.h.

PSOUT() states for General Purpose Input Output (GPIO).

Enumerator:
NDI_GPIO_OFF 

off

NDI_GPIO_SOLID 

solid

NDI_GPIO_PULSE 

pulse

NDI_GPIO_NO_CHANGE 

no change

Definition at line 277 of file igstkNDICommandInterpreter.h.

PHINF() reply mode bits.

Enumerator:
NDI_BASIC 
NDI_TESTING 
NDI_PART_NUMBER 
NDI_ACCESSORIES 
NDI_MARKER_TYPE 
NDI_PORT_LOCATION 
NDI_GPIO_STATUS 

Definition at line 286 of file igstkNDICommandInterpreter.h.

GetPHINFAccessories() return value bits.

Enumerator:
NDI_TOOL_IN_PORT_SWITCH 

tool has tool-in-port switch

NDI_SWITCH_1 

tool has button #1

NDI_SWITCH_2 

tool has button #2

NDI_SWITCH_3 

tool has button #3

NDI_TOOL_TRACKING_LED 

tool has tracking LED

NDI_LED_1 

tool has LED #1

NDI_LED_2 

tool has LED #2

NDI_LED_3 

tool has LED #3

Definition at line 298 of file igstkNDICommandInterpreter.h.

GetPHINFMarkerType() return value.

Enumerator:
NDI_950NM 
NDI_850NM 
NDI_NDI_ACTIVE 
NDI_NDI_CERAMIC 
NDI_PASSIVE_ANY 
NDI_PASSIVE_SPHERE 
NDI_PASSIVE_DISC 

Definition at line 311 of file igstkNDICommandInterpreter.h.

Tool type specifiers returned by GetPHINFToolType().

Enumerator:
NDI_TYPE_REFERENCE 
NDI_TYPE_POINTER 
NDI_TYPE_BUTTON 
NDI_TYPE_SOFTWARE 
NDI_TYPE_MICROSCOPE 
NDI_TYPE_CALIBRATION 
NDI_TYPE_DOCK 
NDI_TYPE_ISOLATION 
NDI_TYPE_CARM 
NDI_TYPE_CATHETER 

Definition at line 323 of file igstkNDICommandInterpreter.h.

SSTAT() reply format bits.

Enumerator:
NDI_CONTROL 

control processor information

NDI_SENSORS 

sensor processors

NDI_TIU 

TIU processor.

Definition at line 338 of file igstkNDICommandInterpreter.h.

GetSSTATControl() return value bits.

Enumerator:
NDI_EPROM_CODE_CHECKSUM 
NDI_EPROM_SYSTEM_CHECKSUM 

Definition at line 346 of file igstkNDICommandInterpreter.h.

GetSSTATSensor() return value bits.

Enumerator:
NDI_LEFT_ROM_CHECKSUM 
NDI_LEFT_SYNC_TYPE_1 
NDI_LEFT_SYNC_TYPE_2 
NDI_RIGHT_ROM_CHECKSUM 
NDI_RIGHT_SYNC_TYPE_1 
NDI_RIGHT_SYNC_TYPE_2 

Definition at line 353 of file igstkNDICommandInterpreter.h.

GetSSTATTIU() return value bits.

Enumerator:
NDI_ROM_CHECKSUM 
NDI_OPERATING_VOLTAGES 
NDI_MARKER_SEQUENCING 
NDI_SYNC 
NDI_COOLING_FAN 
NDI_INTERNAL_ERROR 

Definition at line 364 of file igstkNDICommandInterpreter.h.

IRCHK() reply mode bits.

Enumerator:
NDI_DETECTED 

simple yes/no whether IR detected

NDI_SOURCES 

locations of up to 20 sources per camera

Definition at line 375 of file igstkNDICommandInterpreter.h.

GetIRCHKNumberOfSources(), GetIRCHKSourceXY() sensor arguments.

Enumerator:
NDI_LEFT 

left sensor

NDI_RIGHT 

right sensor

Definition at line 382 of file igstkNDICommandInterpreter.h.

SFLIST() reply mode.

Enumerator:
NDI_FEATURE_SUMMARY 

feature summary

NDI_ACTIVE_PORTS 

number of active tool ports

NDI_PASSIVE_PORTS 

number of passive tool ports

NDI_VOLUMES 

list of volumes available (see NDI docs)

NDI_TIP_PORTS 

number of ports with current sensing

Definition at line 389 of file igstkNDICommandInterpreter.h.

SFLIST() summary bits.

Enumerator:
NDI_SUPPORTS_ACTIVE 

active tool ports are available

NDI_SUPPORTS_PASSIVE 

passive tool ports are available

NDI_SUPPORTS_VOLUMES 

multiple volumes are available

NDI_SUPPORTS_SENSING 

tool-in-port sensing is available

Definition at line 399 of file igstkNDICommandInterpreter.h.


Constructor & Destructor Documentation

igstk::NDICommandInterpreter::NDICommandInterpreter (  )  [protected]

Constructor.

virtual igstk::NDICommandInterpreter::~NDICommandInterpreter (  )  [protected, virtual]

Destructor.


Member Function Documentation

igstk::NDICommandInterpreter::igstkStandardClassTraitsMacro ( NDICommandInterpreter  ,
Object   
) [inline]

Macro with standard traits declarations.

Device and host error codes The error code is set only by Command() or by macros and functions that call Command().

Error codes that equal to or less than 0xff are error codes reported by the device itself. Error codes greater than 0xff are errors that are reported by the host computer.

The error code is returned by NDICommandInterpreter::GetError() and the corresponding text is available by passing the code to NDICommandInterpreter::ErrorString().

< No error

< Invalid command

< Command too long

< Command too short

< Bad CRC calculated for command

< Timeout on command execution

< New communication parameters failed

< Incorrect number of command parameters

< Invalid port selected

< Invalid mode selected

< Invalid LED selected

< Invalid LED state selected

< Command invalid for current mode

< No tool plugged in selected port

< Selected port not initialized

< Selected port not enabled

< System not initialized

< Failure to stop tracking

< Failure to start tracking

< Failure to initialize tool in port

< Invalid camera parameters

< Failure to initialize

< Failure to start diagnostic mode

< Failure to stop diagnostic mode

< Failure to determine environmental IR

< Failure to read firmware version

< Internal device error

< Failure to initialize for IR diagnostics

< Failure to set marker firing signature

< Failure to search for SROM IDs

< Failure to read SROM data

< Failure to write SROM data

< Failure to select SROM

< Failure to perform tool current test

< No camera parameters for this wavelength

< Command parameter out of range

< No camera parameters for this volume

< Failure to determine supported features

< Reserved error code

< Reserved error code

< SCU has changed state

< Main processor firmware corrupt

< Memory is full

< Requested handle has not been allocated

< Requested handle has become unoccupied

< All handles have been allocated

< Incompatible firmware versions

< Invalid port description

< Requested port is already assigned

< Invalid input or output state

< Invalid operation for tool

< Feature not available

< Too much environmental infrared

< Failure to erase Flash EPROM

< Failure to write Flash EPROM

< Failure to read Flash EPROM

< Bad CRC received from device

< Error opening serial device

< Bad communication parameters for host

< device took >5 secs to reply

< Device write error

< Device read error

< device failed to reset on break

< device not found on specified port

Definition at line 48 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::SetCommunication ( CommunicationType communication  ) 

Set the communication object that commands will be sent to.

CommunicationType* igstk::NDICommandInterpreter::GetCommunication (  ) 

Get the communication object.

const char* igstk::NDICommandInterpreter::Command ( const char *  command  ) 

Send a text command to the device and receive a text reply.

Parameters:
command the command to send, without the trailing CRC
Returns:
the text reply from the device with the CRC chopped off

The standard format of an NDI API command is, for example, "INIT:" or "PENA:AD". A CRC value and a carriage return will be appended to the command before it is sent to the device.

This function will automatically recogize certain commands and behave accordingly:

  • 0 - A serial break will be sent to the device if the command is a null string
  • "COMM:" - After the COMM() is sent, the host computer serial port is adjusted to match the device.
  • "PHSR:" - The information returned by the PHSR() command is stored and can be retrieved though the GetPHSR() functions.
  • "PHINF:" - The information returned by the PHINF() command is stored and can be retrieved though the GetPHINF() functions.
  • "TX:" - The information returned by the TX() command is stored and can be retrieved though the GetTX() functions.
  • "SSTAT:" - The information returned by the SSTAT() command is stored and can be retrieved through one of the GetSSTAT() functions.
  • "IRCHK:" - The information returned by the IRCHK() command is stored and can be retrieved through the GetIRCHK() functions.

The GetError() function can be used to check whether an error occured.

void igstk::NDICommandInterpreter::BEEP ( int  n  )  [inline]

Cause the device to beep.

Parameters:
n the number of times to beep, an integer between 1 and 9

This command can be used in tracking mode.

Definition at line 450 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::COMM ( COMMBaudType  baud,
COMMDataType  dps,
COMMHandshakeType  handshake 
) [inline]

Change the device communication parameters.

The host parameters will automatically be adjusted to match. If the specified baud rate is not supported by the serial port, then the error code will be set to NDI_BAD_COMM and the device will have to be reset before communication can continue. Most modern UNIX systems accept all baud rates except 14400, and Windows systems support all baud rates.

Parameters:
baud one of NDI_9600, NDI_14400, NDI_19200, NDI_38400, NDI_57600, NDI_115200
dps should usually be NDI_8N1, the most common mode
handshake one of NDI_HANDSHAKE or NDI_NOHANDSHAKE

Definition at line 463 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::DSTART (  )  [inline]

Put the device into diagnostic mode.

This must be done prior to executing the IRCHK() command. Diagnostic mode is only useful on the POLARIS.

Definition at line 469 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::DSTOP (  )  [inline]

Take the device out of diagnostic mode.

Definition at line 473 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::INIT (  )  [inline]

Initialize the device.

The device must be initialized before any other commands are sent.

Definition at line 478 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::IRCHK ( int  mode  )  [inline]

Check for sources of environmental infrared.

This command is only valid in diagnostic mode after an IRINIT command.

Parameters:
mode reply mode bits:

  • NDI_DETECTED 0x0001 - return '1' if IR detected, else '0'
  • NDI_SOURCES 0x0002 - locations of up to 20 sources per camera

The IRCHK command is used to update the information returned by the GetIRCHKDetected() and GetIRCHKSourceXY() functions.

Definition at line 490 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::IRINIT (  )  [inline]

Initialize the diagnostic environmental infrared checking system.

This command must be called prior to using the IRCHK command.

Definition at line 495 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::LED ( int  ph,
int  led,
LEDStateType  state 
) [inline]

Set a tool LED to a particular state.

Parameters:
ph valid port handle in the range 0x01 to 0xFF
led an integer between 1 and 3
state desired state: NDI_BLANK 'B', NDI_FLASH 'F' or NDI_SOLID 'S' This command can be used in tracking mode.

Definition at line 505 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PDIS ( int  ph  )  [inline]

Disable transform reporting on the specified port handle.

Parameters:
ph valid port handle in the range 0x01 to 0xFF

Definition at line 510 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PENA ( int  ph,
int  mode 
) [inline]

Enable transform reporting on the specified port handle.

Parameters:
ph valid port handle in the range 0x01 to 0xFF
mode one of NDI_STATIC 'S', NDI_DYNAMIC 'D' or NDI_BUTTON_BOX 'B'

Definition at line 517 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PHF ( int  ph  )  [inline]

Free the specified port handle.

Parameters:
ph valid port handle in the range 0x01 to 0xFF

Definition at line 522 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PHINF ( int  ph,
int  mode 
) [inline]

Ask the device for information about a tool handle.

Parameters:
ph valid port handle in the range 0x01 to 0xFF
mode a reply format mode composed of the following bits:

  • NDI_BASIC 0x0001 - get port status and basic tool information
  • NDI_TESTING 0x0002 - get current test for active tools
  • NDI_PART_NUMBER 0x0004 - get a 20 character part number
  • NDI_ACCESSORIES 0x0008 - get a summary of the tool accessories
  • NDI_MARKER_TYPE 0x0010 - get the tool marker type
  • NDI_PORT_LOCATION 0x0020 - get the physical port location
  • NDI_GPIO_STATUS 0x0040 - get AURORA GPIO status

The use of the PHINF command with the appropriate reply format updates the information returned by the following commands:

This command is not available during tracking mode.

Definition at line 547 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PHRQ ( const char *  num,
const char *  sys,
const char *  tool,
const char *  port,
const char *  chan 
) [inline]

Request a port handle given specific tool criteria.

Parameters:
num 8-digit device number or wildcard "********"
sys system type TIU "0" or AURORA SCU "1" or wildcard "*"
tool wired "0" or wireless "1" or wildcard "*"
port wired "01" to "10", wireless "0A" to "0I" or wildcard "**"
chan AURORA tool channel "00" or "01" or wildcard "**"

The use of the PHRQ command updates the information returned by the following commands:

Definition at line 561 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PHSR ( PHSRModeType  mode  )  [inline]

List the port handles.

Parameters:
mode the reply mode:

  • NDI_ALL_HANDLES 0x00 - return all handles
  • NDI_STALE_HANDLES 0x01 - only handles waiting to be freed
  • NDI_UNINITIALIZED_HANDLES 0x02 - handles needing initialization
  • NDI_UNENABLED_HANDLES 0x03 - handles needing enabling
  • NDI_ENABLED_HANDLES 0x04 - handles that are enabled

The use of the PHSR command with the appropriate reply format updates the information returned by the following commands:

This command is not available during tracking mode.

Definition at line 583 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PINIT ( int  ph  )  [inline]

Initialize the tool on the specified port handle.

Parameters:
ph valid port handle in the range 0x01 to 0xFF

Definition at line 589 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PSOUT ( int  ph,
int  a,
int  b,
int  c 
) [inline]

Set the three GPIO wire states for an AURORA tool.

The states available are NDI_GPIO_NO_CHANGE, NDI_GPIO_SOLID, NDI_GPIO_PULSE, and NDI_GPIO_OFF.

Parameters:
ph valid port handle in the range 0x01 to 0xFF
a GPIO 1 state
b GPIO 2 state
c GPIO 3 state

Definition at line 600 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PVCLR ( int  port  )  [inline]

Clear the virtual SROM for the specified port.

For a passive tool, this is equivalent to unplugging the tool. This command has been deprecated in favor of the PHF() command.

Parameters:
port one of '1', '2', '3' or 'A' to 'I'

Definition at line 607 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::PVWR ( int  ph,
int  a,
const char *  x 
) [inline]

Write to a virtual SROM address on the specified port handle.

Parameters:
ph valid port handle in the range 0x01 to 0xFF
a an address between 0x0000 and 0x07C0
x 64-byte data array encoded as a 128-character hexadecimal string

Definition at line 616 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::RESET (  )  [inline]

Send a serial break to reset the device.

If the reset was not successful, the error code will be set to NDI_RESET_FAIL.

Definition at line 621 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::SFLIST ( SFLISTModeType  mode  )  [inline]

Get a feature list for this device.

Parameters:
mode the desired reply mode

  • NDI_FEATURE_SUMMARY 0x00 - 32-bit feature summary as 8 hexadecimal digits
  • NDI_ACTIVE_PORTS 0x01 - number of active tool ports as a single digit
  • NDI_PASSIVE_PORTS 0x02 - number of passive tool ports as a single digit
  • NDI_VOLUMES 0x03 - list of volumes available (see NDI docs)
  • NDI_TIP_PORTS 0x04 - number of ports supporting tool-in-port sensing

The use of the SFLIST command with the appropriate reply format updates the information returned by the following commands:

Definition at line 640 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::SSTAT ( int  mode  )  [inline]

Request status information from the device.

Parameters:
mode a reply format mode composed of the following bits:

  • NDI_CONTROL 0x0001 - control processor information
  • NDI_SENSORS 0x0002 - sensor processors
  • NDI_TIU 0x0004 - TIU processor

The use of the SSTAT command with the appropriate reply format updates the information returned by the following commands:

This command is not available during tracking mode.

Definition at line 657 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::TSTART (  )  [inline]

Put the device into tracking mode.

Definition at line 661 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::TSTOP (  )  [inline]

Take the device out of tracking mode.

Definition at line 665 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::TX ( int  mode  )  [inline]

Request tracking information from the device.

This command is only available in tracking mode.

Parameters:
mode a reply mode containing the following bits:

  • NDI_XFORMS_AND_STATUS 0x0001 - transforms and status
  • NDI_ADDITIONAL_INFO 0x0002 - additional tool transform info
  • NDI_SINGLE_STRAY 0x0004 - stray active marker reporting
  • NDI_INCLUDE_OUT_OF_VOLUME 0x0800 - include out-of-volume tools
  • NDI_PASSIVE_STRAY 0x1000 - stray passive marker reporting

The TX command with the appropriate reply mode is used to update the data that is returned by the following functions:

Definition at line 689 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::BX ( int  mode  )  [inline]

Request tracking information from the device.

This command is only available in tracking mode.

Parameters:
mode a reply mode containing the following bits:

  • NDI_XFORMS_AND_STATUS 0x0001 - transforms and status
  • NDI_ADDITIONAL_INFO 0x0002 - additional tool transform info
  • NDI_SINGLE_STRAY 0x0004 - stray active marker reporting
  • NDI_INCLUDE_OUT_OF_VOLUME 0x0800 - include out-of-volume tools
  • NDI_PASSIVE_STRAY 0x1000 - stray passive marker reporting

The BX command with the appropriate reply mode is used to update the data that is returned by the following functions: Note: To use the BX command, you must set the data bits parameter in the COMM command to 0 (8bits).

Definition at line 715 of file igstkNDICommandInterpreter.h.

void igstk::NDICommandInterpreter::VER ( VERModeType  n  )  [inline]

Get a string that describes the device firmware version.

Parameters:
n the processor to get the firmware revision of:

  • NDI_CONTROL_FIRMWARE 0 - control firmware
  • NDI_LEFT_SENSOR_FIRMWARE 1 - left sensor firmware
  • NDI_RIGHT_SENSOR_FIRMWARE 2 - right sensor firmware
  • NDI_TIU_CIRMWARE 3 - TIU firmware
  • NDI_CONTROL_FIRMWARE_ENHANCED 4 - control firmware with enhanced versioning

Definition at line 727 of file igstkNDICommandInterpreter.h.

int igstk::NDICommandInterpreter::GetError (  )  const

Get error code from the last command.

An error code of NDI_OKAY signals that no error occurred. The error codes are listed in ErrorCodeType.

int igstk::NDICommandInterpreter::GetPHRQHandle (  )  const

Get the port handle returned by a PHRQ() command.

Returns:
a port handle between 0x01 and 0xFF

An SROM can be written to the port handle with the PVWR() command.

int igstk::NDICommandInterpreter::GetPHSRNumberOfHandles (  )  const

Get the number of port handles as returned by a PHSR() command.

Returns:
an integer, the maximum possible value is 255
int igstk::NDICommandInterpreter::GetPHSRHandle ( int  i  )  const

Get one of the port handles returned by a PHSR() command.

Parameters:
i a value between 0 and n where n is the value returned by GetPHSRNumberOfHandles().
Returns:
a port handle between 0x01 and 0xFF

The PHINF() command can be used to get detailed information about the port handle.

int igstk::NDICommandInterpreter::GetPHSRInformation ( int  i  )  const

Get the information for a port handle returned by a PHSR() command.

Parameters:
i a value between 0 and n where n is the value returned by GetPHSRNumberOfHandles().
Returns:
a 12-bit bitfield where the following bits are defined:
  • NDI_TOOL_IN_PORT 0x01 - there is a tool in the port
  • NDI_SWITCH_1_ON 0x02 - button 1 is pressed
  • NDI_SWITCH_2_ON 0x04 - button 2 is pressed
  • NDI_SWITCH_3_ON 0x08 - button 3 is pressed
  • NDI_INITIALIZED 0x10 - tool port has been initialized
  • NDI_ENABLED 0x20 - tool port is enabled for tracking
  • NDI_CURRENT_DETECT 0x80 - tool sensed through current detection

The PHINF() command can be used to get detailed information about the port handle.

int igstk::NDICommandInterpreter::GetPHINFPortStatus (  )  const

Get the 8-bit status value for the port handle.

Returns:
an integer composed of the following bits:
  • NDI_TOOL_IN_PORT 0x01 - there is a tool in the port
  • NDI_SWITCH_1_ON 0x02 - button 1 is pressed
  • NDI_SWITCH_2_ON 0x04 - button 2 is pressed
  • NDI_SWITCH_3_ON 0x08 - button 3 is pressed
  • NDI_INITIALIZED 0x10 - tool port has been initialized
  • NDI_ENABLED 0x20 - tool port is enabled for tracking
  • NDI_CURRENT_DETECT 0x80 - tool sensed through current detection

The return value is updated only when a PHINF() command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetPHINFToolInfo ( char  information[32]  )  const

Get a 31-byte string describing the tool.

Parameters:
information array that information is returned in (the resulting string is not null-terminated)
Returns:
one of:
  • NDI_UNOCCUPIED - port is unoccupied or no information is available
  • NDI_VALID - information was returned

The returned string will contain 31 bytes of information followed by a terminating null byte. If the port is unoccupied then the contents of the information string are undefined.

The first 8 bytes are a 32-bit hexidecimal number that provide a generic tool description, and the following 23 bytes provide a manufacturer-specific tool description.

The information is updated only when a PHINF() command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetPHINFToolType (  )  const

Get an integer that describes the tool type.

Returns:
  • integer that describes the tool type (see NDI documentation)

This method returns a value that describes the tool type, which will be one of NDI_TYPE_REFERENCE, NDI_TYPE_POINTER, NDI_TYPE_BUTTON (button box or foot pedal), NDI_TYPE_SOFTWARE (custom tool), NDI_TYPE_MICROSCOPE, NDI_TYPE_CALIBRATION, NDI_TYPE_DOCK, NDI_TYPE_ISOLATION, NDI_TYPE_CARM, or NDI_TYPE_CATHETER.

A return value of 0 indicates that no tool type information is available.

The information is updated only when a PHINF() command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.

unsigned int igstk::NDICommandInterpreter::GetPHINFCurrentTest (  )  const

Return the results of a current test on the IREDS on an active POLARIS tool.

Returns:
32-bit integer (see NDI documentation)

The information is updated only when a PHINF() command is sent with the NDI_TESTING (0x0002) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetPHINFPartNumber ( char  part[21]  )  const

Get a 20-byte string that contains the part number of the tool.

Parameters:
part array that part number is returned in (the resulting string is not null-terminated)
Returns:
one of:
  • NDI_UNOCCUPIED - port is unoccupied or no information is available
  • NDI_VALID - information was returned

The information will include 20 bytes of information followed by a null byte.

The information is updated only when a PHINF() command is sent with the NDI_PART_NUMBER (0x0004) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetPHINFAccessories (  )  const

Get the 8-bit value specifying the tool accessories.

Returns:
an integer composed of the following bits:
  • NDI_TOOL_IN_PORT_SWITCH 0x01 - tool has tool-in-port switch
  • NDI_SWITCH_1 0x02 - tool has button 1
  • NDI_SWITCH_2 0x04 - tool has button 2
  • NDI_SWITCH_3 0x08 - tool has button 3
  • NDI_TOOL_TRACKING_LED 0x10 - tool has tracking LED
  • NDI_LED_1 0x20 - tool has LED 1
  • NDI_LED_2 0x40 - tool has LED 2
  • NDI_LED_3 0x80 - tool has LED 3

If there is no available information for the specified port, or if an illegal port specifier value is used, the return value is zero.

The return value is updated only when a PHINF() command is sent with the NDI_ACCESSORIES (0x0008) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetPHINFMarkerType (  )  const

Get an 8-bit value describing the marker type for the tool.

The low three bits descibe the wavelength, and the high three bits are the marker type code.

Returns:
see NDI documentation for more information:
  • low bits:
    • NDI_950NM 0x00
    • NDI_850NM 0x01
  • high bits:
    • NDI_NDI_ACTIVE 0x08
    • NDI_NDI_CERAMIC 0x10
    • NDI_PASSIVE_ANY 0x20
    • NDI_PASSIVE_SPHERE 0x28
    • NDI_PASSIVE_DISC 0x30

The return value is updated only when a PHINF() command is sent with the NDI_MARKER_TYPE (0x0010) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetPHINFPortLocation ( char  location[15]  )  const

Get a 14-byte description of the physical location of the tool on the system.

The 15th byte will be a null byte to terminate the string.

Returns:
see NDI documentation for more information:
  • 8 chars: device number
  • 1 char: 0 = POLARIS, 1 = AURORA
  • 1 char: 0 = wired, 1 = wireless
  • 2 chars: port number 01-12 or 0A-0I
  • 2 chars: hexadecimal channel number

The return value is updated only when a PHINF() command is sent with the NDI_PORT_LOCATION (0x0020) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetPHINFGPIOStatus (  )  const

Get the 8-bit GPIO status for this tool.

Returns:
an 8-bit integer, see NDI documentation for more information.

The return value is updated only when a PHINF() command is sent with the NDI_GPIO_STATUS (0x0040) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetTXTransform ( int  ph,
double  transform[8] 
) const

Get the transformation for the specified port.

The first four numbers are a quaternion, the next three numbers are the coodinates in millimetres, and the final number is a unitless error estimate.

Parameters:
ph valid port handle in range 0x01 to 0xFF
transform space for the 8 numbers in the transformation
Returns:
one of the following:
  • NDI_UOCCUPIED if an invalid port handle was specified
  • NDI_VALID if successful
  • NDI_DISABLED if tool port is nonexistent or disabled
  • NDI_MISSING if tool transform cannot be computed (tool is out of range)

If NDI_VALID is not returned, then the values in the supplied transform array will be left unchanged.

The transformations for each of the port handles remain the same until the next TX() command is sent to the device.

int igstk::NDICommandInterpreter::GetTXPortStatus ( int  ph  )  const

Get the 16-bit status value for the specified port handle.

Parameters:
ph valid port handle in range 0x01 to 0xFF
Returns:
status bits or zero if there is no information:
  • NDI_TOOL_IN_PORT 0x0001
  • NDI_SWITCH_1_ON 0x0002
  • NDI_SWITCH_2_ON 0x0004
  • NDI_SWITCH_3_ON 0x0008
  • NDI_INITIALIZED 0x0010
  • NDI_ENABLED 0x0020
  • NDI_OUT_OF_VOLUME 0x0040
  • NDI_PARTIALLY_IN_VOLUME 0x0080

This information is updated each time that the TX() command is sent to the device.

unsigned int igstk::NDICommandInterpreter::GetTXFrame ( int  ph  )  const

Get the camera frame number for the latest transform.

Parameters:
ph valid port handle in range 0x01 to 0xFF
Returns:
a 32-bit frame number, or zero if no information was available

This information is updated each time that the TX() command is sent to the device.

int igstk::NDICommandInterpreter::GetTXToolInfo ( int  ph  )  const

Get additional information about the tool transformation.

Parameters:
ph valid port handle in range 0x01 to 0xFF
Returns:
status bits, or zero if there is no information available
  • NDI_BAD_TRANSFORM_FIT 0x01
  • NDI_NOT_ENOUGH_MARKERS 0x02
  • NDI_TOOL_FACE_USED 0x70 - 3 bits give 8 possible faces

The tool information is only updated when the TX() command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit.

int igstk::NDICommandInterpreter::GetTXMarkerInfo ( int  ph,
int  marker 
) const

Get additional information about the tool markers.

Parameters:
ph valid port handle in range 0x01 to 0xFF
marker one of 'A' through 'T' for the 20 markers
Returns:
status bits, or zero if there is no information available
  • NDI_MARKER_MISSING 0
  • NDI_MARKER_EXCEEDED_MAX_ANGLE 1
  • NDI_MARKER_EXCEEDED_MAX_ERROR 2
  • NDI_MARKER_USED 3

The tool marker information is only updated when the TX() command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit set.

int igstk::NDICommandInterpreter::GetTXSingleStray ( int  ph,
double  coord[3] 
) const

Get the coordinates of a stray marker on a wired POLARIS tool.

This command is only meaningful for tools that have a stray marker.

Parameters:
ph valid port handle in range 0x01 to 0xFF
coord array to hold the three coordinates
Returns:
the return value will be one of
  • NDI_UOCCUPIED - no information available
  • NDI_VALID - values returned in coord
  • NDI_DISABLED - port disabled or illegal port specified
  • NDI_MISSING - stray marker is not visible to the device

The stray marker position is only updated when the TX() command is called with the NDI_SINGLE_STRAY (0x0004) bit set.

int igstk::NDICommandInterpreter::GetTXNumberOfPassiveStrays (  )  const

Get the number of passive stray markers detected.

Returns:
a number between 0 and 20

The passive stray marker coordinates are updated when a TX() command is sent with the NDI_PASSIVE_STRAY (0x1000) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetTXPassiveStray ( int  i,
double  coord[3] 
) const

Copy the coordinates of the specified stray marker into the supplied array.

Parameters:
i a number between 0 and 49
coord array to hold the coordinates
Returns:
one of:
  • NDI_UNOCCUPIED - the index i is out of range
  • NDI_VALID - information was returned in coord

Use GetTXNumberOfPassiveStrays() to get the number of stray markers that are visible.

The passive stray marker coordinates are updated when a TX() command is sent with the NDI_PASSIVE_STRAY (0x1000) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetTXPassiveStrayOutOfVolume ( int  i  )  const

Determine whether a passive stray is outside of the characterized volume.

Parameters:
i a number between 0 and 49
Returns:
one of:
  • 1 - marker is out of volume
  • 0 - marker is inside volume or i is out of range

Use GetTXNumberOfPassiveStrays() to get the number of stray markers that are visible.

This information is updated when a TX() command is sent with the NDI_PASSIVE_STRAY (0x1000) and the NDI_INCLUDE_OUT_OF_VOLUME (0x0800) bits set in the reply mode..

int igstk::NDICommandInterpreter::GetTXSystemStatus (  )  const

Get an 16-bit status bitfield for the system.

Returns:
status bits or zero if there is no information:
  • NDI_COMM_SYNC_ERROR 0x0001
  • NDI_TOO_MUCH_EXTERNAL_INFRARED 0x0002
  • NDI_COMM_CRC_ERROR 0x0004
  • NDI_COMM_RECOVERABLE 0x0008
  • NDI_HARDWARE_FAILURE 0x0010
  • NDI_HARDWARE_CHANGE 0x0020
  • NDI_PORT_OCCUPIED 0x0040
  • NDI_PORT_UNOCCUPIED 0x0080

The system stutus information is updated whenever the TX() command is called with the NDI_XFORMS_AND_STATUS (0x0001) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetBXTransform ( int  ph,
double  transform[8] 
) const

Get the transformation for the specified port.

The first four numbers are a quaternion, the next three numbers are the coodinates in millimetres, and the final number is a unitless error estimate.

Parameters:
ph valid port handle in range 0x01 to 0xFF
transform space for the 8 numbers in the transformation
Returns:
one of the following:
  • NDI_UNOCCUPIED if an invalid port handle was supplied
  • NDI_VALID if successful
  • NDI_DISABLED if tool port is nonexistent or disabled
  • NDI_MISSING if tool transform cannot be computed (tool is out of range)

If NDI_VALID is not returned, then the values in the supplied transform array will be left unchanged.

The transformations for each of the port handles remain the same until the next BX() command is sent to the device.

int igstk::NDICommandInterpreter::GetBXPortStatus ( int  ph  )  const

Get the 16-bit status value for the specified port handle.

Parameters:
ph valid port handle in range 0x01 to 0xFF
Returns:
status bits or zero if there is no information:
  • NDI_TOOL_IN_PORT 0x0001
  • NDI_SWITCH_1_ON 0x0002
  • NDI_SWITCH_2_ON 0x0004
  • NDI_SWITCH_3_ON 0x0008
  • NDI_INITIALIZED 0x0010
  • NDI_ENABLED 0x0020
  • NDI_OUT_OF_VOLUME 0x0040
  • NDI_PARTIALLY_IN_VOLUME 0x0080
  • NDI_DISTURBANCE_DETECTED 0x0200;
  • NDI_SIGNAL_TOO_SMALL 0x0400;
  • NDI_SIGNAL_TOO_BIG 0x0800;
  • NDI_PROCESSING_EXCEPTION 0x1000;
  • NDI_HARDWARE_FAILURE 0x2000;

This information is updated each time that the BX() command is sent to the device.

unsigned int igstk::NDICommandInterpreter::GetBXFrame ( int  ph  )  const

Get the camera frame number for the latest transform.

Parameters:
ph valid port handle in range 0x01 to 0xFF
Returns:
a 32-bit frame number, or zero if no information was available

This information is updated each time that the BX() command is sent to the device.

int igstk::NDICommandInterpreter::GetBXToolInfo ( int  ph  )  const

Get additional information about the tool transformation.

Parameters:
ph valid port handle in range 0x01 to 0xFF
Returns:
status bits, or zero if there is no information available
  • NDI_BAD_TRANSFORM_FIT 0x01
  • NDI_NOT_ENOUGH_MARKERS 0x02
  • NDI_TOOL_FACE_USED 0x70 - 3 bits give 8 possible faces

The tool information is only updated when the BX() command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit.

int igstk::NDICommandInterpreter::GetBXMarkerInfo ( int  ph,
int  marker 
) const

Get additional information about the tool markers.

Parameters:
ph valid port handle in range 0x01 to 0xFF
marker one of 'A' through 'T' for the 20 markers
Returns:
status bits, or zero if there is no information available
  • NDI_MARKER_MISSING 0
  • NDI_MARKER_EXCEEDED_MAX_ANGLE 1
  • NDI_MARKER_EXCEEDED_MAX_ERROR 2
  • NDI_MARKER_USED 3

The tool marker information is only updated when the BX() command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit set.

int igstk::NDICommandInterpreter::GetBXSingleStray ( int  ph,
double  coord[3] 
) const

Get the coordinates of a stray marker on a wired POLARIS tool.

This command is only meaningful for tools that have a stray marker.

Parameters:
ph valid port handle in range 0x01 to 0xFF
coord array to hold the three coordinates
Returns:
the return value will be one of
  • NDI_UNOCCUPIED - no information is available
  • NDI_VALID - values returned in coord
  • NDI_DISABLED - port disabled or illegal port specified
  • NDI_MISSING - stray marker is not visible to the device

The stray marker position is only updated when the BX() command is called with the NDI_SINGLE_STRAY (0x0004) bit set.

int igstk::NDICommandInterpreter::GetBXNumberOfPassiveStrays (  )  const

Get the number of passive stray markers detected.

Returns:
a number between 0 and 20

The passive stray marker coordinates are updated when a BX() command is sent with the NDI_PASSIVE_STRAY (0x1000) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetBXPassiveStray ( int  i,
double  coord[3] 
) const

Copy the coordinates of the specified stray marker into the supplied array.

Parameters:
i a number between 0 and 19
coord array to hold the coordinates
Returns:
one of:
  • NDI_UNOCCUPIED - the index i is out of range
  • NDI_VALID - information was returned in coord

Use GetTXNumberOfPassiveStrays() to get the number of stray markers that are visible.

The passive stray marker coordinates are updated when a BX() command is sent with the NDI_PASSIVE_STRAY (0x1000) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetBXPassiveStrayOutOfVolume ( int  i  )  const

Determine whether a passive stray is outside of the characterized volume.

Parameters:
i a number between 0 and 49
Returns:
one of:
  • 1 - marker is out of volume
  • 0 - marker is inside volume or i is out of range

Use GetBXNumberOfPassiveStrays() to get the number of stray markers that are visible.

This information is updated when a BX() command is sent with the NDI_PASSIVE_STRAY (0x1000) and the NDI_INCLUDE_OUT_OF_VOLUME (0x0800) bits set in the reply mode..

int igstk::NDICommandInterpreter::GetBXSystemStatus (  )  const

Get an 16-bit status bitfield for the system.

Returns:
status bits or zero if there is no information:
  • NDI_COMM_SYNC_ERROR 0x0001
  • NDI_TOO_MUCH_EXTERNAL_INFRARED 0x0002
  • NDI_COMM_CRC_ERROR 0x0004
  • NDI_COMM_RECOVERABLE 0x0008
  • NDI_HARDWARE_FAILURE 0x0010
  • NDI_HARDWARE_CHANGE 0x0020
  • NDI_PORT_OCCUPIED 0x0040
  • NDI_PORT_UNOCCUPIED 0x0080

The system stutus information is updated whenever the BX() command is called with the NDI_XFORMS_AND_STATUS (0x0001) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetSSTATControl (  )  const

Get the status of the control processor.

Returns:
an int with the following bit definitions for errors:
  • NDI_EPROM_CODE_CHECKSUM 0x01
  • NDI_EPROM_SYSTEM_CHECKSUM 0x02

This information is updated only when the SSTAT() command is sent with the NDI_CONTROL (0x0001) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetSSTATSensors (  )  const

Get the status of the sensor processors.

Returns:
an int with the following bit definitions for errors:
  • NDI_LEFT_ROM_CHECKSUM 0x01
  • NDI_LEFT_SYNC_TYPE_1 0x02
  • NDI_LEFT_SYNC_TYPE_2 0x04
  • NDI_RIGHT_ROM_CHECKSUM 0x10
  • NDI_RIGHT_SYNC_TYPE_1 0x20
  • NDI_RIGHT_SYNC_TYPE_2 0x40

This information is updated only when the SSTAT() command is sent with the NDI_SENSORS (0x0002) bit set in the reply mode.

int igstk::NDICommandInterpreter::GetSSTATTIU (  )  const

Get the status of the sensor processors.

Returns:
an int with the following bit definitions for errors:
  • NDI_ROM_CHECKSUM 0x01
  • NDI_OPERATING_VOLTAGES 0x02
  • NDI_MARKER_SEQUENCING 0x04
  • NDI_SYNC 0x08
  • NDI_COOLING_FAN 0x10
  • NDI_INTERNAL_ERROR 0x20

This information is updated only when the SSTAT() command is sent with the NDI_TIU (0x0004) bit set in the reply mode.

const char* igstk::NDICommandInterpreter::GetVERText (  )  const

Get the version information returned by the VER() command.

int igstk::NDICommandInterpreter::GetIRCHKDetected (  )  const

Check to see whether environmental infrared was detected.

Returns:
1 if infrared was detected and 0 otherwise.

This information is only updated if the IRCHK() command is called with the NDI_DETECTED (0x0001) format bit set.

int igstk::NDICommandInterpreter::GetIRCHKNumberOfSources ( int  side  )  const

Get the number of infrared sources seen by one of the two sensors.

Parameters:
side one of NDI_LEFT or NDI_RIGHT

return the number of infrared sources seen by the specified sensor

This information is valid only immediately after the IRCHK() command has been called with the NDI_SOURCES (0x0002) format bit set. Otherwise, the return value will be zero.

int igstk::NDICommandInterpreter::GetIRCHKSourceXY ( int  side,
int  i,
double  xy[2] 
) const

Get the coordinates of one of the infrared sources seen by one of the two sensors.

Parameters:
side one of NDI_LEFT or NDI_RIGHT
i the source to get the coordinates for
xy space to store the returned coordinates

return NDI_VALID, or NDI_UNOCCUPIED if i is out of range

If there is no available information, then the xy array will be left unchanged and the value NDI_MISSING will be returned. Otherwise, the return value will be NDI_OKAY.

This information is valid only immediately after the IRCHK() command has been called with the NDI_SOURCES (0x0002) format bit set.

static const char* igstk::NDICommandInterpreter::ErrorString ( int  errnum  )  [static]

Convert an error code returned by GetError() into a string that describes the error.

An unrecognized error code will return "Unrecognized error code".

static char* igstk::NDICommandInterpreter::HexEncode ( char *  cp,
const void *  data,
int  n 
) [static]

This function is used to convert raw binary data into a stream of hexadecimal digits that can be sent to the device.

The length of the output string will be twice the number of bytes in the input data, since each byte will be represented by two hexadecimal digits.

As a convenience, the return value is a pointer to the hexadecimal string. If the string must be terminated, then set cp[2*n] to 0 before calling this function, otherwise the string will be left unterminated.

static void* igstk::NDICommandInterpreter::HexDecode ( void *  data,
const char *  cp,
int  n 
) [static]

This function converts a hex-encoded string into binary data.

This can be used to decode the SROM data sent from the device. The length of the input string must be twice the expected number of bytes in the output data, since each binary byte is ecoded by two hexadecimal digits.

As a convenience, the return value is a pointer to the decoded data.

virtual void igstk::NDICommandInterpreter::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const [protected, virtual]

Print object information.

Reimplemented from igstk::Object.


Member Data Documentation

Definition at line 135 of file igstkNDICommandInterpreter.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Sun Aug 30 05:50:12 2009 for IGSTK by  doxygen 1.6.1