t/slam: Print VIT error numbers

This commit is contained in:
Mateo de Mayo 2024-01-20 20:23:19 -03:00 committed by Simon Zeni
parent db40cc2e73
commit 717336fa88
2 changed files with 6 additions and 4 deletions

View file

@ -1519,13 +1519,13 @@ t_slam_create(struct xrt_frame_context *xfctx,
vit_result_t vres = t.vit.tracker_create(&system_config, &t.tracker); vit_result_t vres = t.vit.tracker_create(&system_config, &t.tracker);
if (vres != VIT_SUCCESS) { if (vres != VIT_SUCCESS) {
SLAM_ERROR("Failed to create VIT tracker"); SLAM_ERROR("Failed to create VIT tracker (%d)", vres);
return -1; return -1;
} }
vres = t.vit.tracker_get_pose_capabilities(t.tracker, &t.caps); vres = t.vit.tracker_get_pose_capabilities(t.tracker, &t.caps);
if (vres != VIT_SUCCESS) { if (vres != VIT_SUCCESS) {
SLAM_ERROR("Failed to get VIT tracker pose capabilities"); SLAM_ERROR("Failed to get VIT tracker pose capabilities (%d)", vres);
return -1; return -1;
} }

View file

@ -1,4 +1,4 @@
// Copyright 2023, Collabora, Ltd. // Copyright 2023-2024, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0 // SPDX-License-Identifier: BSL-1.0
/*! /*!
* @file * @file
@ -11,6 +11,7 @@
#include "xrt/xrt_config_os.h" #include "xrt/xrt_config_os.h"
#include "tracking/t_vit_loader.h" #include "tracking/t_vit_loader.h"
#include "util/u_logging.h" #include "util/u_logging.h"
#include "vit/vit_interface.h"
#include <stdlib.h> #include <stdlib.h>
@ -59,7 +60,8 @@ t_vit_bundle_load(struct t_vit_bundle *vit, const char *path)
// Check major version. // Check major version.
if (vit->version.major != VIT_HEADER_VERSION_MAJOR) { if (vit->version.major != VIT_HEADER_VERSION_MAJOR) {
U_LOG_E("Incompatible major version (supports %u) was: %u.%u.%u", VIT_HEADER_VERSION_MAJOR, U_LOG_E("Incompatible versions: expecting %u.%u.%u but got %u.%u.%u", //
VIT_HEADER_VERSION_MAJOR, VIT_HEADER_VERSION_MINOR, VIT_HEADER_VERSION_PATCH, //
vit->version.major, vit->version.minor, vit->version.patch); vit->version.major, vit->version.minor, vit->version.patch);
dlclose(vit->handle); dlclose(vit->handle);
return false; return false;