cgv
vr::vr_driver Class Referenceabstract

interface class for vr drivers. More...

#include <vr_driver.h>

Inherited by vr_emulator.

Public Member Functions

virtual ~vr_driver ()
 declare destructor virtual to ensure it being called also for derived classes
 
virtual std::string get_driver_name () const =0
 return name of driver
 
virtual bool is_installed () const =0
 return whether driver is installed
 
virtual std::vector< void * > scan_vr_kits ()=0
 scan all connected vr kits and return a vector with their ids
 
virtual vr_kitreplace_by_index (int &index, vr_kit *new_kit_ptr)=0
 scan all connected vr kits and return a vector with their ids
 
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
 
void put_x_direction (float *x_dir) const
 put a 3d x direction into passed array
 
virtual void put_up_direction (float *up_dir) const =0
 put a 3d up direction into passed array
 
virtual float get_floor_level () const =0
 return the floor level relativ to the world origin
 
virtual float get_action_zone_height () const =0
 return height of action zone in meters
 
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
 
void put_calibration_transformation (float transformation_matrix[12]) const
 read access to calibration transformation stored as 3x4-matrix
 
void calibrate_pose (float(&pose)[12]) const
 in case calibration matrix is enabled, transform given pose in place
 
void enable_calibration_transformation ()
 enable use of calibration transformation
 
void disable_calibration_transformation ()
 disable use of calibration transformation
 
bool is_calibration_transformation_enabled () const
 check whether calibration transformation is enabled; false after construction and typically set to true when calibration is read from calibration file
 
virtual const std::map< std::string, vr_trackable_state > & get_tracking_reference_states () const
 provide read only access to tracking reference states More...
 
virtual const vr_tracking_system_infoget_tracking_system_info () const
 provide information on tracking system
 

Protected Member Functions

void set_index (unsigned _idx)
 write access to driver index is restricted to the register_driver() function
 
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, previous copy is deleted and a warning is issued More...
 
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 is replaced, otherwise it is registered
 
vr_trackable_stateref_tracking_reference_state (const std::string &serial_nummer)
 provide reference to tracking reference states More...
 
void clear_tracking_reference_states ()
 remove all tracking reference states More...
 
void mark_tracking_references_as_untracked ()
 mark all tracking reference states as untracked More...
 
void set_calibration_transformation (const float new_transformation_matrix[12])
 write access to calibration transformation is reserved to classes derived from vr_calibration_base
 
 vr_driver ()
 protected constructor
 

Protected Attributes

vr_tracking_system_info tracking_system_info
 store tracking system info to be filled by driver implementations
 

Friends

class vr_kit
 allow vr_kit access to ref_reference_state and tracking_system_info
 
void CGV_API register_driver (vr_driver *vrd)
 register a new driver
 

Detailed Description

interface class for vr drivers.

A vr driver has a name get_driver_name() and can be installed or not installed(). It allows to scan for vr kits scan_vr_kits(), which returns a vector of device handles. When implementing your driver, provide a constructor with a single options argument of type std::string. A vr driver also provides information about the action zone via the function put_x_direction(), put_up_direction(), get_floor_level(), get_action_zone_height() and put_action_zone_bounary().

Member Function Documentation

◆ clear_tracking_reference_states()

void vr::vr_driver::clear_tracking_reference_states ( )
protected

remove all tracking reference states

remove all reference states

◆ get_tracking_reference_states()

const std::map< std::string, vr_trackable_state > & vr::vr_driver::get_tracking_reference_states ( ) const
virtual

provide read only access to tracking reference states

provide read only access to reference states

◆ mark_tracking_references_as_untracked()

void vr::vr_driver::mark_tracking_references_as_untracked ( )
protected

mark all tracking reference states as untracked

mark all reference states as untracked

◆ ref_tracking_reference_state()

vr_trackable_state & vr::vr_driver::ref_tracking_reference_state ( const std::string &  serial_nummer)
protected

provide reference to tracking reference states

provide reference to reference states

◆ register_vr_kit()

void vr::vr_driver::register_vr_kit ( void *  handle,
vr_kit kit 
)
protected

call this method during scanning of vr kits. In case vr kit handle had been registered before, previous copy is deleted and a warning is issued

call this method during scanning of vr kits but only in case vr kit id does not yield vr kit through global get_vr_kit function


The documentation for this class was generated from the following files: