52 std::string
const &deviceName,
53 boost::optional<OSVR_ChannelCount> sensor,
54 common::InterfaceList &ifaces)
56 m_internals(ifaces), m_all(!sensor.is_initialized()),
60 m_dev->addComponent(locomotion);
62 locomotion->registerNaviVelocityHandler(
65 m_handleNaviVelocity(data, timestamp);
67 locomotion->registerNaviPositionHandler(
70 m_handleNaviPosition(data, timestamp);
74 OSVR_DEV_VERBOSE(
"Constructed a Locomotion Handler for "
86 virtual void update() { m_dev->update(); }
91 if (!m_all && *m_sensor != data.sensor) {
98 report.sensor = data.sensor;
99 report.
state = data.naviVelState;
103 void m_handleNaviPosition(common::NaviPositionData
const &data,
105 if (!m_all && *m_sensor != data.sensor) {
111 report.sensor = data.sensor;
112 report.
state = data.naviPosnState;
116 common::BaseDevicePtr m_dev;
117 RemoteHandlerInternals m_internals;
119 boost::optional<OSVR_ChannelCount> m_sensor;
122 LocomotionRemoteFactory::LocomotionRemoteFactory(
123 VRPNConnectionCollection
const &conns)
130 shared_ptr<RemoteHandler> ret;
132 if (source.hasTransform()) {
136 auto const &devElt = source.getDeviceElement();
140 m_conns.getConnection(devElt), devElt.getFullDeviceName(),
141 source.getSensorNumberAsChannelCount(), ifaces));
shared_ptr< RemoteHandler > operator()(common::OriginalSource const &source, common::InterfaceList &ifaces, common::ClientContext &ctx)
The result of resolving a tree node to a device: either an original source to connect to...
BaseDevicePtr createClientDevice(std::string const &name, vrpn_ConnectionPtr const &conn)
Factory function for a bare client device with no components/interfaces registered by default...
Report type for an navigation position callback on a tracker interface.
Report type for an navigation velocity callback on a tracker interface.
Header including PathTree.h and all additional headers needed to define related types.
LocomotionRemoteHandler & operator=(LocomotionRemoteHandler const &)=delete
Deleted assignment operator.
OSVR_NaviVelocityState state
The 2D vector in world coordinate system, in meters/second.
Header to bring unique_ptr into the osvr namespace.
virtual ~LocomotionRemoteHandler()
::OSVR_TimeValue TimeValue
C++-friendly typedef for the OSVR_TimeValue structure.
static shared_ptr< LocomotionComponent > create()
Factory method.
OSVR_NaviPositionState state
The 2D vector in world coordinate system, in meters, relative to starting position.
void setStateAndTriggerCallbacks(const OSVR_TimeValue ×tamp, ReportType const &report)
Set state and call callbacks for a report type.
Internal, configured header file for verbosity macros.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Base class for remote device handler classes.