The PST SDK offers the best low-level integration of the PST optical tracking system. Without the need of any extra software you get full control of the PST unit into your own application. Get tracking results, change the frame rate, even receive raw camera images! All through a simple API, allowing you to get started in no-time using your favorite language.
The PST SDK enables the integration of full PST support into your application, offering high flexibility with minimum effort. You decide which features of the PST will be accessible in your application.
Because the PST SDK directly interfaces with the PST hardware, it offers the most direct and fastest interface to the PST.
In only 30 lines of code you can create an application controlling the PST and receiving data!
This example is a fully functional PST SDK application that initializes the PST and defines a callback Listener to receive tracking data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include "pstsdk_cpp.h" #include "TrackerExceptions.h" #include <thread> #include <iostream> class MyListener : public PSTech::pstsdk::Listener { virtual void OnTrackerData(PSTech::pstsdk::TrackerData& td) { for(const auto& target : td.targetlist) { std::cout << target.name.c_str() << std::endl; } } } listener; int main(int argc, char *argv[]) { try { PSTech::pstsdk::Tracker pst; pst.AddTrackerListener(&listener); pst.Start(); std::this_thread::sleep_for(std::chrono::seconds(10)); } catch (PSTech::TrackerException &e) {} PSTech::pstsdk::Tracker::Shutdown(); return 0; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | class MyListener : public PSTech::pstsdk::Listener { virtual void OnTrackerData(PSTech::pstsdk::TrackerData& td) { for (int d = 0; d < td.targetlist.size(); ++d) { auto& mat = td.targetlist[d].pose; std::cout << "Pose for " << td.targetlist[d].name.c_str() << "\n"; for (int y = 0; y < 4; ++y) { for (int x = 0; x < 4; ++x) { std::cout << mat[x + y * 4] << "\t"; } std::cout << "\n"; } } } } listener; |
Handling tracking data is simple as well. This example shows how to implement the Listener callback such that it prints out the transformation matrix for each detected tracking target, every recorded frame.
This is all it takes to start integrating the PST into your application. To learn more about the different APIs offered by the PST SDK, please follow the links below to see the full API documentation for your favorite language.
If you are looking for information on the legacy Classic SDK, it can be found here.