Loading...
Searching...
No Matches
pstsdk_cpp.h
Go to the documentation of this file.
1// Copyright PS-Tech B.V. All Rights Reserved.
2
3#pragma once
4
5#include "PstBase.h"
6#include "PstString.h"
7#include "PstVector.h"
8#include "PstArray.h"
9#include "PstTypes.h"
10
11 namespace PSTech
12{
13 namespace pstsdk
14{
24
37 class PST_EXPORT Listener
38 {
39 public:
49 virtual void OnTrackerData(const TrackerData& data) { }
50
61 virtual void OnTrackerMode(const TrackerMode mode) { }
62
73 virtual ~Listener();
74 };
75
83 PST_EXPORT void EnableLogging();
84
92 PST_EXPORT const char* GetSdkVersion();
93
100 class PST_EXPORT Tracker
101 {
102 public:
123 explicit Tracker(const Utils::PstString& path = "", const Utils::PstString& config_file = "server.cfg",
124 const Utils::PstString& db_file = "models.db", const Utils::PstString& grabber_name = "default");
125 ~Tracker();
126
141 void LoadCalibrationFromLocalPath(const Utils::PstString& path);
142
155 TrackerData GetSingleMeasurement() const;
156
169 [[deprecated("Use GetConnectedCameraInfo() instead")]]
170 Utils::PstVector<Utils::PstString> GetConnectedCameraUrls(bool silent = false) const;
171
182 Utils::PstVector<Utils::PstString> GetUncalibratedCameraUrls(bool silent = false) const;
183
193 Utils::PstString GetVersionInfo() const;
194
203 Utils::PstString GetConfigPath() const;
204
205
218 static void AddTrackerListener(Listener* listener);
219
230 static void RemoveTrackerListener(Listener* listener);
231
239 void Start();
240
249 void Pause();
250
262 static void Shutdown();
263
275 StatusMessage Systemcheck() const;
276
277
290 void SetFramerate(double fps);
291
302 double GetFramerate() const;
303
317 Utils::PstVector<float> GetSupportedFramerates() const;
318
333 void SetExposure(double time);
334
344 double GetExposure() const;
345
362 void GetExposureRange(double& min, double& max) const;
363
380 void EnableFiltering();
381
390 void DisableFiltering();
391
403 void SetPositionFilter(double value);
404
416 void SetOrientationFilter(double value);
417
432 void EnableTremorFilter();
433
442 void DisableTremorFilter();
443
444
457 void EnableImageTransfer();
458
467 void DisableImageTransfer();
468
482 bool GetImage(Image& image) const;
483
484
497 TargetStatuses GetTargetList() const;
498
511 Target GetTargetInfo(const Utils::PstString& name) const;
512
527 void SetTargetStatus(const Utils::PstString& name, bool active);
528
543 bool GetTargetStatus(const Utils::PstString& name) const;
544
559 MarkerList GetTargetMarkers(const Utils::PstString& name) const;
560
573 void SetTargetId(const Utils::PstString& name, int id);
574
593 void SetReference(const Utils::PstArray<float, 16>& reference, bool relative = false);
594
605 void SetDefaultReference();
606
620 Utils::PstArray<float, 16> GetReference() const;
621
639 CameraInfoList GetConnectedCameraInfo(bool silent = true) const;
640
666 static void EnableSharedMemory();
667
675 static void DisableSharedMemory();
676
697 static void EnableRestServer(const Utils::PstString& server_address, const Utils::PstString& server_port, int eventStream_retry_timeout_ms = 3000);
698
707 static void DisableRestServer();
708
724 void ImportJSONModel(const Utils::PstString& json_model);
725
740 Utils::PstString ExportJSONModel(const Utils::PstString& model_name) const;
741
754 void RemoveTargetModel(const Utils::PstString& model_name);
755
772 void SetMarkerDetectionRegion(TrackingRegion detection_region);
773
787 TrackingRegion GetMarkerDetectionRegion() const;
788
801 bool SupportsDetectionRegionPruning() const;
802 };
803
804}
805}
PstArray.h
PstBase.h
PST_EXPORT
#define PST_EXPORT
Definition PstBase.h:12
PstString.h
PstTypes.h
PstVector.h
PSTech::Utils::PstArray
Definition PstArray.h:21
PSTech::Utils::PstString
Definition PstString.h:18
PSTech::Utils::PstVector
Basic vector class, cloning std::vector<T>.
Definition PstVector.h:30
PSTech::pstsdk::Listener
Abstract listener class for receiving tracking information and tracking mode updates.
Definition pstsdk_cpp.h:38
PSTech::pstsdk::Listener::OnTrackerData
virtual void OnTrackerData(const TrackerData &data)
Callback function receiving tracking information from the tracker.
Definition pstsdk_cpp.h:49
PSTech::pstsdk::Listener::~Listener
virtual ~Listener()
Destructor for the listener implementation.
PSTech::pstsdk::Listener::OnTrackerMode
virtual void OnTrackerMode(const TrackerMode mode)
Callback function receiving tracking mode updates from the the tracker.
Definition pstsdk_cpp.h:61
PSTech::pstsdk::Tracker::Start
void Start()
Start tracking.
PSTech::pstsdk::Tracker::EnableTremorFilter
void EnableTremorFilter()
Enable the tremor filter.
PSTech::pstsdk::Tracker::GetConnectedCameraInfo
CameraInfoList GetConnectedCameraInfo(bool silent=true) const
Retrieve camera information for connected PST Trackers.
PSTech::pstsdk::Tracker::GetVersionInfo
Utils::PstString GetVersionInfo() const
Get version information of the SDK.
PSTech::pstsdk::Tracker::GetTargetStatus
bool GetTargetStatus(const Utils::PstString &name) const
Get status of a single tracking Target.
PSTech::pstsdk::Tracker::DisableFiltering
void DisableFiltering()
Disable filtering of the tracking results.
PSTech::pstsdk::Tracker::GetImage
bool GetImage(Image &image) const
Retrieve images from the connected PST Tracker.
PSTech::pstsdk::Tracker::GetExposure
double GetExposure() const
Get the current exposure time.
PSTech::pstsdk::Tracker::GetMarkerDetectionRegion
TrackingRegion GetMarkerDetectionRegion() const
Gets the region of the tracking working space where markers are reported.
PSTech::pstsdk::Tracker::EnableFiltering
void EnableFiltering()
Enable filtering of the tracking results.
PSTech::pstsdk::Tracker::Systemcheck
StatusMessage Systemcheck() const
Check if the tracker is running correctly.
PSTech::pstsdk::Tracker::SetPositionFilter
void SetPositionFilter(double value)
Set the strength of the position filter.
PSTech::pstsdk::Tracker::LoadCalibrationFromLocalPath
void LoadCalibrationFromLocalPath(const Utils::PstString &path)
Load calibration information from a given path.
PSTech::pstsdk::Tracker::GetSingleMeasurement
TrackerData GetSingleMeasurement() const
Retrieve the latest TrackerData available from the connected PST Tracker.
PSTech::pstsdk::Tracker::GetTargetMarkers
MarkerList GetTargetMarkers(const Utils::PstString &name) const
Get 3D marker positions of stored tracking Target.
PSTech::pstsdk::Tracker::Shutdown
static void Shutdown()
Shutdown the tracking system, stopping tracking.
PSTech::pstsdk::Tracker::Pause
void Pause()
Pause tracking.
PSTech::pstsdk::Tracker::GetSupportedFramerates
Utils::PstVector< float > GetSupportedFramerates() const
Get vector of available frame rates.
PSTech::pstsdk::Tracker::GetFramerate
double GetFramerate() const
Get current frame rate.
PSTech::pstsdk::Tracker::GetReference
Utils::PstArray< float, 16 > GetReference() const
Gets the transformation matrix for the current reference system.
PSTech::pstsdk::Tracker::DisableTremorFilter
void DisableTremorFilter()
Disable the tremor filter.
PSTech::pstsdk::Tracker::ImportJSONModel
void ImportJSONModel(const Utils::PstString &json_model)
Import a tracking target model into the target model database.
PSTech::pstsdk::Tracker::SetDefaultReference
void SetDefaultReference()
Reset the reference system to the default reference system.
PSTech::pstsdk::Tracker::AddTrackerListener
static void AddTrackerListener(Listener *listener)
Add a listener for receiving tracker data and tracking mode updates.
PSTech::pstsdk::Tracker::EnableRestServer
static void EnableRestServer(const Utils::PstString &server_address, const Utils::PstString &server_port, int eventStream_retry_timeout_ms=3000)
Enable a REST Server using the HTTP protocol on a local area network.
PSTech::pstsdk::Tracker::DisableRestServer
static void DisableRestServer()
Disable the REST server communication layer.
PSTech::pstsdk::Tracker::ExportJSONModel
Utils::PstString ExportJSONModel(const Utils::PstString &model_name) const
Export a tracking target model as a JSON-formatted string.
PSTech::pstsdk::Tracker::RemoveTrackerListener
static void RemoveTrackerListener(Listener *listener)
Remove a listener for receiving tracker data and tracking mode updates.
PSTech::pstsdk::Tracker::GetExposureRange
void GetExposureRange(double &min, double &max) const
Get the allowed exposure range.
PSTech::pstsdk::Tracker::GetConfigPath
Utils::PstString GetConfigPath() const
Get the path to the current configuration directory.
PSTech::pstsdk::Tracker::SupportsDetectionRegionPruning
bool SupportsDetectionRegionPruning() const
Check if the connected PST tracker supports pruning markers by tracking region.
PSTech::pstsdk::Tracker::GetConnectedCameraUrls
Utils::PstVector< Utils::PstString > GetConnectedCameraUrls(bool silent=false) const
Get URLs of the calibration information for the connected PST Tracker.
PSTech::pstsdk::Tracker::DisableSharedMemory
static void DisableSharedMemory()
Disable shared memory communication layer.
PSTech::pstsdk::Tracker::SetReference
void SetReference(const Utils::PstArray< float, 16 > &reference, bool relative=false)
Set the reference system in which tracking results are reported.
PSTech::pstsdk::Tracker::SetTargetId
void SetTargetId(const Utils::PstString &name, int id)
Set the id of the tracking target.
PSTech::pstsdk::Tracker::SetFramerate
void SetFramerate(double fps)
Set tracker frame rate.
PSTech::pstsdk::Tracker::SetTargetStatus
void SetTargetStatus(const Utils::PstString &name, bool active)
Set status of a single tracking Target.
PSTech::pstsdk::Tracker::SetOrientationFilter
void SetOrientationFilter(double value)
Set the strength of the orientation filter.
PSTech::pstsdk::Tracker::RemoveTargetModel
void RemoveTargetModel(const Utils::PstString &model_name)
Remove a tracking target model from the target model database.
PSTech::pstsdk::Tracker::GetUncalibratedCameraUrls
Utils::PstVector< Utils::PstString > GetUncalibratedCameraUrls(bool silent=false) const
Check if cameras of the connected PST Tracker are calibrated.
PSTech::pstsdk::Tracker::GetTargetInfo
Target GetTargetInfo(const Utils::PstString &name) const
Get basic tracking target information.
PSTech::pstsdk::Tracker::SetMarkerDetectionRegion
void SetMarkerDetectionRegion(TrackingRegion detection_region)
Sets the region of the tracking working space where markers are reported.
PSTech::pstsdk::Tracker::EnableSharedMemory
static void EnableSharedMemory()
Enable shared memory communication layer.
PSTech::pstsdk::Tracker::GetTargetList
TargetStatuses GetTargetList() const
Get TargetStatuses object containing all tracking targets and their status.
PSTech::pstsdk::Tracker::Tracker
Tracker(const Utils::PstString &path="", const Utils::PstString &config_file="server.cfg", const Utils::PstString &db_file="models.db", const Utils::PstString &grabber_name="default")
Tracker constructor.
PSTech::pstsdk::Tracker::~Tracker
~Tracker()
PSTech::pstsdk::Tracker::EnableImageTransfer
void EnableImageTransfer()
Enable image transfer from the PST Tracker.
PSTech::pstsdk::Tracker::SetExposure
void SetExposure(double time)
Set the exposure time.
PSTech::pstsdk::Tracker::DisableImageTransfer
void DisableImageTransfer()
Disable image transfer from the PST Tracker.
PSTech::pstsdk::TargetStatuses
Utils::PstVector< TargetStatus > TargetStatuses
Vector of TargetStatus objects.
Definition PstTypes.h:81
PSTech::pstsdk::TrackingRegion
TrackingRegion
Region of the tracking working space in which markers are reported.
Definition PstTypes.h:91
PSTech::pstsdk::StatusMessage
StatusMessage
Tracker status messages enum class.
Definition PstTypes.h:241
PSTech::pstsdk::CameraInfoList
Utils::PstVector< CameraInfo > CameraInfoList
Vector of CameraInfo objects.
Definition PstTypes.h:231
PSTech::pstsdk::TrackerMode
TrackerMode
Tracker mode enum class.
Definition PstTypes.h:262
PSTech::pstsdk::MarkerList
Utils::PstVector< Utils::PstArray< float, 3 > > MarkerList
Vector of 3D marker positions of a tracking Target.
Definition PstTypes.h:158
PSTech::pstsdk::GetSdkVersion
const char * GetSdkVersion()
Retrieve the SDK version string.
PSTech::pstsdk::EnableLogging
void EnableLogging()
Write plug-in status information to the standard C output stream stderr.
PSTech::pstsdk
Definition ExportedTypeConversions.h:11
PSTech
Definition ExportedTypeConversions.h:9
PSTech::pstsdk::Image
Images retrieved from the tracker.
Definition PstTypes.h:28
PSTech::pstsdk::Target
Tracking target information.
Definition PstTypes.h:42
PSTech::pstsdk::TrackerData
Tracking information retrieved from tracker.
Definition PstTypes.h:173