forked from PlusToolkit/PlusLib
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re PlusToolkit#241: Defining the Atracsys API wrapper classes
- Loading branch information
1 parent
770d576
commit c0b273c
Showing
7 changed files
with
321 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*=Plus=header=begin====================================================== | ||
Program: Plus | ||
Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved. | ||
See License.txt for details. | ||
=========================================================Plus=header=end*/ | ||
|
||
#ifndef __AtracsysConstants_h | ||
#define __AtracsysConstants_h | ||
|
||
namespace Atracsys | ||
{ | ||
const int FTK_MAX_FIDUCIALS = 4; | ||
|
||
enum ATRACSYS_ERROR | ||
{ | ||
ERROR_NONE = 0, | ||
ERROR_UNABLE_TO_GET_FTK_HANDLE = 1 | ||
}; | ||
|
||
enum OPTIONS | ||
{ | ||
OPTION_DATA_SENDING = 20, | ||
OPTION_WIRELESS_PAIRING_ENABLE = 40, | ||
OPTION_IR_STROBE = 50, | ||
OPTION_LOST_FRAME_COUNT = 60, | ||
OPTION_RESET_LOST_FRAME_COUNT = 69, | ||
OPTION_LED_RED_COMPONENT = 90, | ||
OPTION_LED_BLUE_COMPONENT = 91, | ||
OPTION_LED_GREEN_COMPONENT = 92, | ||
OPTION_LED_ENABLE = 93, | ||
OPTION_EPIPOLAR_MIN_DISTANCE = 2001, | ||
OPTION_MATCHING_TOLERANCE = 3002, | ||
OPTION_MAX_REGISTRATION_MEAN_ERROR = 3003, | ||
OPTION_MAX_MISSION_POINTS = 3004, | ||
OPTION_MAX_TRACKING_RANGE = 3005 | ||
}; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*=Plus=header=begin====================================================== | ||
Program: Plus | ||
Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved. | ||
See License.txt for details. | ||
=========================================================Plus=header=end*/ | ||
|
||
#include "AtracsysMarker.h" | ||
|
||
using namespace Atracsys; | ||
|
||
ATRACSYS_ERROR Marker::GetID(int& id) | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Marker::GetGeometryID(int& geometryID) | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Marker::GetGeometryPrecsenceMask(int& geometryMask) | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Marker::GetTransformToTracker(vtkSmartPointer<vtkMatrix4x4> MarkerToTracker) | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Marker::GetFiducialRegistrationErrorMm(float& fre) | ||
{ | ||
return ERROR_NONE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*=Plus=header=begin====================================================== | ||
Program: Plus | ||
Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved. | ||
See License.txt for details. | ||
=========================================================Plus=header=end*/ | ||
|
||
#ifndef __AtracsysMarker_h | ||
#define __AtracsysMarker_h | ||
|
||
#include "AtracsysConstants.h" | ||
#include <vtkSmartPointer.h> | ||
#include "vtkMatrix4x4.h" | ||
|
||
namespace Atracsys | ||
{ | ||
class Marker | ||
{ | ||
public: | ||
ATRACSYS_ERROR GetID(int& id); | ||
ATRACSYS_ERROR GetGeometryID(int& geometryID); | ||
ATRACSYS_ERROR GetGeometryPrecsenceMask(int& geometryMask); | ||
ATRACSYS_ERROR GetTransformToTracker(vtkSmartPointer<vtkMatrix4x4> MarkerToTracker); | ||
ATRACSYS_ERROR GetFiducialRegistrationErrorMm(float& fre); | ||
private: | ||
int id; /*!< Tracking id */ | ||
int geometryId; /*!< Geometric id, i.e. the unique id of the used | ||
* geometry. */ | ||
int geometryPresenceMask; /*!< Presence mask of fiducials expressed as | ||
* their geometrical indexes */ | ||
int fiducialCorresp[FTK_MAX_FIDUCIALS]; /*!< Correspondence between | ||
* geometry index and 3D | ||
* fiducials indexes or | ||
* INVALID_ID */ | ||
float rotation[3][3]; /*!< Rotation matrix: format [row][column] */ | ||
float translationMM[3]; /*!< translation vector (unit mm) */ | ||
float registrationErrorMM; /*!< Registration mean ATRACSYS_ERROR (unit mm) */ | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/*=Plus=header=begin====================================================== | ||
Program: Plus | ||
Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved. | ||
See License.txt for details. | ||
=========================================================Plus=header=end*/ | ||
|
||
#include "AtracsysTracker.h" | ||
#include <iostream> | ||
|
||
using namespace Atracsys; | ||
|
||
Tracker::Tracker() | ||
{ | ||
|
||
} | ||
|
||
Tracker::~Tracker() | ||
{ | ||
|
||
} | ||
|
||
ATRACSYS_ERROR Tracker::Connect() | ||
{ | ||
// initialize SDK | ||
this->FtkLib = ftkInit(); | ||
|
||
if (this->FtkLib == NULL) | ||
{ | ||
return ERROR_UNABLE_TO_GET_FTK_HANDLE; | ||
} | ||
|
||
// testing | ||
std::cout << "connected to tracker" << std::endl; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::EnableDataSending() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::DisableDataSending() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::EnableIRStrobe() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::DisableIRStrobe() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::GetDroppedFrameCount() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::ResetLostFrameCount() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::SetUserLEDState(int red, int green, int blue, int frequency) | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::GetUserLEDState(int& red, int& green, int& blue, int& frequency) | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::EnableUserLED() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::DisableUserLED() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::LoadMarkerGeometry(std::string filePath) | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::EnableWirelessMarkerPairing() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::DisableWirelessMarkerPairing() | ||
{ | ||
return ERROR_NONE; | ||
} | ||
|
||
ATRACSYS_ERROR Tracker::GetMarkersInFrame(std::vector<Marker>& markers) | ||
{ | ||
return ERROR_NONE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/*=Plus=header=begin====================================================== | ||
Program: Plus | ||
Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved. | ||
See License.txt for details. | ||
=========================================================Plus=header=end*/ | ||
|
||
#ifndef __AtracsysTracker_h | ||
#define __AtracsysTracker_h | ||
|
||
#include "AtracsysConstants.h" | ||
#include <string> | ||
#include <vector> | ||
|
||
// Atracsys includes | ||
#include "ftkErrors.h" | ||
#include "ftkEvent.h" | ||
#include "ftkInterface.h" | ||
#include "ftkOptions.h" | ||
#include "ftkPlatform.h" | ||
#include "ftkTypes.h" | ||
|
||
namespace Atracsys | ||
{ | ||
class Marker; | ||
class Internal; | ||
|
||
class Tracker | ||
{ | ||
public: | ||
/* Constructor & destructor */ | ||
Tracker(); | ||
~Tracker(); | ||
|
||
/*! */ | ||
ATRACSYS_ERROR Connect(); | ||
|
||
/*! */ | ||
ATRACSYS_ERROR EnableDataSending(); | ||
/*! */ | ||
ATRACSYS_ERROR DisableDataSending(); | ||
|
||
/*! */ | ||
ATRACSYS_ERROR EnableIRStrobe(); | ||
/*! */ | ||
ATRACSYS_ERROR DisableIRStrobe(); | ||
|
||
/*! */ | ||
ATRACSYS_ERROR GetDroppedFrameCount(); | ||
/*! */ | ||
ATRACSYS_ERROR ResetLostFrameCount(); | ||
|
||
/*! */ | ||
ATRACSYS_ERROR SetUserLEDState(int red, int green, int blue, int frequency); | ||
/*! */ | ||
ATRACSYS_ERROR GetUserLEDState(int& red, int& green, int& blue, int& frequency); | ||
/*! */ | ||
ATRACSYS_ERROR EnableUserLED(); | ||
/*! */ | ||
ATRACSYS_ERROR DisableUserLED(); | ||
|
||
/*! */ | ||
ATRACSYS_ERROR LoadMarkerGeometry(std::string filePath); | ||
/*! */ | ||
ATRACSYS_ERROR EnableWirelessMarkerPairing(); | ||
/*! */ | ||
ATRACSYS_ERROR DisableWirelessMarkerPairing(); | ||
|
||
/*! */ | ||
ATRACSYS_ERROR GetMarkersInFrame(std::vector<Marker>& markers); | ||
private: | ||
ftkLibrary FtkLib = 0; | ||
uint64 TrackerSN = 0; | ||
|
||
}; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.