BiiGOptitrackControl  ..
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
Optitrack::OptitrackTool Class Reference

#include <OptitrackTool.h>

Inheritance diagram for Optitrack::OptitrackTool:

Public Types

enum  OPTITRACK_TOOL_STATE {
  STATE_TOOL_NoState = -1, STATE_TOOL_Idle = 0, STATE_TOOL_Configurated = 1, STATE_TOOL_Attached = 2,
  STATE_TOOL_AttemptingToReadTxtFile = 10, STATE_TOOL_AttemptingToGetIDnext = 11, STATE_TOOL_AttemptingToDettachTrackable = 12, STATE_TOOL_AttemptingToEnableTrackable = 13,
  STATE_TOOL_AttemptingToDisableTrackable = 14, STATE_TOOL_AttemptingToAttachTrackable = 15, STATE_TOOL_AttemptingToUpdateTrackable = 16, STATE_TOOL_AttemptingToReadXmlFile = 17
}
 Definition of the states for the machine behaviour. More...
 
enum  OPTITRACK_TOOL_EVENT { EVENT_TOOL_NoEvent = -1 }
 Events that the class can launch NOT USED. More...
 

Public Member Functions

 BiiGOptitrackControlClassMacro (Optitrack::OptitrackTool, itk::Object)
 
 itkNewMacro (Self)
 
ResultType ConfigureToolByTxtFile (std::string nameFile)
 Different options for the result of the functions. More...
 
ResultType ConfigureToolByXmlFile (std::string nameFile)
 Tool configuration by .xml file. More...
 
int GetIDnext (void)
 
ResultType AttachTrackable (void)
 Trackable attachment. More...
 
ResultType DettachTrackable (void)
 Trackable detachment. More...
 
vnl_vector_fixed< double, 3 > GetPosition (void)
 Get tool position. More...
 
vnl_quaternion< double > GetOrientation (void)
 Get tool orientation. More...
 
vnl_matrix< double > GetTransformMatrix (void)
 Get tool transformation matrix. More...
 
bool IsTracked (void)
 Check if a tool is being tracked. More...
 
bool IsDataValid (void) const
 Returns true if the current position data is valid(no error during tracking, tracking error below threshold, ...) More...
 
void SetDataValid (bool validate)
 Set data validity. More...
 
ResultType UpdateTool (void)
 Update tool. More...
 
 itkSetMacro (ToolName, std::string)
 Sets the tool Name. More...
 
 itkGetMacro (ToolName, std::string)
 Gets the tool Name. More...
 
 itkSetMacro (NumberOfMarkers, unsigned int)
 Sets the tool NumberOfMarkers. More...
 
 itkGetMacro (NumberOfMarkers, unsigned int)
 Gets the tool NumberOfMarkers. More...
 
 itkSetMacro (NumberOfSeenMarkers, unsigned int)
 Sets the tool NumberOfSeenMarkers. More...
 
 itkGetMacro (NumberOfSeenMarkers, unsigned int)
 Gets the tool NumberOfSeenMarkers. More...
 
 itkSetMacro (FileConfiguration, std::string)
 Sets the tool FileConfiguration. More...
 
 itkGetMacro (FileConfiguration, std::string)
 Gets the tool FileConfiguration. More...
 
 itkGetMacro (OptitrackID, int)
 Gets the tool m_OptitrackID. More...
 
OPTITRACK_TOOL_STATE GetState (void)
 Gets the tool State. More...
 

Protected Member Functions

 OptitrackTool ()
 
 ~OptitrackTool ()
 
 OptitrackTool (const OptitrackTool &)
 
const OptitrackTooloperator= (const OptitrackTool &)
 
void SetState (OPTITRACK_TOOL_STATE state_)
 Sets the tool State. More...
 
ResultType SetPosition (vnl_vector_fixed< double, 3 > position)
 Set tool position. More...
 
ResultType SetOrientation (vnl_quaternion< double > orientation)
 Set tool orientation. More...
 
ResultType SetTransformMatrix (vnl_matrix< double > transform)
 Set tool transformation matrix. More...
 
