25 #ifndef INCLUDED_TrackerSensorInfo_h_GUID_AEDB8ECA_7CAC_4A84_ACAB_CF05A681B260 26 #define INCLUDED_TrackerSensorInfo_h_GUID_AEDB8ECA_7CAC_4A84_ACAB_CF05A681B260 33 #include <boost/assert.hpp> 42 bool reportsPosition =
true;
43 bool reportsOrientation =
true;
44 bool reportsLinearVelocity =
false;
45 bool reportsAngularVelocity =
false;
46 bool reportsLinearAcceleration =
false;
47 bool reportsAngularAcceleration =
false;
56 "Can't pass an unresolved source to getTrackerSensorInfo!");
59 source.getInterfaceName() ==
"tracker",
60 "Can't pass a non-tracker source to getTrackerSensorInfo!");
63 source.getDeviceElement().getDescriptor()[
"interfaces"][
"tracker"];
66 auto getBool = [](Json::Value
const &root,
const char key[],
67 bool &val) { val = root.get(key, val).asBool(); };
69 Json::Value
const &root) {
73 getBool(root,
"position", info.reportsPosition);
74 getBool(root,
"orientation", info.reportsOrientation);
75 getBool(root,
"linearVelocity", info.reportsLinearVelocity);
76 getBool(root,
"angularVelocity", info.reportsAngularVelocity);
77 getBool(root,
"linearAcceleration", info.reportsLinearAcceleration);
78 getBool(root,
"angularAcceleration",
79 info.reportsAngularAcceleration);
84 setupFromJson(ret, devDescriptor);
87 auto sensor = source.getSensorNumber();
89 setupFromJson(ret, devDescriptor[
"traits"][*sensor]);
99 #endif // INCLUDED_TrackerSensorInfo_h_GUID_AEDB8ECA_7CAC_4A84_ACAB_CF05A681B260 The result of resolving a tree node to a device: either an original source to connect to...
Definition: OriginalSource.h:47
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
fully-resolved data about a tracker sensor. Defaults per the schema.
Definition: TrackerSensorInfo.h:41
TrackerSensorInfo getTrackerSensorInfo(OriginalSource const &source)
Given a fully-parsed tracker source, determines what messages and subsets thereof it reports...
Definition: TrackerSensorInfo.h:53