IGSTK
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | List of all members
igstk::Tracker Class Reference

Abstract superclass for concrete IGSTK Tracker classes. More...

#include <igstkTracker.h>

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

Public Member Functions

void RequestOpen (void)
 The "RequestOpen" method attempts to open communication with the tracking device.
void RequestClose (void)
 The "RequestClose" method closes communication with the device.
void RequestReset (void)
 
The "RequestReset" tracker method should be used to bring the tracker

to some defined default state.

void RequestStartTracking (void)
 
The "RequestStartTracking" method readies the tracker for tracking the

tools connected to the tracker.

void RequestStopTracking (void)
 The "RequestStopTracking" stops tracker from tracking the tools.
void RequestSetFrequency (double frequencyInHz)
 The "RequestSetFrequency" method defines the frequency at which the Transform information will be queried from the Tracker device.
void RequestSetReferenceTool (TrackerToolType *trackerTool)
 Set a reference tracker tool.
virtual void SetThreadingEnabled (bool _arg)
 SetThreadingEnabled(bool) : set m_ThreadingEnabled value.
virtual bool GetThreadingEnabled ()
 GetThreadingEnabled(bool) : get m_ThreadingEnabled value.
- Public Member Functions inherited from igstk::Object
virtual const char * GetNameOfClass () const
void SetLogger (LoggerType *logger)
 Connect the Logger for this class.
void RemoveObserver (unsigned long tag) const

Public Attributes

igstkStandardAbstractClassTraitsMacro(Tracker,
Object) public typedef
TrackerTool 
TrackerToolType
 Macro with standard traits declarations.

Protected Types

enum  ResultType { FAILURE = 0, SUCCESS }
typedef Transform::TimePeriodType TimePeriodType
 typedef for times used by the tracker
typedef Transform TransformType
 typedefs from Transform class
typedef std::map< std::string,
TrackerToolType * > 
TrackerToolsContainerType
 typedefs from TrackerTool class

Protected Member Functions

 Tracker (void)
virtual ~Tracker (void)
virtual TimePeriodType GetValidityTime ()
 Get the validity time.
virtual ResultType InternalOpen (void)=0
 The "InternalOpen" method opens communication with a tracking device.
virtual ResultType InternalClose (void)=0
 The "InternalClose" method closes communication with a tracking device.
virtual ResultType InternalReset (void)=0
 The "InternalReset" method resets tracker to a known configuration.
virtual ResultType InternalStartTracking (void)=0
 The "InternalStartTracking" method starts tracking.
virtual ResultType InternalStopTracking (void)=0
 The "InternalStopTracking" method stops tracking.
virtual ResultType InternalUpdateStatus (void)=0
 The "InternalUpdateStatus" method updates tracker status.
virtual ResultType InternalThreadedUpdateStatus (void)=0
 The "InternalThreadedUpdateStatus" method updates tracker status.
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const
 Print the object information in a stream.
virtual ResultType VerifyTrackerToolInformation (const TrackerToolType *)=0
 Verify if a tracker tool information is correct before attaching it to the tracker.
virtual ResultType ValidateSpecifiedFrequency (double frequencyInHz)
 The "ValidateSpecifiedFrequency" method checks if the specified frequency is valid for the tracking device that is being used.
virtual ResultType RemoveTrackerToolFromInternalDataContainers (const TrackerToolType *trackerTool)=0
 This method will remove entries of the traceker tool from internal data containers.
virtual ResultType AddTrackerToolToInternalDataContainers (const TrackerToolType *trackerTool)=0
 Add tracker tool entry to internal containers.
const TrackerToolsContainerTypeGetTrackerToolContainer () const
 Access method for the tracker tool container.
void ReportTrackingToolNotAvailable (TrackerToolType *trackerTool) const
 Report to tracker tool that it is not available for tracking.
void ReportTrackingToolVisible (TrackerToolType *trackerTool) const
 Report to tracker tool that it is visible.
void SetTrackerToolRawTransform (TrackerToolType *trackerTool, const TransformType transform)
 Set tracker tool raw transform.
