Glove + Exo composite solution
Connect two Gloves and an Exo 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 update() calls.
A Qnbot PLUS composite carries the left Glove, right Glove, and Exo over one shared serial link.
Declare all three members in one CompositeExoGloveConfig, then use the root Sdk for their lifecycle.
Configuration flow
- Let
CompositeExoGloveConfigown the only serial connection. Do not assign separate connections to the two Gloves or Exo 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, then usesdk.glove()andsdk.exo()to obtain the members. - 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.
Install compatible Exo and Glove C++ packages. See the
Exo composite guide and the complete
composite-exo-glove/cpp example.