MinVR  0.9.0
A multi-platform virtual reality library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
MinVR::InputDeviceVRPNTracker Class Reference
Inheritance diagram for MinVR::InputDeviceVRPNTracker:
MinVR::AbstractInputDevice

Public Member Functions

 InputDeviceVRPNTracker (const std::string &vrpnTrackerDeviceName, const std::vector< std::string > &eventsToGenerate, const double &trackerUnitsToRoomUnitsScale, const glm::mat4 &deviceToRoom, const std::vector< glm::mat4 > &propToTracker, const std::vector< glm::mat4 > &finalOffset, const bool &waitForNewReportInPoll, const bool &convertLHtoRH=false, const bool &ignoreZeroes=false)
 
 InputDeviceVRPNTracker (const std::string name, const ConfigMapRef map)
 
virtual ~InputDeviceVRPNTracker ()
 
void pollForInput (std::vector< EventRef > &events)
 Adds device events to event queue. More...
 
- Public Member Functions inherited from MinVR::AbstractInputDevice
 AbstractInputDevice ()
 
virtual ~AbstractInputDevice ()
 

Detailed Description

Calibration Procedure:

  1. Set TrackerUnitsToRoomUnitsScale to get everything in feet.
  2. Adjust DeviceToRoom by printing out the position of sensor 0 until it reports the origin of RoomSpace in the correct place and +X, +Y, and +Z all point in the correct direction. You can print out the value of sensor 0 by calling printSensor0(true).
  3. Use the TestTrackers function of the IS3D/programTemplate demo to draw the CoordinateFrame for each tracker. Adjust each tracker's PropToTracker transformation until it aligns itself with the RoomSpace frame when the tracker is held at the origin of RoomSpace.

Here's an easy way to think about it: Hold up each prop at the origin of RoomSpace in the orientation that you want to be considered "normal". Then, look at the drawing of its frame. For each of the vectors in its frame (X,Y,Z) that are shown, ask yourself, what is the RoomSpace vector that this arrow depicts? Then enter that value in the appropriate X,Y, or Z column in the PropToTracker frame.

  1. For some of the props you may want the origin for the prop to be somewhere on the prop other than where the tracker is positioned. For these, measure the distance from the tracker to where you want the origin to be, call this vector V. Then, put this vector into the translation part of the PropToTracker frame. Be careful, the translation is applied after the rotation specified in the frame, so for example, if the first column of the frame is (0,1,0,0), you should put the Y component of V in that column, so it would become (0,1,0,Y[1]). If it were (0,-1,0,0), you would need to put (0,-1,0,-Y[1]).

Constructor & Destructor Documentation

MinVR::InputDeviceVRPNTracker::InputDeviceVRPNTracker ( const std::string &  vrpnTrackerDeviceName,
const std::vector< std::string > &  eventsToGenerate,
const double &  trackerUnitsToRoomUnitsScale,
const glm::mat4 &  deviceToRoom,
const std::vector< glm::mat4 > &  propToTracker,
const std::vector< glm::mat4 > &  finalOffset,
const bool &  waitForNewReportInPoll,
const bool &  convertLHtoRH = false,
const bool &  ignoreZeroes = false 
)
inline
MinVR::InputDeviceVRPNTracker::InputDeviceVRPNTracker ( const std::string  name,
const ConfigMapRef  map 
)
inline
virtual MinVR::InputDeviceVRPNTracker::~InputDeviceVRPNTracker ( )
inlinevirtual

Member Function Documentation

void MinVR::InputDeviceVRPNTracker::pollForInput ( std::vector< EventRef > &  events)
inlinevirtual
 Adds any events generated by the input device to the events array.
Remarks
This should be implemented by any derived classes.

Implements MinVR::AbstractInputDevice.


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