void SetTrackerToolTransformUpdate (TrackerToolType *trackerTool, bool flag) const
 Turn on/off update flag of the tracker tool.
void ExitTrackingStateProcessing (void)
 Depending on the tracker type, the tracking thread should be terminated or left untouched when we stop tracking.
void ExitTrackingWithoutTerminatingTrackingThread ()
 Exit tracking without terminating tracking thread.
void ExitTrackingTerminatingTrackingThread ()
 Exit tracking after terminating tracking thread.
- Protected Member Functions inherited from igstk::Object
LoggerTypeGetLogger () const
 Object (void)
 Constructor is protected in order to enforce the use of the New() operator.
virtual ~Object (void)
void RegisterObservedObject (const ::igstk::Object *object, unsigned long tag)
 Register observed objects in an internal array so that they can be disconnected upon destruction.
void RemoveFromObservedObjects ()
 Remove observers that this object may have connected to other objects.

Additional Inherited Members

- Public Types inherited from igstk::Object
typedef Object Self
 General Typedefs.
typedef ::itk::Object Superclass
typedef ::itk::SmartPointer< SelfPointer
typedef ::itk::SmartPointer
< const Self
ConstPointer
typedef igstk::Logger LoggerType
- Static Public Member Functions inherited from igstk::Object
static Pointer New (void)

Detailed Description

Abstract superclass for concrete IGSTK Tracker classes.

This class presents a generic interface for tracking the positions of objects in IGSTK. The various derived subclasses of this class provide back-ends that communicate with several of the tracking systems that are available on the market.

The state machine of this class implements the basic state transitions of a tracker. Inputs to the state machine are translated into method calls that can be overridden by device-specific derive classes that do the appropriate processing for a particular device.

Most (but not all) of the derived classes utilize a communication object to mediate all communication between the computer and the device. When a communication object is used, all communication can be logged, and furthermore, the communication log can be used to drive an offline simulation of a particular device (See SerialCommunicationSimulator).

The following diagram illustrates the state machine of the tracker class

igstkDummyTracker.png
Tracker State Machine Diagram

Definition at line 96 of file igstkTracker.h.

Member Typedef Documentation

typedef for times used by the tracker

Definition at line 154 of file igstkTracker.h.

typedefs from Transform class

Definition at line 166 of file igstkTracker.h.

typedef std::map< std::string, TrackerToolType *> igstk::Tracker::TrackerToolsContainerType
protected

typedefs from TrackerTool class

Definition at line 241 of file igstkTracker.h.

Member Enumeration Documentation

Enumerator:
FAILURE 
SUCCESS 

Definition at line 159 of file igstkTracker.h.

Constructor & Destructor Documentation

igstk::Tracker::Tracker ( void  )
protected
virtual igstk::Tracker::~Tracker ( void  )
protectedvirtual

Member Function Documentation

void igstk::Tracker::RequestOpen ( void  )

The "RequestOpen" method attempts to open communication with the tracking device.

It generates a TrackerOpenEvent if successful, or a TrackerOpenErrorEvent if not successful.

void igstk::Tracker::RequestClose ( void  )

The "RequestClose" method closes communication with the device.

It generates a TrackerCloseEvent if successful, or a TrackerCloseErrorEvent if not successful.

void igstk::Tracker::RequestReset ( void  )

The "RequestReset" tracker method should be used to bring the tracker

to some defined default state.

void igstk::Tracker::RequestStartTracking ( void  )

The "RequestStartTracking" method readies the tracker for tracking the

tools connected to the tracker.

void igstk::Tracker::RequestStopTracking ( void  )

The "RequestStopTracking" stops tracker from tracking the tools.

void igstk::Tracker::RequestSetFrequency ( double  frequencyInHz)

The "RequestSetFrequency" method defines the frequency at which the Transform information will be queried from the Tracker device.

Note that Tracker devices have their own internal frequency rate, and if you set here a frequency that is higher than what the Tracker device is capable to follow, then you will start receiving transforms with repeated values.

