cgv
|
interface class for vr drivers. More...
#include <vr_driver.h>
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_kit * | replace_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 | |
virtual const vr_tracking_system_info & | get_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 | |
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_state & | ref_tracking_reference_state (const std::string &serial_nummer) |
provide reference to tracking reference states | |
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 | |
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 | |
class | vr_calibration_base |
void CGV_API | register_driver (vr_driver *vrd) |
register a new driver | |
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().
Definition at line 56 of file vr_driver.h.
|
protected |
protected constructor
Definition at line 41 of file vr_driver.cxx.
|
virtual |
declare destructor virtual to ensure it being called also for derived classes
Definition at line 117 of file vr_driver.cxx.
void vr::vr_driver::calibrate_pose | ( | float(&) | pose[12] | ) | const |
in case calibration matrix is enabled, transform given pose in place
Definition at line 55 of file vr_driver.cxx.
Referenced by get_tracking_reference_states(), and vr::vr_kit::query_state().
|
protected |
remove all tracking reference states
remove all reference states
Definition at line 28 of file vr_driver.cxx.
Referenced by vr::vr_kit::clear_tracking_reference_states().
void vr::vr_driver::disable_calibration_transformation | ( | ) |
disable use of calibration transformation
Definition at line 89 of file vr_driver.cxx.
void vr::vr_driver::enable_calibration_transformation | ( | ) |
enable use of calibration transformation
Definition at line 84 of file vr_driver.cxx.
Referenced by cgv::gui::vr_calibration::update_driver_calibration().
|
pure virtual |
return height of action zone in meters
Implemented in vr_emulator.
Referenced by vr_view_interactor::draw_action_zone().
|
pure virtual |
return name of driver
Implemented in vr_emulator.
Referenced by cgv::gui::vr_calibration::update_driver_calibration(), and cgv::gui::vr_calibration::update_driver_calibration().
|
pure virtual |
return the floor level relativ to the world origin
Implemented in vr_emulator.
|
virtual |
provide read only access to tracking reference states
provide read only access to reference states
Definition at line 99 of file vr_driver.cxx.
References calibrate_pose(), is_calibration_transformation_enabled(), and vr::VRS_TRACKED.
Referenced by cgv::gui::vr_calibration::update_driver_calibration().
|
virtual |
provide information on tracking system
Definition at line 111 of file vr_driver.cxx.
References tracking_system_info.
Referenced by register_vr_kit().
bool vr::vr_driver::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
Definition at line 94 of file vr_driver.cxx.
Referenced by get_tracking_reference_states(), and vr::vr_kit::query_state().
|
pure virtual |
return whether driver is installed
Implemented in vr_emulator.
|
protected |
mark all tracking reference states as untracked
mark all reference states as untracked
Definition at line 34 of file vr_driver.cxx.
References vr::VRS_DETACHED.
Referenced by vr::vr_kit::mark_tracking_references_as_untracked().
|
pure virtual |
return a vector of floor points defining the action zone boundary as a closed polygon
Implemented in vr_emulator.
Referenced by vr_view_interactor::draw_action_zone().
void vr::vr_driver::put_calibration_transformation | ( | float | transformation_matrix[12] | ) | const |
read access to calibration transformation stored as 3x4-matrix
Definition at line 50 of file vr_driver.cxx.
Referenced by cgv::gui::vr_calibration::update_driver_calibration().
|
pure virtual |
put a 3d up direction into passed array
Implemented in vr_emulator.
Referenced by vr_view_interactor::draw_action_zone().
void vr::vr_driver::put_x_direction | ( | float * | x_dir | ) | const |
put a 3d x direction into passed array
Definition at line 122 of file vr_driver.cxx.
|
protected |
provide reference to tracking reference states
provide reference to reference states
Definition at line 22 of file vr_driver.cxx.
Referenced by vr::vr_kit::ref_tracking_reference_state(), and vr_emulator::update_reference_states().
|
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
Definition at line 138 of file vr_driver.cxx.
References vr::vr_kit::get_camera(), vr::vr_kit::get_device_info(), vr::vr_kit::get_driver(), vr::vr_kit::get_name(), get_tracking_system_info(), vr::vr_camera::initialize(), and vr::ref_vr_kit_map().
scan all connected vr kits and return a vector with their ids
Implemented in vr_emulator.
|
pure virtual |
scan all connected vr kits and return a vector with their ids
Implemented in vr_emulator.
|
protected |
call this method during replacement of vr kits. In case vr kit handle had been registered before it is replaced, otherwise it is registered
Definition at line 128 of file vr_driver.cxx.
References vr::ref_vr_kit_map().
Referenced by vr_emulator::replace_by_index(), and vr_emulator::replace_by_pointer().
|
pure virtual |
scan all connected vr kits and return a vector with their ids
Implemented in vr_emulator.
Referenced by cgv::gui::vr_calibration::update_driver_calibration().
|
protected |
write access to calibration transformation is reserved to classes derived from vr_calibration_base
Definition at line 79 of file vr_driver.cxx.
Referenced by vr::vr_calibration_base::set_driver_calibration_matrix().
|
protected |
write access to driver index is restricted to the register_driver() function
Definition at line 160 of file vr_driver.cxx.
|
friend |
register a new driver
Definition at line 173 of file vr_driver.cxx.
|
friend |
Definition at line 93 of file vr_driver.h.
|
friend |
allow vr_kit access to ref_reference_state and tracking_system_info
Definition at line 76 of file vr_driver.h.
|
mutableprotected |
store tracking system info to be filled by driver implementations
Definition at line 78 of file vr_driver.h.
Referenced by get_tracking_system_info(), and vr::vr_kit::ref_tracking_system_info().