bool IsIndeterminateValue (const float pV)
 Check indetermination. More...
 
bool IsInfiniteValue (const float pV)
 Check infinite value. More...
 
void ConvertMatrix (vnl_matrix< double > &R, vnl_vector_fixed< double, 3 > position, vnl_quaternion< double > orientation)
 Creates tool transformation matrix. More...
 

Friends

class OptitrackTracker
 

Member Enumeration Documentation

Events that the class can launch NOT USED.

Enumerator
EVENT_TOOL_NoEvent 

Definition of the states for the machine behaviour.

Enumerator
STATE_TOOL_NoState 
STATE_TOOL_Idle 
STATE_TOOL_Configurated 
STATE_TOOL_Attached 
STATE_TOOL_AttemptingToReadTxtFile 
STATE_TOOL_AttemptingToGetIDnext 
STATE_TOOL_AttemptingToDettachTrackable 
STATE_TOOL_AttemptingToEnableTrackable 
STATE_TOOL_AttemptingToDisableTrackable 
STATE_TOOL_AttemptingToAttachTrackable 
STATE_TOOL_AttemptingToUpdateTrackable 
STATE_TOOL_AttemptingToReadXmlFile 

Constructor & Destructor Documentation

Optitrack::OptitrackTool::OptitrackTool ( )
protected
Optitrack::OptitrackTool::~OptitrackTool ( )
protected
Optitrack::OptitrackTool::OptitrackTool ( const OptitrackTool )
protected

Member Function Documentation

ResultType Optitrack::OptitrackTool::AttachTrackable ( void  )

Trackable attachment.

This function adds an individual rigid body from the list of tracked rigid bodies.

Returns
Result of the attachment [int].
Optitrack::OptitrackTool::BiiGOptitrackControlClassMacro ( Optitrack::OptitrackTool  ,
itk::Object   
)
ResultType Optitrack::OptitrackTool::ConfigureToolByTxtFile ( std::string  nameFile)

Different options for the result of the functions.

Tool configuration by .txt file.

typedef enum { FAILURE = 0, SUCCESS = 1 } ResultType;

This function configures a tool from a given ".txt" file.

Parameters
nameFilethe .txt configuration file path.
Returns
Result of the tool configuration.
ResultType Optitrack::OptitrackTool::ConfigureToolByXmlFile ( std::string  nameFile)

Tool configuration by .xml file.

This function configures a tool from a given ".xml" file.

