text: #pragma once
  
  #include <chrono>
  #include <cmath>
  
  #include <linalg.h>
  
  #include <Driver/IVRDevice.hpp>
  #include <Native/DriverFactory.hpp>
  
  #include <windows.h>
  #include <thread>
  #include <sstream>
  #include <iostream>
  #include <string>
  
  namespace ExampleDriver {
      class TrackerDevice : public IVRDevice {
          public:
  
              TrackerDevice(std::string serial);
              ~TrackerDevice() = default;
  
              // Inherited via IVRDevice
              virtual std::string GetSerial() override;
              virtual void Update() override;
              virtual void UpdatePos(double a, double b, double c, double time, double smoothing);
              virtual void UpdateRot(double qw, double qx, double qy, double qz, double time, double smoothing);
              virtual vr::TrackedDeviceIndex_t GetDeviceIndex() override;
              virtual DeviceType GetDeviceType() override;
  
              virtual vr::EVRInitError Activate(uint32_t unObjectId) override;
              virtual void Deactivate() override;
              virtual void EnterStandby() override;
              virtual void* GetComponent(const char* pchComponentNameAndVersion) override;
              virtual void DebugRequest(const char* pchRequest, char* pchResponseBuffer, uint32_t unResponseBufferSize) override;
              virtual vr::DriverPose_t GetPose() override;
  
      private:
          vr::TrackedDeviceIndex_t device_index_ = vr::k_unTrackedDeviceIndexInvalid;
          std::string serial_;
          bool isSetup;
  
          std::chrono::milliseconds _pose_timestamp;
  
          double wantedPose[7] = { 0,0,0,1,0,0,0 };
          double wantedTimeOffset = 0;
  
          vr::DriverPose_t last_pose_ = IVRDevice::MakeDefaultPose();
  
          bool did_vibrate_ = false;
          float vibrate_anim_state_ = 0.f;
  
          vr::VRInputComponentHandle_t haptic_component_ = 0;
  
          vr::VRInputComponentHandle_t system_click_component_ = 0;
          vr::VRInputComponentHandle_t system_touch_component_ = 0;
  
      };
  };