void igstk::Tracker::RequestSetReferenceTool ( TrackerToolType trackerTool)

Set a reference tracker tool.

virtual void igstk::Tracker::SetThreadingEnabled ( bool  _arg)
virtual

SetThreadingEnabled(bool) : set m_ThreadingEnabled value.

virtual bool igstk::Tracker::GetThreadingEnabled ( )
virtual

GetThreadingEnabled(bool) : get m_ThreadingEnabled value.

virtual TimePeriodType igstk::Tracker::GetValidityTime ( )
protectedvirtual

Get the validity time.

virtual ResultType igstk::Tracker::InternalOpen ( void  )
protectedpure virtual

The "InternalOpen" method opens communication with a tracking device.

This method is to be implemented by a descendant class and responsible for device-specific processing

Implemented in igstk::Ascension3DGTracker, igstk::MicronTracker, igstk::InfiniTrackTracker, igstk::AscensionTracker, igstk::NDITracker, igstk::CircularSimulatedTracker, igstk::SimulatedTracker, igstk::MouseTracker, and igstk::QMouseTracker.

virtual ResultType igstk::Tracker::InternalClose ( void  )
protectedpure virtual

The "InternalClose" method closes communication with a tracking device.

This method is to be implemented by a descendant class and responsible for device-specific processing

Implemented in igstk::Ascension3DGTracker, igstk::MicronTracker, igstk::InfiniTrackTracker, igstk::AscensionTracker, igstk::CircularSimulatedTracker, igstk::MouseTracker, igstk::QMouseTracker, igstk::NDITracker, and igstk::SimulatedTracker.

virtual ResultType igstk::Tracker::InternalReset ( void  )
protectedpure virtual

The "InternalReset" method resets tracker to a known configuration.

This method is to be implemented by a descendant class and responsible for device-specific processing

Implemented in igstk::Ascension3DGTracker, igstk::MicronTracker, igstk::AscensionTracker, igstk::InfiniTrackTracker, igstk::NDITracker, igstk::CircularSimulatedTracker, igstk::MouseTracker, igstk::QMouseTracker, and igstk::SimulatedTracker.

virtual ResultType igstk::Tracker::InternalStartTracking ( void  )
protectedpure virtual

The "InternalStartTracking" method starts tracking.

This method is to be implemented by a descendant class and responsible for device-specific processing

Implemented in igstk::Ascension3DGTracker, igstk::MicronTracker, igstk::InfiniTrackTracker, igstk::AscensionTracker, igstk::NDITracker, igstk::CircularSimulatedTracker, igstk::SimulatedTracker, igstk::MouseTracker, and igstk::QMouseTracker.

virtual ResultType igstk::Tracker::InternalStopTracking ( void  )
protectedpure virtual

The "InternalStopTracking" method stops tracking.

This method is to be implemented by a descendant class and responsible for device-specific processing

Implemented in igstk::Ascension3DGTracker, igstk::MicronTracker, igstk::InfiniTrackTracker, igstk::AscensionTracker, igstk::NDITracker, igstk::CircularSimulatedTracker, igstk::MouseTracker, igstk::QMouseTracker, and igstk::SimulatedTracker.

virtual ResultType igstk::Tracker::InternalUpdateStatus ( void  )
protectedpure virtual

The "InternalUpdateStatus" method updates tracker status.

This method is to be implemented by a descendant class and responsible for device-specific processing

Implemented in igstk::Ascension3DGTracker, igstk::MicronTracker, igstk::InfiniTrackTracker, igstk::AscensionTracker, igstk::CircularSimulatedTracker, igstk::SimulatedTracker, igstk::NDITracker, igstk::MouseTracker, and igstk::QMouseTracker.

virtual ResultType igstk::Tracker::InternalThreadedUpdateStatus ( void  )
protectedpure virtual

The "InternalThreadedUpdateStatus" method updates tracker status.

This method is called in a separate thread. This method is to be implemented by a descendant class and responsible for device-specific processing

