18 #include "ftkErrors.h" 20 #include "ftkOptions.h" 21 #include "ftkInterface.h" 22 #include "ftkPlatform.h" 25 #include <igsioCommon.h> 27 #define ATRACSYS_BUFFER_SIZE 1024 28 #define RESET_DROPPED_FRAME_COUNT 1 33 bool noexception =
false;
36 var = std::atoi(str.c_str());
39 catch (std::invalid_argument& e)
41 LOG_WARNING(std::string(
"Cannot convert ") + str + std::string(
" to int32"));
43 catch (std::out_of_range& e)
45 LOG_WARNING(str + std::string(
" is out of range for int32"));
53 bool noexception =
false;
56 var = std::atof(str.c_str());
59 catch (std::invalid_argument& e)
61 LOG_WARNING(std::string(
"Cannot convert ") + str + std::string(
" to float"));
63 catch (std::out_of_range& e)
65 LOG_WARNING(str + std::string(
" is out of range for float"));
71 class AtracsysTracker::AtracsysInternal
91 ResultToStringMap[
ERROR_ENABLE_LASER] =
"Failed to enable laser, this is a spryTrack only option.";
103 virtual ~AtracsysInternal()
107 CalibrationDate =
"";
112 bool isVirtual =
false;
115 bool isPaused =
true;
118 ftkLibrary FtkLib =
nullptr;
121 std::string LibVersion;
124 std::string CalibrationDate;
127 uint64 TrackerSN = 0;
130 ftkFrameQuery* Frame =
nullptr;
133 std::map<AtracsysTracker::ATRACSYS_RESULT, std::string> ResultToStringMap;
136 ATRACSYS_RESULT LoadFtkGeometryFromFile(
const std::string& filename, ftkGeometry& geom);
139 ATRACSYS_RESULT LoadFtkGeometryFromString(
const std::string& geomString, ftkGeometry& geom);
141 std::map<int, std::vector<std::array<float, 3>>> Geometries;
145 std::map<std::string, ftkOptionsInfo> DeviceOptionMap{};
149 static void DeviceOptionEnumerator(uint64_t serialNumber,
void* userData, ftkOptionsInfo* option)
151 AtracsysTracker::AtracsysInternal* ptr =
152 reinterpret_cast<AtracsysTracker::AtracsysInternal*>(userData);
157 ptr->DeviceOptionMap.emplace(option->name, *option);
165 long findEOL(
char& c,
char* addr,
size_t size)
167 for (
long u = 0; u < (long)size; u++)
170 if (c == 0 || c ==
'\n')
179 bool parseLine(std::string&
line)
181 size_t first_bracket =
line.find_first_of(
"["),
182 last_bracket =
line.find_last_of(
"]"),
183 equal =
line.find_first_of(
"=");
185 if (first_bracket != std::string::npos &&
186 last_bracket != std::string::npos)
189 _currentSection =
line.substr(first_bracket + 1,
190 last_bracket - first_bracket - 1);
191 sections[_currentSection] = KeyValues();
193 else if (equal != std::string::npos && _currentSection !=
"")
196 std::string
key =
line.substr(0, equal),
197 val =
line.substr(equal + 1);
198 sections[_currentSection][
key] = val;
207 if (!
line.empty() &&
line.substr(0, 1) !=
";")
214 std::string _currentSection;
217 typedef std::map< std::string, std::string > KeyValues;
218 typedef std::map< std::string, KeyValues > Sections;
223 bool parse(
char* addr,
size_t size)
226 _currentSection =
"";
233 long lineSize = findEOL(c, addr, size);
239 strLine = std::string(addr, lineSize);
243 strLine = std::string(addr);
246 strLine.erase(remove(strLine.begin(), strLine.end(),
'\r'), strLine.end());
247 if (!parseLine(strLine))
257 if (c == 0 || size ==
size_t(lineSize))
261 addr += lineSize + 1;
262 size -= lineSize + 1;
269 bool save(std::string str)
271 FILE* file = fopen(str.c_str(),
"wb");
277 Sections::iterator iterS = sections.begin();
279 while (iterS != sections.end())
281 fprintf(file,
"[%s]\n", iterS->first.c_str());
283 KeyValues& kw = iterS->second;
284 KeyValues::iterator iterK = kw.begin();
286 while (iterK != kw.end())
288 fprintf(file,
"%s=%s\n",
289 iterK->first.c_str(), iterK->second.c_str());
299 bool toBuffer(
char** out,
size_t& outSize)
309 Sections::iterator iterS = sections.begin();
311 while (iterS != sections.end())
313 sprintf(temp,
"[%s]\n", iterS->first.c_str());
316 KeyValues& kw = iterS->second;
317 KeyValues::iterator iterK = kw.begin();
319 while (iterK != kw.end())
321 sprintf(temp,
"%s=%s\n",
322 iterK->first.c_str(), iterK->second.c_str());
329 outSize = buffer.length() + 1;
330 char* str =
new (std::nothrow)
char[outSize];
337 strncpy(str, buffer.c_str(), outSize - 1);
338 str[outSize - 1] = 0;
346 bool checkSection(IniFile&
p,
const std::string& section)
348 if (
p.sections.find(section) ==
p.sections.end())
356 bool checkKey(IniFile&
p,
const std::string& section,
const std::string&
key)
358 if (
p.sections[section].find(
key) ==
p.sections[section].end())
367 bool assignUint32(IniFile&
p,
const std::string& section,
368 const std::string&
key,
371 if (!checkKey(
p, section,
key))
377 std::string val(
p.sections[section][
key]);
379 *variable = uint32(strtol(val.c_str(), &pEnd, 10));
385 bool assignFloatXX(IniFile&
p,
const std::string& section,
386 const std::string&
key,
389 if (!checkKey(
p, section,
key))
397 floatXX(strtod(
p.sections[section][
key].c_str(), &pEnd));
403 bool LoadIniFile(std::ifstream& is, ftkGeometry& geometry)
405 std::string
line, fileContent(
"");
410 fileContent +=
line +
"\n";
413 return ParseIniFile(fileContent, geometry);
418 void stringFindAndReplaceAll(std::string&
data, std::string toSearch, std::string replaceStr)
421 size_t pos =
data.find(toSearch);
424 while (pos != std::string::npos)
427 data.replace(pos, toSearch.size(), replaceStr);
429 pos =
data.find(toSearch, pos + replaceStr.size());
434 bool ParseIniFile(std::string fileContent, ftkGeometry& geometry)
436 stringFindAndReplaceAll(fileContent,
"\\n",
"\n");
440 if (!parser.parse(const_cast<char*>(fileContent.c_str()),
446 if (!checkSection(parser,
"geometry"))
453 if (!assignUint32(parser,
"geometry",
"count", &tmp))
457 geometry.version = 0u;
458 geometry.pointsCount = tmp;
459 if (!assignUint32(parser,
"geometry",
"id", &geometry.geometryId))
464 char sectionName[10u];
466 for (uint32
i(0u);
i < geometry.pointsCount; ++
i)
468 sprintf(sectionName,
"fiducial%u",
i);
470 if (!checkSection(parser, sectionName))
475 if (!assignFloatXX(parser, sectionName,
"x",
476 &geometry.positions[
i].x))
480 if (!assignFloatXX(parser, sectionName,
"y",
481 &geometry.positions[
i].y))
485 if (!assignFloatXX(parser, sectionName,
"z",
486 &geometry.positions[
i].z))
492 std::vector<std::array<float, 3>> pts;
493 for (uint32
i(0u);
i < geometry.pointsCount; ++
i)
495 std::array<float, 3> pt = { geometry.positions[
i].x, geometry.positions[
i].y, geometry.positions[
i].z };
498 this->Geometries[geometry.geometryId] = pts;
516 DeviceData* ptr = reinterpret_cast<DeviceData*>(user);
517 ptr->SerialNumber = sn;
526 input.open(filename.c_str());
528 if (!input.fail() && this->LoadIniFile(input, geom))
530 return ERROR_FAILURE_TO_LOAD_INI;
536 if (ftkGetData(this->FtkLib, this->TrackerSN, this->DeviceOptionMap[
"Data Directory"].
id, &buffer) != ftkError::FTK_OK || buffer.size < 1u)
538 return ERROR_FAILURE_TO_LOAD_INI;
541 std::string fullFile(reinterpret_cast<char*>(buffer.data));
542 fullFile +=
"\\" + filename;
544 input.open(fullFile.c_str());
546 if (!input.fail() && this->LoadIniFile(input, geom))
552 return ERROR_FAILURE_TO_LOAD_INI;
559 if (this->ParseIniFile(geomString, geom))
563 return ERROR_FAILURE_TO_LOAD_INI;
572 std::map<std::string, ftkOptionsInfo>::const_iterator it = this->Internal->DeviceOptionMap.find(optionName);
573 if (it == this->Internal->DeviceOptionMap.cend())
579 info = &(it->second);
588 if (this->Internal->isVirtual)
593 std::string optionStr{ optionName };
595 if (isOnboardProcessing && this->Internal->DeviceOptionMap.find(
"Embedded " + optionName) != this->Internal->DeviceOptionMap.end())
597 optionStr =
"Embedded " + optionStr;
600 const ftkOptionsInfo* info;
604 LOG_WARNING(std::string(
"Info for option \"") + optionStr + std::string(
"\" not found."));
608 if (info->type == ftkOptionType::FTK_INT32)
616 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, val) != ftkError::FTK_OK)
619 if (ftkGetLastErrorString(this->Internal->FtkLib,
sizeof(buffer.data), buffer.data) == ftkError::FTK_OK)
621 LOG_WARNING(std::string(buffer.data));
625 LOG_WARNING(std::string(
"Unknown error setting option ") + optionStr);
629 else if (info->type == ftkOptionType::FTK_FLOAT32)
637 if (ftkSetFloat32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, val) != ftkError::FTK_OK)
640 if (ftkGetLastErrorString(this->Internal->FtkLib,
sizeof(buffer.data), buffer.data) == ftkError::FTK_OK)
642 LOG_WARNING(std::string(buffer.data));
646 LOG_WARNING(std::string(
"Unknown error setting option ") + optionStr);
650 else if (info->type == ftkOptionType::FTK_DATA)
652 LOG_WARNING(std::string(
"Option of type \"data\" not supported yet"));
654 LOG_INFO(std::string(
"Option \"") + optionStr + std::string(
"\" successfully set at value ") + attributeValue);
664 : Internal(new AtracsysInternal()) {}
675 this->Internal->isPaused = tof;
681 return isOnboardProcessing;
687 return this->Internal->isVirtual;
693 if (this->Internal->FtkLib !=
nullptr && this->Internal->TrackerSN != 0)
700 this->Internal->FtkLib = ftkInit();
702 if (this->Internal->FtkLib == NULL)
708 device.SerialNumber = 0uLL;
712 if (err != ftkError::FTK_OK && err != ftkError::FTK_WAR_USB_TOO_SLOW)
714 ftkClose(&this->Internal->FtkLib);
715 this->Internal->FtkLib =
nullptr;
719 if (device.SerialNumber == 0uLL)
721 ftkClose(&this->Internal->FtkLib);
722 this->Internal->FtkLib =
nullptr;
726 this->Internal->TrackerSN = device.SerialNumber;
728 ftkBuffer sdkVersion;
729 ftkVersion(&sdkVersion);
730 this->Internal->LibVersion = sdkVersion.data;
734 case ftkDeviceType::DEV_SPRYTRACK_180:
737 case ftkDeviceType::DEV_SPRYTRACK_300:
740 case ftkDeviceType::DEV_FUSIONTRACK_500:
743 case ftkDeviceType::DEV_FUSIONTRACK_250:
751 this->Internal->Frame = ftkCreateFrame();
753 if (this->Internal->Frame ==
nullptr)
755 ftkDeleteFrame(this->Internal->Frame);
756 this->Internal->Frame =
nullptr;
760 if (ftkSetFrameOptions(
false, this->MaxAdditionalEventsNumber,
761 this->Max2dFiducialsNumber, this->Max2dFiducialsNumber,
762 this->Max3dFiducialsNumber, this->MaxMarkersNumber,
763 this->Internal->Frame) != ftkError::FTK_OK)
765 ftkDeleteFrame(this->Internal->Frame);
766 this->Internal->Frame =
nullptr;
770 if (ftkEnumerateOptions(this->Internal->FtkLib, this->Internal->TrackerSN,
771 &AtracsysTracker::AtracsysInternal::DeviceOptionEnumerator, this->Internal) != ftkError::FTK_OK
772 || this->Internal->DeviceOptionMap.find(
"Data Directory") == this->Internal->DeviceOptionMap.cend())
778 const ftkOptionsInfo* info;
779 if (!this->
GetOptionInfo(
"Calibration processing datetime", info))
781 LOG_ERROR(
"Option unknown: \"Calibration processing datetime\"");
785 ftkGetData(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, &buff);
786 this->Internal->CalibrationDate = std::string(buff.data);
791 if (!this->
GetOptionInfo(
"Enable embedded processing", info))
793 LOG_WARNING(std::string(
"Embedded processing not part of the option list."));
799 ftkGetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, &val, ftkOptionGetter::FTK_VALUE);
800 isOnboardProcessing = (val == 1) ?
true :
false;
801 LOG_INFO(
"Embedded processing is initially " << (isOnboardProcessing ?
"enabled" :
"disabled"));
811 if (this->Internal->isVirtual)
816 if (this->Internal->FtkLib ==
nullptr && this->Internal->TrackerSN == 0)
822 ftkDeleteFrame(this->Internal->Frame);
823 this->Internal->Frame =
nullptr;
825 ftkError err = ftkClose(&this->Internal->FtkLib);
826 if (err != ftkError::FTK_OK)
836 version = this->Internal->LibVersion;
843 date = this->Internal->CalibrationDate;
850 deviceType = this->DeviceType;
856 std::array<float, 10>& leftIntrinsic, std::array<float, 10>& rightIntrinsic,
857 std::array<float, 3>& rightPosition, std::array<float, 3>& rightOrientation)
859 if (!this->Internal->isVirtual || this->SetOption(
"Calibration export",
"1") !=
SUCCESS)
861 LOG_ERROR(
"Could not export calibration.");
866 if (ftkGetLastFrame(this->Internal->FtkLib, this->Internal->TrackerSN, this->Internal->Frame, 20) != ftkError::FTK_OK)
872 ftkFrameInfoData info;
873 info.WantedInformation = ftkInformationType::CalibrationParameters;
874 if (ftkExtractFrameInfo(this->Internal->Frame, &info) != ftkError::FTK_OK)
880 ftkStereoParameters sps = info.Calibration;
881 leftIntrinsic = { sps.LeftCamera.FocalLength[0], sps.LeftCamera.FocalLength[1],
882 sps.LeftCamera.OpticalCentre[0], sps.LeftCamera.OpticalCentre[1],
883 sps.LeftCamera.Distorsions[0], sps.LeftCamera.Distorsions[1], sps.LeftCamera.Distorsions[2],
884 sps.LeftCamera.Distorsions[3], sps.LeftCamera.Distorsions[4], sps.LeftCamera.Skew };
885 rightIntrinsic = { sps.RightCamera.FocalLength[0], sps.RightCamera.FocalLength[1],
886 sps.RightCamera.OpticalCentre[0], sps.RightCamera.OpticalCentre[1],
887 sps.RightCamera.Distorsions[0], sps.RightCamera.Distorsions[1], sps.RightCamera.Distorsions[2],
888 sps.RightCamera.Distorsions[3], sps.RightCamera.Distorsions[4], sps.RightCamera.Skew };
889 rightPosition = { sps.Translation[0], sps.Translation[1], sps.Translation[2] };
890 rightOrientation = { sps.Rotation[0], sps.Rotation[1], sps.Rotation[2] };
900 id = this->Internal->TrackerSN;
908 this->Internal->LoadFtkGeometryFromFile(filePath, geom);
909 if (!this->Internal->isVirtual &&
910 ftkSetGeometry(this->Internal->FtkLib, this->Internal->TrackerSN, &geom) != ftkError::FTK_OK)
914 geometryId = geom.geometryId;
922 this->Internal->LoadFtkGeometryFromString(geomString, geom);
923 if (!this->Internal->isVirtual &&
924 ftkSetGeometry(this->Internal->FtkLib, this->Internal->TrackerSN, &geom) != ftkError::FTK_OK)
928 geometryId = geom.geometryId;
935 if (this->Internal->isVirtual)
941 const ftkOptionsInfo* info;
942 if (!this->
GetOptionInfo(
"Active Wireless Markers info", info))
948 if (ftkGetData(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, &buffer) != ftkError::FTK_OK)
952 markerInfo = std::string(buffer.data, buffer.data + buffer.size);
959 geometries = this->Internal->Geometries;
966 std::map<AtracsysTracker::ATRACSYS_RESULT, std::string>::iterator it;
967 it = this->Internal->ResultToStringMap.find(result);
968 if (it != end(this->Internal->ResultToStringMap))
972 return std::string(
"Unknown error has occured. Result value: " + result);
977 std::map<std::string, std::string>& events, uint64_t& sdkTimestamp)
979 ftkError err = ftkGetLastFrame(this->Internal->FtkLib, this->Internal->TrackerSN, this->Internal->Frame, 20);
980 if (err != ftkError::FTK_OK)
985 switch (this->Internal->Frame->markersStat)
987 case ftkQueryStatus::QS_WAR_SKIPPED:
989 case ftkQueryStatus::QS_ERR_INVALID_RESERVED_SIZE:
991 case ftkQueryStatus::QS_OK:
997 if (this->Internal->Frame->markersStat == ftkQueryStatus::QS_ERR_OVERFLOW)
1005 for (
size_t m = 0; m < this->Internal->Frame->markersCount; m++)
1007 const ftkMarker& marker = this->Internal->Frame->markers[m];
1010 vtkNew<vtkMatrix4x4> toolToTracker;
1011 for (
int row = 0; row < 3; row++)
1013 toolToTracker->SetElement(row, 3, marker.translationMM[row]);
1014 for (
int column = 0; column < 3; column++)
1016 toolToTracker->SetElement(row, column, marker.rotation[row][column]);
1020 Marker atracsysMarker(marker.status, marker.id, marker.geometryId,
1021 toolToTracker.GetPointer(), marker.geometryPresenceMask, marker.registrationErrorMM);
1024 for (
size_t f3 = 0; f3 < FTK_MAX_FIDUCIALS; f3++)
1026 const uint32 f = marker.fiducialCorresp[f3];
1027 if (f == INVALID_ID)
1035 const ftk3DFiducial& ftkFid3d = this->Internal->Frame->threeDFiducials[f];
1037 fid.
xMm = ftkFid3d.positionMM.x;
1038 fid.
yMm = ftkFid3d.positionMM.y;
1039 fid.
zMm = ftkFid3d.positionMM.z;
1044 const ftkRawData& leftRaw = this->Internal->Frame->rawDataLeft[ftkFid3d.leftIndex];
1046 fid.
xLeftPx = leftRaw.centerXPixels;
1047 fid.
yLeftPx = leftRaw.centerYPixels;
1052 const ftkRawData& rightRaw = this->Internal->Frame->rawDataRight[ftkFid3d.rightIndex];
1054 fid.
xRightPx = rightRaw.centerXPixels;
1055 fid.
yRightPx = rightRaw.centerYPixels;
1060 if (!atracsysMarker.AddFiducial(fid))
1066 markers.push_back(atracsysMarker);
1073 for (
size_t e = 0; e < this->Internal->Frame->eventsCount; e++)
1075 const ftkEvent&
event = *this->Internal->Frame->events[e];
1077 if (event.Type == FtkEventType::fetTempV4)
1079 std::stringstream ss;
1080 const EvtTemperatureV4Payload* ptr = reinterpret_cast<EvtTemperatureV4Payload*>(event.Data);
1081 for (
unsigned int i = 0;
i <
event.Payload /
sizeof(EvtTemperatureV4Payload) - 1;
i++, ++ptr)
1083 ss << ptr->SensorId <<
" " << ptr->SensorValue <<
" ";
1085 ss << ptr->SensorId <<
" " << ptr->SensorValue;
1086 events.emplace(
"tempv4", ss.str());
1091 sdkTimestamp = this->Internal->Frame->imageHeader->timestampUS;
1099 if (this->Internal->isVirtual)
1105 const ftkOptionsInfo* info;
1110 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id,
frequency) != ftkError::FTK_OK)
1118 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, red) != ftkError::FTK_OK)
1126 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, green) != ftkError::FTK_OK)
1134 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, blue) != ftkError::FTK_OK)
1145 if (this->Internal->isVirtual)
1151 const ftkOptionsInfo* info;
1156 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id,
enabled) != ftkError::FTK_OK)
1166 if (this->Internal->isVirtual)
1172 const ftkOptionsInfo* info;
1178 int laserEnabledValue =
enabled ? 3 : 0;
1180 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, laserEnabledValue) != ftkError::FTK_OK)
1190 if (this->Internal->isVirtual)
1196 const ftkOptionsInfo* info;
1197 if (!this->
GetOptionInfo(
"Active Wireless Pairing Enable", info))
1202 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id,
enabled) != ftkError::FTK_OK)
1212 if (this->Internal->isVirtual)
1218 const ftkOptionsInfo* info;
1219 if (!this->
GetOptionInfo(
"Active Wireless button statuses streaming", info))
1224 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id,
enabled) != ftkError::FTK_OK)
1234 if (this->Internal->isVirtual)
1240 const ftkOptionsInfo* info;
1241 if (!this->
GetOptionInfo(
"Active Wireless battery state streaming", info))
1246 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id,
enabled) != ftkError::FTK_OK)
1260 this->MaxAdditionalEventsNumber = n;
1271 this->Max2dFiducialsNumber = n;
1282 this->Max3dFiducialsNumber = n;
1293 this->MaxMarkersNumber = n;
1303 if (this->Internal->isVirtual)
1309 const ftkOptionsInfo* info;
1310 if (!this->
GetOptionInfo(
"Enable embedded processing", info))
1315 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id,
enabled) != ftkError::FTK_OK)
1319 LOG_INFO(
"Embedded processing successfully " << (
enabled ?
"enabled" :
"disabled"));
1326 if (this->Internal->isVirtual)
1332 const ftkOptionsInfo* info;
1338 if (ftkSetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id,
enabled) != ftkError::FTK_OK)
1342 LOG_INFO(
"Image streaming successfully " << (
enabled ?
"enabled" :
"disabled"));
1351 LOG_WARNING(
"Embedded processing is available only on spryTracks.");
1354 bool succeeded =
true;
1359 isOnboardProcessing =
true;
1365 isOnboardProcessing =
false;
1381 if (this->Internal->isVirtual)
1383 droppedFrameCount = 0;
1389 int32 lost = 0, corrupted = 0;
1391 const ftkOptionsInfo* info;
1396 ftkGetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, &lost, ftkOptionGetter::FTK_VALUE);
1397 if (!this->
GetOptionInfo(
"Counter of corrupted frames", info))
1401 ftkGetInt32(this->Internal->FtkLib, this->Internal->TrackerSN, info->id, &corrupted, ftkOptionGetter::FTK_VALUE);
1403 droppedFrameCount = lost + corrupted;
1412 if (this->Internal->isVirtual)
1420 const ftkOptionsInfo* info;
1448 float distF1 = sqrt(this->xMm * this->xMm + this->yMm * this->yMm + this->zMm * this->zMm);
1450 return distF1 < distF2;
1459 this->MarkerStatus = 0;
1460 this->TrackingId = -1;
1461 this->GeometryId = -1;
1462 this->GeometryPresenceMask = -1;
1463 this->RegistrationErrorMm = 0.0;
1466 vtkMatrix4x4* toolToTracker,
int geometryPresenceMask,
float registrationErrorMM)
1468 this->MarkerStatus = status;
1469 this->TrackingId = trackingId;
1470 this->GeometryId = geometryId;
1471 this->ToolToTracker->DeepCopy(toolToTracker);
1472 this->GeometryPresenceMask = geometryPresenceMask;
1473 this->RegistrationErrorMm = registrationErrorMM;
1478 this->MarkerStatus = obj.MarkerStatus;
1479 this->TrackingId = obj.TrackingId;
1480 this->GeometryId = obj.GeometryId;
1481 this->ToolToTracker->DeepCopy(obj.ToolToTracker.GetPointer());
1482 this->GeometryPresenceMask = obj.GeometryPresenceMask;
1483 this->RegistrationErrorMm = obj.RegistrationErrorMm;
1484 this->fiducials = obj.fiducials;
1489 if (fiducials.size() < FTK_MAX_FIDUCIALS)
1491 fiducials.push_back(fid);
ATRACSYS_RESULT SetUserLEDState(int red, int green, int blue, int frequency, bool enabled=true)
#define ATRACSYS_BUFFER_SIZE
ATRACSYS_RESULT GetCalibrationDate(std::string &date)
ATRACSYS_RESULT GetDeviceId(uint64_t &id)
#define RESET_DROPPED_FRAME_COUNT
ATRACSYS_RESULT GetLoadedGeometries(std::map< int, std::vector< std::array< float, 3 >>> &geometries)
ATRACSYS_RESULT EnableUserLED(bool enabled)
ATRACSYS_RESULT SetMax3dFiducialsNumber(int n)
ATRACSYS_RESULT GetDeviceType(DEVICE_TYPE &deviceType)
ATRACSYS_RESULT Disconnect()
ATRACSYS_RESULT SetOption(const std::string &, const std::string &)
ATRACSYS_RESULT EnableWirelessMarkerBatteryStreaming(bool enabled)
ATRACSYS_RESULT EnableWirelessMarkerStatusStreaming(bool enabled)
ATRACSYS_RESULT EnableOnboardProcessing(bool enabled)
ATRACSYS_RESULT GetDroppedFrameCount(int &droppedFrameCount)
ATRACSYS_RESULT SetMaxMarkersNumber(int n)
ATRACSYS_RESULT LoadMarkerGeometryFromFile(std::string filePath, int &geometryId)
bool strToInt32(const std::string &str, int &var)
ATRACSYS_RESULT GetMarkersInFrame(std::vector< Marker > &markers, std::map< std::string, std::string > &events, uint64_t &sdkTimestamp)
std::string ResultToString(ATRACSYS_RESULT result)
bool GetOptionInfo(const std::string &, const ftkOptionsInfo *&)
SPRYTRACK_IMAGE_PROCESSING_TYPE
ATRACSYS_RESULT LoadMarkerGeometryFromString(std::string filePath, int &geometryId)
ATRACSYS_RESULT ResetLostFrameCount()
bool operator==(const Fiducial &f)
ATRACSYS_RESULT SetMaxAdditionalEventsNumber(int n)
bool strToFloat32(const std::string &str, float &var)
ATRACSYS_RESULT GetMarkerInfo(std::string &markerInfo)
ATRACSYS_RESULT EnableImageStreaming(bool enabled)
ATRACSYS_RESULT GetSDKversion(std::string &version)
bool IsOnboardProcessing()
ATRACSYS_RESULT GetCamerasCalibration(std::array< float, 10 > &leftIntrinsic, std::array< float, 10 > &rightIntrinsic, std::array< float, 3 > &rightPosition, std::array< float, 3 > &rightOrientation)
bool operator<(const Fiducial &f) const
ATRACSYS_RESULT SetSpryTrackProcessingType(SPRYTRACK_IMAGE_PROCESSING_TYPE processingType)
uint32_t Fid2dRightStatus
void FusionTrackEnumerator(uint64 sn, void *user, ftkDeviceType devType)
ATRACSYS_RESULT SetLaserEnabled(bool enabled)
virtual ~AtracsysTracker()
ATRACSYS_RESULT SetMax2dFiducialsNumber(int n)
ATRACSYS_RESULT EnableWirelessMarkerPairing(bool enabled)
const float EQUALITY_DISTANCE_MM
ATRACSYS_RESULT Connect()
bool AddFiducial(Fiducial fid)