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...
fully-resolved data about a tracker sensor. Defaults per the schema.
TrackerSensorInfo getTrackerSensorInfo(OriginalSource const &source)