Parameters
nameFile[: the .xml configuration file path.
Returns
Result of the tool configuration [int].
void Optitrack::OptitrackTool::ConvertMatrix ( vnl_matrix< double > &  R,
vnl_vector_fixed< double, 3 >  position,
vnl_quaternion< double >  orientation 
)
protected

Creates tool transformation matrix.

This function creates the tool transformation matrix from position and orientation data.

Parameters
R[vnl_matrix<double>]: transformation matrix.
position[vnl_vector_fixed<double, 3>]: position of the tool.
orientation[vnl_quaternion<double>]: orientation of the tool.
ResultType Optitrack::OptitrackTool::DettachTrackable ( void  )

Trackable detachment.

This function removes an individual rigid body from the list of tracked rigid bodies.

Returns
Result of the detachment [int].
int Optitrack::OptitrackTool::GetIDnext ( void  )
vnl_quaternion< double > Optitrack::OptitrackTool::GetOrientation ( void  )

Get tool orientation.

This function gets the tool orientation.

Returns
Tool orientation [vnl_quaternion<double>].
vnl_vector_fixed< double, 3 > Optitrack::OptitrackTool::GetPosition ( void  )

Get tool position.

This function gets the tool position.

Returns
Tool position [vnl_vector_fixed<double,3>].
OptitrackTool::OPTITRACK_TOOL_STATE Optitrack::OptitrackTool::GetState ( void  )

Gets the tool State.

Get OptiTrack tool state..

This function gets the state of a tool.

Returns
OptiTrack tool state.
vnl_matrix< double > Optitrack::OptitrackTool::GetTransformMatrix ( void  )

Get tool transformation matrix.

This function gets the tool transformation matrix.

Returns
Tool transformation matrix [vnl_matrix<double>].
bool Optitrack::OptitrackTool::IsDataValid ( void  ) const

Returns true if the current position data is valid(no error during tracking, tracking error below threshold, ...)

Check if tool data is valid.

This function checks if tool data is valid.

Returns
Result of data assessment [bool]: True if data is valid.
bool Optitrack::OptitrackTool::IsIndeterminateValue ( const float  pV)
protected

Check indetermination.

This function checks if a given float number is an indeterminate value.

Returns
Result of indetermination assessment [bool].
bool Optitrack::OptitrackTool::IsInfiniteValue ( const float  pV)
protected

Check infinite value.

This function checks if a given float number is an infinite value.

Returns
Result of infinite value assessment [bool].
bool Optitrack::OptitrackTool::IsTracked ( void  )

Check if a tool is being tracked.

This function returns information about whether the selected rigid body is found in the current frame.

Returns
Result of tracking assessment [bool]: True if the selected rigid body is found in the current frame.
Optitrack::OptitrackTool::itkGetMacro ( ToolName  ,
std::string   
)

Gets the tool Name.

Optitrack::OptitrackTool::itkGetMacro ( NumberOfMarkers  ,
unsigned  int 
)

Gets the tool NumberOfMarkers.

Optitrack::OptitrackTool::itkGetMacro ( NumberOfSeenMarkers  ,
unsigned  int 
)

Gets the tool NumberOfSeenMarkers.

Optitrack::OptitrackTool::itkGetMacro ( FileConfiguration  ,
std::string   
)

Gets the tool FileConfiguration.

Optitrack::OptitrackTool::itkGetMacro ( OptitrackID  ,
int   
)

Gets the tool m_OptitrackID.

Optitrack::OptitrackTool::itkNewMacro ( Self  )
Optitrack::OptitrackTool::itkSetMacro ( ToolName  ,
std::string   
)

Sets the tool Name.

Optitrack::OptitrackTool::itkSetMacro ( NumberOfMarkers  ,
unsigned  int 
)

Sets the tool NumberOfMarkers.

Optitrack::OptitrackTool::itkSetMacro ( NumberOfSeenMarkers  ,
unsigned  int 
)

Sets the tool NumberOfSeenMarkers.

Optitrack::OptitrackTool::itkSetMacro ( FileConfiguration  ,
std::string   
)

Sets the tool FileConfiguration.

const OptitrackTool& Optitrack::OptitrackTool::operator= ( const OptitrackTool )
protected
void Optitrack::OptitrackTool::SetDataValid ( bool  validate)

Set data validity.

This function sets tool data validity.

Parameters
validate[bool]: boolean indicating data validity to be set.
ResultType Optitrack::OptitrackTool::SetOrientation ( vnl_quaternion< double >  orientation)
protected

Set tool orientation.

This function sets a given orientation to the tool.

Returns
Result of the orientation setting [int].
ResultType Optitrack::OptitrackTool::SetPosition ( vnl_vector_fixed< double, 3 >  position)
protected

Set tool position.

This function sets a given position to the tool.

Returns
Result of the position setting [int].
void Optitrack::OptitrackTool::SetState ( OptitrackTool::OPTITRACK_TOOL_STATE  state_)
protected

Sets the tool State.

Set OptiTrack tool state.

This function sets a given state to the tool.

ResultType Optitrack::OptitrackTool::SetTransformMatrix ( vnl_matrix< double >  transform)
protected

Set tool transformation matrix.

This function sets a given transformation matrix to the tool.

Returns
Result of the transformation matrix setting [int].
ResultType Optitrack::OptitrackTool::UpdateTool ( void  )

Update tool.

This function updates the tool: getting the position, orientation, and setting the transformation matrix.

Returns
Result of the data update [int].

Friends And Related Function Documentation

friend class OptitrackTracker
friend

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