Bone configuration
Capture & calibration
Measure, save, and export personal bone profiles without creating an Sdk or connecting a glove. This workflow is independent of motion CaptureSession and algorithm CalibrationSession. See Personal bone profile file for the workflow.
All types and functions below are in namespace qnbot; include <qnbot/glove.hpp>.
create_bone_config()
Select terminal QR preparation or application-controlled interaction through one entry point.
Type
BoneConfigCreationResult create_bone_config(
const BoneConfigSessionOptions& options,
CaptureInteractionMode interaction = CaptureInteractionMode::auto_terminal,
BoneConfigOverwritePolicy policy = BoneConfigOverwritePolicy::replace_existing);See BoneConfigSessionOptions for fields and defaults. interaction uses the existing CaptureInteractionMode.
Returns BoneConfigCreationResult. The default auto_terminal blocks until completion, cancellation, expiry or failure. Success holds an installation result and releases the session. external holds an application-owned session for link presentation, polling and installation, released through RAII or close().
Example
See Hand model parameters for the full workflow. Choose the call that matches your interaction mode.
Terminal interaction
#include <qnbot/glove.hpp>
#include <iostream>
#include <variant>
const auto installed = std::get<qnbot::BoneConfigInstallResult>(
qnbot::create_bone_config(
qnbot::BoneConfigSessionOptions{qnbot::Side::right, "operator-01"}));
std::cout << installed.path << '\n';External interaction
#include <qnbot/glove.hpp>
#include <exception>
#include <iostream>
#include <variant>
int main() {
try {
auto bone_config_session = std::get<qnbot::BoneConfigSession>(
qnbot::create_bone_config(
qnbot::BoneConfigSessionOptions{qnbot::Side::right, "operator-01"},
qnbot::CaptureInteractionMode::external));
std::cout << bone_config_session.info().phone_url << std::endl;
while (bone_config_session.poll() == qnbot::BoneConfigSessionStatus::pending) {
}
const auto installed = bone_config_session.install();
std::cout << installed.path << '\n';
} catch (const std::exception& error) {
std::cerr << error.what() << '\n';
return 1;
}
}The external example prints the phone link for presentation by your application UI. poll() enforces the service polling interval and the original session expiry, and reports expiry or network errors. Install the completed result before releasing the session.
policy applies to automatic terminal installation and defaults to replace_existing, replacing the same wearer and hand profile after a successful save. External interaction selects its policy at session.install(policy), which also defaults to replace_existing. Explicitly pass deny to protect an existing profile. An invalid interaction enum fails before session creation.
export_bone_config()
Read the saved single-hand profile selected by wearer identifier and side from the standard profile directory, validate it, and export it to the requested destination. Returns the destination path as a string. The operation works independently of an SDK instance, glove connection, or measurement session.
Type
std::string export_bone_config(
const std::string& path, const std::string& operator_id, Side side,
BoneConfigOverwritePolicy policy = BoneConfigOverwritePolicy::deny);path is the export destination. operator_id and side select the saved profile to back up. Overwrite policy rejects an existing destination by default. Explicitly select BoneConfigOverwritePolicy::replace_existing to replace it. A missing profile, invalid single-hand YAML, or write failure produces an error. A failed export preserves an existing destination file.
Example
#include <qnbot/glove.hpp>
#include <iostream>
const auto exported_path = qnbot::export_bone_config(
"/path/to/backup/right.yaml", "operator-01", qnbot::Side::right);
std::cout << exported_path << '\n';Export reads the saved source profile for the requested wearer and side, then writes to the caller's explicit destination using the chosen overwrite policy. See Hand model parameters for storage locations and historical-file restoration.
BoneConfigSession::info()
Read cached local session information without a network request.
BoneConfigSession::poll()
Perform one bounded status query; this does not start a polling loop.
Type
BoneConfigSessionStatus BoneConfigSession::poll() const;Returns BoneConfigSessionStatus, with value pending or completed. Poll serially. Inside poll(), the SDK enforces info.poll_interval_seconds between queries and bounds waiting by the original session expiry. Stop polling on completion and call install(). Create a new session after expiry.
BoneConfigSession::install()
Fetch a completed measurement, validate it, and save the personal bone profile.
Type
BoneConfigInstallResult BoneConfigSession::install(
BoneConfigOverwritePolicy policy = BoneConfigOverwritePolicy::replace_existing) const;Call after measurement completes. A successful save replaces the existing profile for the same wearer and hand by default and returns BoneConfigInstallResult. Explicitly pass BoneConfigOverwritePolicy::deny to report an error and preserve an existing profile. Remote cleanup is requested after a successful save. A false cleanup_confirmed preserves local success.
BoneConfigSession::cancel()
Cancel the remote measurement workflow without deleting an installed profile.
Type
void BoneConfigSession::cancel() const;Release the local session after cancellation.
BoneConfigSession::close()
Stop local operations and release the handle; repeated calls are safe.
Type
void BoneConfigSession::close() const;The object is move-only and releases resources through RAII. Other operations reject a closed handle; call cancel() first when remote cancellation is needed.
Errors and execution
Invalid arguments, mismatched side or format, an existing destination with explicit deny, an incomplete or expired session, and network or write failures cause errors. Failed installation preserves existing configuration. Network operations are synchronous; run them on a worker thread in a GUI.