60 unsigned driver_index;
71 std::map<std::string, vr_trackable_state> tracking_reference_states;
73 mutable std::map<std::string, vr_trackable_state> calibrated_tracking_reference_states;
87 float calibration_matrix[12];
89 bool use_calibration_matrix;
93 friend class vr_calibration_base;
143 template <
typename T>
144 struct driver_registry
146 driver_registry(
const std::string& options)
170#include <cgv/config/lib_end.h>
void set_driver_calibration_matrix(vr_driver *driver, const float calibration_matrix[12]) const
single point of write access to calibration transformation of vr drivers
vr_calibration_base()
nothing to be done in contructor
interface class for vr drivers.
void set_index(unsigned _idx)
write access to driver index is restricted to the register_driver() function
void clear_tracking_reference_states()
remove all tracking reference states
void mark_tracking_references_as_untracked()
mark all tracking reference states as untracked
void set_calibration_transformation(const float new_transformation_matrix[12])
write access to calibration transformation is reserved to classes derived from vr_calibration_base
virtual float get_action_zone_height() const =0
return height of action zone in meters
void calibrate_pose(float(&pose)[12]) const
in case calibration matrix is enabled, transform given pose in place
void put_calibration_transformation(float transformation_matrix[12]) const
read access to calibration transformation stored as 3x4-matrix
vr_tracking_system_info tracking_system_info
store tracking system info to be filled by driver implementations
virtual const std::map< std::string, vr_trackable_state > & get_tracking_reference_states() const
provide read only access to tracking reference states
bool is_calibration_transformation_enabled() const
check whether calibration transformation is enabled; false after construction and typically set to tr...
void replace_vr_kit(void *handle, vr_kit *kit)
call this method during replacement of vr kits. In case vr kit handle had been registered before it i...
friend void CGV_API register_driver(vr_driver *vrd)
register a new driver
void register_vr_kit(void *handle, vr_kit *kit)
call this method during scanning of vr kits. In case vr kit handle had been registered before,...
vr_trackable_state & ref_tracking_reference_state(const std::string &serial_nummer)
provide reference to tracking reference states
virtual const vr_tracking_system_info & get_tracking_system_info() const
provide information on tracking system
virtual float get_floor_level() const =0
return the floor level relativ to the world origin
virtual bool replace_by_pointer(vr_kit *old_kit_ptr, vr_kit *new_kit_ptr)=0
scan all connected vr kits and return a vector with their ids
virtual std::string get_driver_name() const =0
return name of driver
vr_driver()
protected constructor
void enable_calibration_transformation()
enable use of calibration transformation
void put_x_direction(float *x_dir) const
put a 3d x direction into passed array
virtual void put_action_zone_bounary(std::vector< float > &boundary) const =0
return a vector of floor points defining the action zone boundary as a closed polygon
friend class vr_kit
allow vr_kit access to ref_reference_state and tracking_system_info
virtual bool is_installed() const =0
return whether driver is installed
void disable_calibration_transformation()
disable use of calibration transformation
virtual void put_up_direction(float *up_dir) const =0
put a 3d up direction into passed array
virtual std::vector< void * > scan_vr_kits()=0
scan all connected vr kits and return a vector with their ids
virtual vr_kit * replace_by_index(int &index, vr_kit *new_kit_ptr)=0
scan all connected vr kits and return a vector with their ids
a vr kit is composed of headset, two controllers, and two trackers, where all devices can be attached...
the vr namespace for virtual reality support
vr_kit * get_vr_kit(void *handle)
query a pointer to a vr kit by its device handle, function can return null pointer in case that no vr...
bool unregister_vr_kit(void *handle, vr_kit *vr_kit_ptr)
unregister a previously registered vr kit by handle and pointer
std::vector< vr_driver * > & get_vr_drivers()
return a vector with all registered vr drivers
void register_driver(vr_driver *vrd)
register a new driver
std::vector< void * > scan_vr_kits()
iterate all registered vr drivers to scan for vr kits and return vector of vr kit handles
bool replace_by_pointer(vr_kit *old_kit_ptr, vr_kit *new_kit_ptr)
scan vr kits and if one with given pointer exists, replace it by passed kit; return whether replaceme...
vr_kit * replace_by_index(int vr_kit_index, vr_kit *new_kit_ptr)
scan vr kits and if one of given index exists replace it by passed kit and return index to replaced k...
a trackable knows whether it is tracked and its 6d pose stored as 3x4 matrix in column major format
information provided for tracking system