PST SDK 7.0.0.0-ebe6e713
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
11namespace PSTech
12{
13namespace pstsdk
14{
24
38 {
39 public:
49 virtual void OnTrackerData(const TrackerData& data) { }
50
61 virtual void OnTrackerMode(const TrackerMode mode) { }
62
73 virtual ~Listener();
74 };
75
84
93
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");
126
142
156
169 [[deprecated("Use GetConnectedCameraInfo() instead")]]
171
183
194
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
276
277
290 void SetFramerate(double fps);
291
302 double GetFramerate() const;
303
318
333 void SetExposure(double time);
334
344 double GetExposure() const;
345
362 void GetExposureRange(double& min, double& max) const;
363
381
391
403 void SetPositionFilter(double value);
404
416 void SetOrientationFilter(double value);
417
433
443
444
458
468
482 bool GetImage(Image& image) const;
483
484
498
512
527 void SetTargetStatus(const Utils::PstString& name, bool active);
528
543 bool GetTargetStatus(const Utils::PstString& name) const;
544
560
573 void SetTargetId(const Utils::PstString& name, int id);
574
593 void SetReference(const Utils::PstArray<float, 16>& reference, bool relative = false);
594
606
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
741
754 void RemoveTargetModel(const Utils::PstString& model_name);
755
773
788
802 };
803
804}
805}
#define PST_EXPORT
Definition PstBase.h:12
Definition PstArray.h:21
Definition PstString.h:18
Basic vector class, cloning std::vector<T>.
Definition PstVector.h:30
Abstract listener class for receiving tracking information and tracking mode updates.
Definition pstsdk_cpp.h:38
virtual void OnTrackerData(const TrackerData &data)
Callback function receiving tracking information from the tracker.
Definition pstsdk_cpp.h:49
virtual ~Listener()
Destructor for the listener implementation.
virtual void OnTrackerMode(const TrackerMode mode)
Callback function receiving tracking mode updates from the the tracker.
Definition pstsdk_cpp.h:61
void Start()
Start tracking.
void EnableTremorFilter()
Enable the tremor filter.
CameraInfoList GetConnectedCameraInfo(bool silent=true) const
Retrieve camera information for connected PST Trackers.
Utils::PstString GetVersionInfo() const
Get version information of the SDK.
bool GetTargetStatus(const Utils::PstString &name) const
Get status of a single tracking Target.
void DisableFiltering()
Disable filtering of the tracking results.
bool GetImage(Image &image) const
Retrieve images from the connected PST Tracker.
double GetExposure() const
Get the current exposure time.
TrackingRegion GetMarkerDetectionRegion() const
Gets the region of the tracking working space where markers are reported.
void EnableFiltering()
Enable filtering of the tracking results.
StatusMessage Systemcheck() const
Check if the tracker is running correctly.
void SetPositionFilter(double value)
Set the strength of the position filter.
void LoadCalibrationFromLocalPath(const Utils::PstString &path)
Load calibration information from a given path.
TrackerData GetSingleMeasurement() const
Retrieve the latest TrackerData available from the connected PST Tracker.
MarkerList GetTargetMarkers(const Utils::PstString &name) const
Get 3D marker positions of stored tracking Target.
static void Shutdown()
Shutdown the tracking system, stopping tracking.
void Pause()
Pause tracking.
Utils::PstVector< float > GetSupportedFramerates() const
Get vector of available frame rates.
double GetFramerate() const
Get current frame rate.
Utils::PstArray< float, 16 > GetReference() const
Gets the transformation matrix for the current reference system.
void DisableTremorFilter()
Disable the tremor filter.
void ImportJSONModel(const Utils::PstString &json_model)
Import a tracking target model into the target model database.
void SetDefaultReference()
Reset the reference system to the default reference system.
static void AddTrackerListener(Listener *listener)
Add a listener for receiving tracker data and tracking mode updates.
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.
static void DisableRestServer()
Disable the REST server communication layer.
Utils::PstString ExportJSONModel(const Utils::PstString &model_name) const
Export a tracking target model as a JSON-formatted string.
static void RemoveTrackerListener(Listener *listener)
Remove a listener for receiving tracker data and tracking mode updates.
void GetExposureRange(double &min, double &max) const
Get the allowed exposure range.
Utils::PstString GetConfigPath() const
Get the path to the current configuration directory.
bool SupportsDetectionRegionPruning() const
Check if the connected PST tracker supports pruning markers by tracking region.
Utils::PstVector< Utils::PstString > GetConnectedCameraUrls(bool silent=false) const
Get URLs of the calibration information for the connected PST Tracker.
static void DisableSharedMemory()
Disable shared memory communication layer.
void SetReference(const Utils::PstArray< float, 16 > &reference, bool relative=false)
Set the reference system in which tracking results are reported.
void SetTargetId(const Utils::PstString &name, int id)
Set the id of the tracking target.
void SetFramerate(double fps)
Set tracker frame rate.
void SetTargetStatus(const Utils::PstString &name, bool active)
Set status of a single tracking Target.
void SetOrientationFilter(double value)
Set the strength of the orientation filter.
void RemoveTargetModel(const Utils::PstString &model_name)
Remove a tracking target model from the target model database.
Utils::PstVector< Utils::PstString > GetUncalibratedCameraUrls(bool silent=false) const
Check if cameras of the connected PST Tracker are calibrated.
Target GetTargetInfo(const Utils::PstString &name) const
Get basic tracking target information.
void SetMarkerDetectionRegion(TrackingRegion detection_region)
Sets the region of the tracking working space where markers are reported.
static void EnableSharedMemory()
Enable shared memory communication layer.
TargetStatuses GetTargetList() const
Get TargetStatuses object containing all tracking targets and their status.
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.
void EnableImageTransfer()
Enable image transfer from the PST Tracker.
void SetExposure(double time)
Set the exposure time.
void DisableImageTransfer()
Disable image transfer from the PST Tracker.
Utils::PstVector< TargetStatus > TargetStatuses
Vector of TargetStatus objects.
Definition PstTypes.h:81
TrackingRegion
Region of the tracking working space in which markers are reported.
Definition PstTypes.h:91
StatusMessage
Tracker status messages enum class.
Definition PstTypes.h:241
Utils::PstVector< CameraInfo > CameraInfoList
Vector of CameraInfo objects.
Definition PstTypes.h:231
TrackerMode
Tracker mode enum class.
Definition PstTypes.h:262
Utils::PstVector< Utils::PstArray< float, 3 > > MarkerList
Vector of 3D marker positions of a tracking Target.
Definition PstTypes.h:158
const char * GetSdkVersion()
Retrieve the SDK version string.
void EnableLogging()
Write plug-in status information to the standard C output stream stderr.
Definition ExportedTypeConversions.h:11
Definition ExportedTypeConversions.h:9
Images retrieved from the tracker.
Definition PstTypes.h:28
Tracking target information.
Definition PstTypes.h:42
Tracking information retrieved from tracker.
Definition PstTypes.h:173