Exercise installed Basalt defaults in the complete test suite

This commit is contained in:
lbgos committed 2026-10-12 00:23:31 +03:00
1 parent e373caa0b1
commit 43ebc19a06
3 files changed
+23 -13

No files matched your search

+8 -4
View File
@@ -50,19 +50,23 @@ TEST_CASE("m_quatexpmap")
INFO("vel=" << vel.x << ", " << vel.y << ", " << vel.z);
INFO("new_vel=" << new_vel.x << ", " << new_vel.y << ", " << new_vel.z);
CHECK(m_vec3_len(new_vel - vel) <= 0.001);
// At exactly 180 degrees either axis sign describes the same shortest rotation.
bool half_turn = std::abs(m_vec3_len(vel) * dt - M_PI) <= 0.000001;
CHECK((m_vec3_len(new_vel - vel) <= 0.001 ||
(half_turn && m_vec3_len(new_vel + vel) <= 0.001)));
}
}
}
SECTION("Test quat_exp and quat_ln are inverses")
{
// We use rotations with less than PI radians as quat_ln will return the negative rotation otherwise
// This API takes half-Rodrigues vectors. Its shortest-rotation log is inverse
// inside the PI/2 vector-norm domain, corresponding to rotations below PI.
vector<xrt_vec3> aas = {
{0, 0, 0},
axis1 * (float)M_PI * 0.01f,
axis2 * (float)M_PI * 0.5f,
axis3 * (float)M_PI * 0.99f,
axis2 * (float)M_PI * 0.25f,
axis3 * (float)M_PI * 0.49f,
};
for (xrt_vec3 aa : aas) {
+7 -4
View File
@@ -13,6 +13,7 @@
#include <cstdlib>
#include <cstring>
#include <vector>
#include <dlfcn.h>
struct Motion
{
@@ -76,9 +77,6 @@ render(xrt_frame *frame, double baseline, double t)
int
main()
{
const char *library = std::getenv("VIT_SYSTEM_LIBRARY_PATH");
if (!library)
return 77;
t_slam_calibration calibration{};
const char *camera_count = std::getenv("SLAM_TEST_CAM_COUNT");
const int cameras = camera_count && std::strcmp(camera_count, "5") == 0 ? 5 : 2;
@@ -105,7 +103,12 @@ main()
}
t_slam_tracker_config config{};
t_slam_fill_default_config(&config);
config.vit_system_library_path = library;
void *library = dlopen(config.vit_system_library_path, RTLD_LAZY | RTLD_LOCAL);
if (!library) {
puts("VIT backend unavailable for the recovery check");
return std::getenv("VIT_SYSTEM_LIBRARY_PATH") ? 1 : 77;
}
dlclose(library);
config.cam_count = cameras;
config.submit_from_start = true;
config.slam_calib = &calibration;
+8 -5
View File
@@ -11,16 +11,13 @@
#include <initializer_list>
#include <atomic>
#include <thread>
#include <dlfcn.h>
#ifdef SLAM_TEST_HAVE_TBB
#include <tbb/global_control.h>
#endif
int
main()
{
if (!std::getenv("VIT_SYSTEM_LIBRARY_PATH")) {
puts("Set VIT_SYSTEM_LIBRARY_PATH to run the backend lifecycle check");
return 77;
}
t_slam_calibration calibration{};
calibration.cam_count = 2;
// Use the default Basalt pipeline IMU rate for this lifecycle-only check.
@@ -48,7 +45,13 @@ main()
// Exercise the production default. The backend must advertise safe recreation.
t_slam_tracker_config config{};
t_slam_fill_default_config(&config);
config.vit_system_library_path = std::getenv("VIT_SYSTEM_LIBRARY_PATH");
// Resolve the installed backend exactly as the ordinary driver launch does.
void *library = dlopen(config.vit_system_library_path, RTLD_LAZY | RTLD_LOCAL);
if (!library) {
puts("VIT backend unavailable for the lifecycle check");
return std::getenv("VIT_SYSTEM_LIBRARY_PATH") ? 1 : 77;
}
dlclose(library);
config.cam_count = 2;
config.submit_from_start = true;
config.slam_calib = &calibration;