t/c/builder_lighthouse: Fail more clearly when cameras aren't available

This commit is contained in:
Moses Turner 2022-08-21 23:54:12 +01:00 committed by Jakob Bornecrantz
parent 4c55364d95
commit 0f40a4be8f

View file

@ -638,8 +638,21 @@ lighthouse_open_system(struct xrt_builder *xb,
lhs.vive_tstatus.hand_enabled = false;
}
bool success = true;
if (hmd_config == NULL) {
// This should NEVER happen, but we're not writing Rust.
U_LOG_E("Didn't get a vive config? Not creating visual trackers.");
goto end;
}
if (!hmd_config->cameras.valid) {
U_LOG_I(
"HMD didn't have cameras or didn't have a valid camera calibration. Not creating visual trackers.");
goto end;
}
struct xrt_slam_sinks sinks = {0};
struct xrt_device *hand_devices[2] = {NULL};
success = setup_visual_trackers(usysd, xp, hmd_config, &sinks, hand_devices);