The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

t/slam: Replace assertion with return -1 if SLAM_CONFIG is not provided

+8 -4
+8 -4
src/xrt/auxiliary/tracking/t_tracker_slam.cpp
··· 279 279 extern "C" int 280 280 t_slam_create(struct xrt_frame_context *xfctx, struct xrt_tracked_slam **out_xts, struct xrt_slam_sinks **out_sink) 281 281 { 282 + enum u_logging_level ll = debug_get_log_option_slam_log(); 283 + const char *config_file = debug_get_option_slam_config(); 284 + if (!config_file) { 285 + U_LOG_IFL_W(ll, "SLAM tracker requires a config file set with the SLAM_CONFIG environment variable"); 286 + return -1; 287 + } 288 + 282 289 auto &t = *(new TrackerSlam{}); 283 - t.ll = debug_get_log_option_slam_log(); 290 + t.ll = ll; 284 291 t.cv_wrapper = new MatFrame(); 285 292 286 293 t.base.get_tracked_pose = t_slam_get_tracked_pose; 287 - 288 - const char *config_file = debug_get_option_slam_config(); 289 - SLAM_ASSERT(config_file, "SLAM tracker requires a config file set with the SLAM_CONFIG environment variable"); 290 294 291 295 std::string config_file_string = std::string(config_file); 292 296 t.slam = new slam_tracker{config_file_string};