BiiGOptitrackControl
..
|
#include <OptitrackTracker.h>
Public Member Functions | |
BiiGOptitrackControlClassMacro (Optitrack::OptitrackTracker, itk::Object) | |
itkNewMacro (Self) | |
ResultType | Open (void) |
Open the Connection with the Tracker. Calls LoadCalibration function and set the system up with the calibration file. Remember that you have to set a calibration file first to open a correct connection to the Optical Tracking System. More... | |
ResultType | Close (void) |
Close the Connection with the Tracker. Calls StopTracking function, delete the tool containes and shut down the system. More... | |
ResultType | Reset (void) |
Set the system into Calibration State. Calls StopTracking function, does not delete the tool container. More... | |
ResultType | StartTracking (void) |
Start to Track the tools already defined. If no tools are defined for this tracker, it returns an error. Tools can be added using AddTrackerTool. More... | |
ResultType | StopTracking (void) |
Stop the Tracking Thread and tools will not longer be updated. More... | |
void | TrackTools () |
Update each tool location in the container m_LoadedTools. More... | |
void | PrintSelf (std::ostream &os) const |
Print the object information in a stream. More... | |
ResultType | RemoveTrackerTool (OptitrackTool::Pointer trackerTool) |
Remove tracker tool entry from internal containers. More... | |
ResultType | AddTrackerTool (OptitrackTool::Pointer trackerTool) |
Add tracker tool entry to internal containers. More... | |
ResultType | LoadCalibration (void) |
Load the Calibration file to the Optitrack System and set the cameras in calibrated locations. More... | |
unsigned int | GetNumberOfAttachedTools (void) |
Returns the number of defined tools. More... | |
ResultType | CheckNumberOfMarkers (void) |
Study if the number of markers is higher than 1 in the field of view. More... | |
ResultType | TestCalibration (std::string FileName) |
Study if the calibration is correct by camera pairs study. More... | |
OptitrackTool::Pointer | GetOptitrackTool (unsigned int toolID) |
Return the tool pointer of the tool number toolNumber. More... | |
OptitrackTool::Pointer | GetOptitrackToolByName (std::string toolName) |
Return the tool pointer of the tool named toolNumber. More... | |
ResultType | SetCameraParams (int exposure, int threshold, int intensity, int videoType=4) |
Set the Cameras Exposure, Threshold and Intensity of IR LEDs. By Default it set the Video type to 4: Precision Mode for tracking == VideoType: == 0 = Segment Mode == 1 = Grayscale Mode == 2 = Object Mode == 4 = Precision Mode == 6 = MJPEG Mode (V100R2 only) More... | |
itkSetMacro (Exp, unsigned int) | |
Sets the directory where the calibration file of the MicronTracker can be found. More... | |
itkGetMacro (Exp, unsigned int) | |
Gets the current calibration directory. More... | |
itkSetMacro (Led, unsigned int) | |
Sets the directory where the calibration file of the MicronTracker can be found. More... | |
itkGetMacro (Led, unsigned int) | |
Gets the current calibration directory. More... | |
itkSetMacro (Thr, unsigned int) | |
Sets the directory where the calibration file of the MicronTracker can be found. More... | |
itkGetMacro (Thr, unsigned int) | |
Gets the current calibration directory. More... | |
itkSetMacro (VideoType, unsigned int) | |
Sets the Video Type of Cameras. More... | |
itkGetMacro (VideoType, unsigned int) | |
Gets the Video Type of Cameras. More... | |
itkGetMacro (CalibrationFile, std::string) | |
Gets the current calibration file. More... | |
itkSetMacro (CalibrationFile, std::string) | |
Sets current calibration file. More... | |
unsigned int | GetCameraNumber (void) |
Gets Current number of Connected Cameras. More... | |
OPTITRACK_TRACKER_EVENT | GetEvent (void) |
Gets the tool Event. More... | |
OPTITRACK_TRACKER_STATE | GetState (void) |
Gets the tool State. More... | |
ResultType | LoadXMLConfigurationFile (std::string configurationFilePath) |
Loading XML configuration file. More... | |
Static Public Member Functions | |
static ITK_THREAD_RETURN_TYPE | ThreadStartTracking (void *pInfoStruct) |
Start the Tracking Thread for the tools. More... | |
Protected Member Functions | |
OptitrackTracker () | |
~OptitrackTracker () | |
OptitrackTracker (const OptitrackTracker &) | |
const OptitrackTracker & | operator= (const OptitrackTracker &) |
void | SetEvent (OPTITRACK_TRACKER_EVENT event_) |
Sets the tool Event. More... | |
void | SetState (OPTITRACK_TRACKER_STATE state_) |
Sets the tool State. More... | |
vnl_vector_fixed< double, 3 > | Pivoting (unsigned int optitrackID, unsigned int sampleNumber) |
Tool pivot calibration. More... | |
Friends | |
class | OptitrackTool |
Events that the class can launch NOT USED.
Definition of the states for the machine behaviour.
|
protected |
|
protected |
|
protected |
ResultType Optitrack::OptitrackTracker::AddTrackerTool | ( | OptitrackTool::Pointer | trackerTool | ) |
Add tracker tool entry to internal containers.
Addition of tool to the system.
This function allows to add a tool to the system. The tool is attached and enabled.
OptiTrackTool | object corresponding to the tool which wants to be added. |
Optitrack::OptitrackTracker::BiiGOptitrackControlClassMacro | ( | Optitrack::OptitrackTracker | , |
itk::Object | |||
) |
ResultType Optitrack::OptitrackTracker::CheckNumberOfMarkers | ( | void | ) |
Study if the number of markers is higher than 1 in the field of view.
Checking single optical marker in FOV.
This function checks if every camera in the system is visualizing a single marker. If every camera is visualizing one marker it returns SUCCESS. Otherwise, it returns FAILURE, and cameras visualizing more than one marker are identified.
ResultType Optitrack::OptitrackTracker::Close | ( | void | ) |
Close the Connection with the Tracker. Calls StopTracking function, delete the tool containes and shut down the system.
Shutdown of the system.
This function closes the system. First, it stops the tracking. Then, the system is shutdown. Finally, the function shuts down the camera device driver and ensures all the driver threads are terminated properly.
unsigned int Optitrack::OptitrackTracker::GetCameraNumber | ( | void | ) |
Gets Current number of Connected Cameras.
Getting the number of connected cameras.
This function provides the number of connected cameras.
OPTITRACK_TRACKER_EVENT Optitrack::OptitrackTracker::GetEvent | ( | void | ) |
Gets the tool Event.
unsigned int Optitrack::OptitrackTracker::GetNumberOfAttachedTools | ( | void | ) |
Returns the number of defined tools.
Obtaining the number of tools attached to the system.
This function provides the number of tools which are attached to the system.
OptitrackTool::Pointer Optitrack::OptitrackTracker::GetOptitrackTool | ( | unsigned int | toolID | ) |
Return the tool pointer of the tool number toolNumber.
Getting an OptiTrack tool by ID.
toolNumber | The number of the tool which should be given back. |
This function provides an OptiTrack tool pointer given an specific tool ID.
toolID | identification number of the tool [unsigned int]. |
OptitrackTool::Pointer Optitrack::OptitrackTracker::GetOptitrackToolByName | ( | std::string | toolName | ) |
Return the tool pointer of the tool named toolNumber.
Getting an OptiTrack tool by name.
toolNumber | The number of the tool which should be given back. |
This function provides an OptiTrack tool pointer given an specific tool name.
toolID | name of the tool [string]. |
OptitrackTracker::OPTITRACK_TRACKER_STATE Optitrack::OptitrackTracker::GetState | ( | void | ) |
Gets the tool State.
Get tracker state.
This function gets the tracker state.
Optitrack::OptitrackTracker::itkGetMacro | ( | Exp | , |
unsigned | int | ||
) |
Gets the current calibration directory.
Optitrack::OptitrackTracker::itkGetMacro | ( | Led | , |
unsigned | int | ||
) |
Gets the current calibration directory.
Optitrack::OptitrackTracker::itkGetMacro | ( | Thr | , |
unsigned | int | ||
) |
Gets the current calibration directory.
Optitrack::OptitrackTracker::itkGetMacro | ( | VideoType | , |
unsigned | int | ||
) |
Gets the Video Type of Cameras.
Optitrack::OptitrackTracker::itkGetMacro | ( | CalibrationFile | , |
std::string | |||
) |
Gets the current calibration file.
Optitrack::OptitrackTracker::itkNewMacro | ( | Self | ) |
Optitrack::OptitrackTracker::itkSetMacro | ( | Exp | , |
unsigned | int | ||
) |
Sets the directory where the calibration file of the MicronTracker can be found.
Optitrack::OptitrackTracker::itkSetMacro | ( | Led | , |
unsigned | int | ||
) |
Sets the directory where the calibration file of the MicronTracker can be found.
Optitrack::OptitrackTracker::itkSetMacro | ( | Thr | , |
unsigned | int | ||
) |
Sets the directory where the calibration file of the MicronTracker can be found.
Optitrack::OptitrackTracker::itkSetMacro | ( | VideoType | , |
unsigned | int | ||
) |
Sets the Video Type of Cameras.
Optitrack::OptitrackTracker::itkSetMacro | ( | CalibrationFile | , |
std::string | |||
) |
Sets current calibration file.
ResultType Optitrack::OptitrackTracker::LoadCalibration | ( | void | ) |
Load the Calibration file to the Optitrack System and set the cameras in calibrated locations.
Load the calibration file.
This function allows the system to load the calibration file of the OptiTrack system. For a correct loading of the file the system must have been initialized and the file must be optimum (.cal extension).
ResultType Optitrack::OptitrackTracker::LoadXMLConfigurationFile | ( | std::string | nameFile | ) |
Loading XML configuration file.
This function loads the configuration file of the system containing: the calibration file path, the camera settings (exposure, threshold, and intensity), and the list of used tools.
nameFile | path of the ".xml" configuration file. |
ResultType Optitrack::OptitrackTracker::Open | ( | void | ) |
Open the Connection with the Tracker. Calls LoadCalibration function and set the system up with the calibration file. Remember that you have to set a calibration file first to open a correct connection to the Optical Tracking System.
Initialization of the system.
This function allows the system to be initialized.
|
protected |
|
protected |
Tool pivot calibration.
This function acquires a number of samples of the pivoting procedure and computes the resultant pivot offset.
optitrackID | OptiTrack identification number of the tool used for pivoting. |
sampleNumber | number of samples acquired during the pivoting. |
void Optitrack::OptitrackTracker::PrintSelf | ( | std::ostream & | os | ) | const |
Print the object information in a stream.
ResultType Optitrack::OptitrackTracker::RemoveTrackerTool | ( | OptitrackTool::Pointer | trackerTool | ) |
Remove tracker tool entry from internal containers.
Removal of tool from the system.
This function allows to remove a tool from the system. The tool is disabled and dettached.
OptiTrackTool | object corresponding to the tool which wants to be removed. |
ResultType Optitrack::OptitrackTracker::Reset | ( | void | ) |
Set the system into Calibration State. Calls StopTracking function, does not delete the tool container.
Reset of the system.
This function resets the system. The tracking is stopped and all currently loaded rigid body definitions are removed. This reset enables the system to load a new calibration file.
ResultType Optitrack::OptitrackTracker::SetCameraParams | ( | int | exposure, |
int | threshold, | ||
int | intensity, | ||
int | videoType = 4 |
||
) |
Set the Cameras Exposure, Threshold and Intensity of IR LEDs. By Default it set the Video type to 4: Precision Mode for tracking == VideoType: == 0 = Segment Mode == 1 = Grayscale Mode == 2 = Object Mode == 4 = Precision Mode == 6 = MJPEG Mode (V100R2 only)
Setting of camera parameters.
This function allows to set some of the camera settings to the whole set of cameras, such as exposure, threshold, illumination, and video mode.
exposure | Valid values are 1-480. |
threshold | Pixels with intensities darker than this value will be filtered out when using processed video modes. Valid values are 0-255. |
intensity | This should be set to 15 for almost all situations. The recommended method for reducing IR LED brightness is to lower the camera exposure setting, this has the effect of shortening the IR strobe duration. Valid values are 0-15. |
videoType | The desired in-camera video processing mode. Valid values are: Segment Mode (0), Grayscale Mode (1), Object Mode (2), Precision Mode (4), and MJPEG Mode (V100R2 only) (6). |
|
protected |
Sets the tool Event.
|
protected |
Sets the tool State.
Set tracker state.
This function sets the tracker state.
ResultType Optitrack::OptitrackTracker::StartTracking | ( | void | ) |
Start to Track the tools already defined. If no tools are defined for this tracker, it returns an error. Tools can be added using AddTrackerTool.
Starting the tracking of tools.
This function starts the tracking of all tools attached by launching a thread.
ResultType Optitrack::OptitrackTracker::StopTracking | ( | void | ) |
Stop the Tracking Thread and tools will not longer be updated.
Stopping the tracking of tools.
This function stops the tracking of tools.
ResultType Optitrack::OptitrackTracker::TestCalibration | ( | std::string | FileName | ) |
Study if the calibration is correct by camera pairs study.
Creating a data file to check calibration state of the system.
This function acquires 1000 samples of the 3D position of the markers using all cameras in the system. Also, it acquires 1000 samples of the 3D position and the 2D position of the markers using all possible combinations of camera pairs . All data (cameras involved, 2D positions, and 3D positions) is saved into a ".csv" file. Calibration state can be inferred placing a single and static reflective marker in the FOV of the cameras, and comparing the 3D position of the marker acquired using the complete system and all differente camera pairs.
FileName | name of the ".csv" file to save tracking information. |
< the output stream
|
static |
Start the Tracking Thread for the tools.
Tracking thread.
This function handles the ITK thread for the tracking.
void Optitrack::OptitrackTracker::TrackTools | ( | ) |
Update each tool location in the container m_LoadedTools.
Tracking of attached tools.
This function tracks all tools attached to the system.
|
friend |