Glove + Exo composite solution
Connect an Exo and two Gloves over one shared serial link with one lifecycle.
Glove + Exo composite solution
An interrupted shared serial link recovers automatically. After recovery or a successful restart, the SDK refreshes Exo and Glove state and clears stale connection errors; recovery does not require continuous application update() calls.
A Qnbot PLUS composite exposes the Exo, left Glove, and right Glove over one shared serial link.
Declare all three members in one CompositeExoGloveConfig, then let the root Sdk manage them.
Configuration flow
- Let
CompositeExoGloveConfigown the only serial connection. Do not assign separate connections to the Exo or two Glove members. - Leave
composite.connection.portempty for automatic discovery. Set it once on the composite when a fixed port is required. - Put the left Glove, right Glove, and Exo configs in
devices; usesdk.exo()for Exo data andsdk.glove()for Glove access. - Call
start(),stop(), andclose()only on the rootSdk.
Optional CompositeExoGloveConfig.name identifies the outer group. Members do not inherit it: give each member its own name before selecting it with glove.device(name) or exo.device(name).
Complete example
#include <qnbot/exo.hpp>
#include <qnbot/glove.hpp>
#include <iostream>
#include <utility>
int main() {
qnbot::GloveConfig left_glove;
left_glove.side = qnbot::Side::left;
left_glove.name = "left-glove";
qnbot::GloveConfig right_glove;
right_glove.side = qnbot::Side::right;
right_glove.name = "right-glove";
qnbot::ExoConfig exo_config;
exo_config.name = "exo";
qnbot::CompositeExoGloveConfig composite;
composite.name = "workstation-a";
// Auto-discover the shared port; uncomment the next line to pin it.
// composite.connection.port = "/dev/ttyACM0";
composite.devices = {left_glove, right_glove, exo_config};
qnbot::SdkConfig config;
config.devices = {composite};
qnbot::Sdk sdk(std::move(config));
auto glove = sdk.glove();
auto exo = sdk.exo();
auto left = glove.device("left-glove");
auto right = glove.device("right-glove");
auto exo_device = exo.device("exo");
auto left_subscription = left.pose().subscribe([](const auto& sample) {
std::cout << "left sequence=" << sample.sequence << '\n';
});
auto right_subscription = right.pose().subscribe([](const auto& sample) {
std::cout << "right sequence=" << sample.sequence << '\n';
});
auto exo_subscription = exo_device.telemetry().subscribe([](const auto& sample) {
std::cout << "exo sequence=" << sample.sequence << '\n';
});
sdk.start();
sdk.run_background();
std::cin.get();
sdk.request_stop();
sdk.join();
sdk.stop();
sdk.close();
}Exo haptics are unavailable in composite mode. Glove member GloveHaptics writes and clears are ignored with a composite_glove_haptics_unavailable warning and produce no physical vibration.
Exo supplies telemetry and status; check capabilities.imus before using IMU data. Glove supplies pose and status. The current shared CDC path does not expose raw Glove IMU.
Deciding when recovery is complete
After the shared physical port returns, each member still recovers independently when its own fresh data arrives. A recovered Exo does not imply that either Glove has recovered, and vice versa. Subscribe separately to exo_device.status(), left.status(), and right.status(), and resume work for a member only when it reports connected and not stale.
Install compatible Exo and Glove C++ packages. See the
Glove composite guide and the complete
composite-exo-glove/cpp example.