Reading raw data
Pose and IMU: produced by the device, no algorithm package.
Reading raw data
Raw poses are published directly with valid device frames; the IMU is published directly
when the device frame contains the corresponding data. They do not need retargeting scheduling,
and are not generated or rate-limited by run_forever(), run_background(), or update().
Glove pose
Read GlovePose through device.pose():
meta: source, time, optional sequence, and frame ID.payload.root_pose: root node position and XYZW quaternion.payload.fingertip_worldandfingertip_local: world/local poses of the five fingers.raw_valid_mask,held_mask, andquality_flags: quality information.
For the complete fields, see GlovePose and GloveFeaturePayload.
IMU (experimental)
Read the raw IMU counts provided by the glove through device.imu():
auto device = glove.device();
auto imu = device.imu();
auto imu_subscription = imu.subscribe(
[](const qnbot::Sample<qnbot::GloveImu>& sample) {
const auto& value = sample.value.payload;
std::cout << value.valid << ' ' << value.gyroscope_raw[0] << ' '
<< value.accelerometer_raw[0] << '\n';
});
bool started = false;
try {
device.start();
started = true;
run_application();
device.stop();
started = false;
glove.close();
} catch (...) {
if (started) {
device.stop();
}
glove.close();
throw;
}gyroscope_raw and accelerometer_raw are each three std::int16_t values, corresponding to
the three axes in order. The SDK performs no unit conversion, calibration, or pose fusion. When
valid == false, the raw counts are still retained and published. The IMU is currently an
experimental feature; the data format, supported devices, and public behavior may change later.
For the complete fields, see GloveImu and GloveImuPayload.
Device status
device.status() is also produced directly by the device rather than computed: whether it is connected, whether data is stale, the last error and the reconnect count. See Diagnostics & errors for the fields and how to use them for diagnosis.