Implemented in igstk::Ascension3DGTracker, igstk::InfiniTrackTracker, igstk::MicronTracker, igstk::AscensionTracker, igstk::CircularSimulatedTracker, igstk::SimulatedTracker, igstk::NDITracker, igstk::MouseTracker, and igstk::QMouseTracker.

virtual void igstk::Tracker::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
protectedvirtual
virtual ResultType igstk::Tracker::VerifyTrackerToolInformation ( const TrackerToolType )
protectedpure virtual

Verify if a tracker tool information is correct before attaching it to the tracker.

This method is used to verify the information supplied by the user about the tracker tool. The information depends on the tracker type. For example, during the configuration step of the MicronTracker, location of the directory containing marker template files is specified. If the user tries to attach a tracker tool with a marker type whose template file is not stored in this directory, this method will return failure. Similarly, for PolarisTracker, the method returns failure, if the tool part number specified by the user during the tracker tool configuration step does not match with the part number read from the SROM file.

Implemented in igstk::Ascension3DGTracker, igstk::InfiniTrackTracker, igstk::MicronTracker, igstk::AscensionTracker, igstk::NDITracker, igstk::MouseTracker, igstk::QMouseTracker, igstk::AuroraTracker, igstk::SimulatedTracker, and igstk::PolarisTracker.

virtual ResultType igstk::Tracker::ValidateSpecifiedFrequency ( double  frequencyInHz)
protectedvirtual

The "ValidateSpecifiedFrequency" method checks if the specified frequency is valid for the tracking device that is being used.

This method is to be overridden in the derived tracking-device specific classes to take into account the maximum frequency possible in the tracking device

Reimplemented in igstk::Ascension3DGTracker, igstk::InfiniTrackTracker, igstk::MicronTracker, igstk::NDITracker, igstk::AuroraTracker, and igstk::PolarisTracker.

virtual ResultType igstk::Tracker::RemoveTrackerToolFromInternalDataContainers ( const TrackerToolType trackerTool)
protectedpure virtual
virtual ResultType igstk::Tracker::AddTrackerToolToInternalDataContainers ( const TrackerToolType trackerTool)
protectedpure virtual
const TrackerToolsContainerType& igstk::Tracker::GetTrackerToolContainer ( ) const
protected

Access method for the tracker tool container.

This method is useful in the derived classes to access the unique identifiers of the tracker tools

void igstk::Tracker::ReportTrackingToolNotAvailable ( TrackerToolType trackerTool) const
protected

Report to tracker tool that it is not available for tracking.

void igstk::Tracker::ReportTrackingToolVisible ( TrackerToolType trackerTool) const
protected

Report to tracker tool that it is visible.

void igstk::Tracker::SetTrackerToolRawTransform ( TrackerToolType trackerTool,
const TransformType  transform 
)
protected

Set tracker tool raw transform.

void igstk::Tracker::SetTrackerToolTransformUpdate ( TrackerToolType trackerTool,
bool  flag 
) const
protected

Turn on/off update flag of the tracker tool.

void igstk::Tracker::ExitTrackingStateProcessing ( void  )
protected

Depending on the tracker type, the tracking thread should be terminated or left untouched when we stop tracking.

For example, in the case of MicronTracker, it is better to not terminate the tracking thread. Otherwise, everytime we restart tracking, then the camera has to be reattached. For NDI trackers, the tracking thread has to be terminated first to send TSTOP command Always called when exiting tracking state. This methold will be overriden in derived classes.

void igstk::Tracker::ExitTrackingWithoutTerminatingTrackingThread ( )
protected

Exit tracking without terminating tracking thread.

void igstk::Tracker::ExitTrackingTerminatingTrackingThread ( )
protected

Exit tracking after terminating tracking thread.

Member Data Documentation

igstkStandardAbstractClassTraitsMacro ( Tracker, Object ) public typedef TrackerTool igstk::Tracker::TrackerToolType

Macro with standard traits declarations.

typedefs from TrackerTool class

Definition at line 101 of file igstkTracker.h.


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