The open source OpenXR runtime
0
fork

Configure Feed

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

t/slam: Add SLAM_UI option to enable the external system UI

authored by

Mateo de Mayo and committed by
Jakob Bornecrantz
80fdf731 fb28f940

+20 -12
+13 -10
src/external/slam_tracker/slam_tracker.hpp
··· 29 29 30 30 // For implementation: same as IMPLEMENTATION_VERSION_* 31 31 // For user: expected IMPLEMENTATION_VERSION_*. Should be checked in runtime. 32 - constexpr int HEADER_VERSION_MAJOR = 4; //!< API Breakages 32 + constexpr int HEADER_VERSION_MAJOR = 5; //!< API Breakages 33 33 constexpr int HEADER_VERSION_MINOR = 0; //!< Backwards compatible API changes 34 34 constexpr int HEADER_VERSION_PATCH = 0; //!< Backw. comp. .h-implemented changes 35 35 ··· 88 88 }; 89 89 90 90 /*! 91 + * @brief Parameters for creating the system pipeline. 92 + */ 93 + struct slam_config { 94 + //! Path to a implementation-specific config file. If null, use defaults. 95 + std::shared_ptr<std::string> config_file; 96 + 97 + //! If supported, whether to open the system's UI. 98 + bool show_ui; 99 + }; 100 + 101 + /*! 91 102 * @brief slam_tracker serves as an interface between Monado and external SLAM 92 103 * systems. 93 104 * ··· 95 106 * should be provided by an external SLAM system. 96 107 */ 97 108 struct slam_tracker { 98 - /*! 99 - * @brief Construct a new slam tracker object 100 - * 101 - * @param config_file SLAM systems parameters tend to be numerous and very 102 - * specific, so they usually use a configuration file as the main way to set 103 - * them up. Therefore, this constructor receives a path to a 104 - * implementation-specific configuration file. 105 - */ 106 - slam_tracker(const std::string &config_file); 109 + slam_tracker(const slam_config &config); 107 110 ~slam_tracker(); 108 111 109 112 slam_tracker(const slam_tracker &) = delete;
+6 -2
src/xrt/auxiliary/tracking/t_tracker_slam.cpp
··· 66 66 //! @see t_slam_tracker_config 67 67 DEBUG_GET_ONCE_LOG_OPTION(slam_log, "SLAM_LOG", U_LOGGING_INFO) 68 68 DEBUG_GET_ONCE_OPTION(slam_config, "SLAM_CONFIG", nullptr) 69 + DEBUG_GET_ONCE_BOOL_OPTION(slam_ui, "SLAM_UI", false) 69 70 DEBUG_GET_ONCE_BOOL_OPTION(slam_submit_from_start, "SLAM_SUBMIT_FROM_START", false) 70 71 DEBUG_GET_ONCE_NUM_OPTION(slam_prediction_type, "SLAM_PREDICTION_TYPE", long(SLAM_PRED_SP_SO_IA_SL)) 71 72 DEBUG_GET_ONCE_BOOL_OPTION(slam_write_csvs, "SLAM_WRITE_CSVS", false) ··· 1268 1269 { 1269 1270 config->log_level = debug_get_log_option_slam_log(); 1270 1271 config->slam_config = debug_get_option_slam_config(); 1272 + config->slam_ui = debug_get_bool_option_slam_ui(); 1271 1273 config->submit_from_start = debug_get_bool_option_slam_submit_from_start(); 1272 1274 config->prediction = t_slam_prediction_type(debug_get_num_option_slam_prediction_type()); 1273 1275 config->write_csvs = debug_get_bool_option_slam_write_csvs(); ··· 1321 1323 1322 1324 t.base.get_tracked_pose = t_slam_get_tracked_pose; 1323 1325 1324 - std::string config_file_string = std::string(config_file ? config_file : "DEFAULT"); 1325 - t.slam = new slam_tracker{config_file_string}; 1326 + slam_config system_config = {}; 1327 + system_config.config_file = config_file ? make_shared<string>(config_file) : nullptr; 1328 + system_config.show_ui = config->slam_ui; 1329 + t.slam = new slam_tracker{system_config}; 1326 1330 1327 1331 if (!config_file) { 1328 1332 SLAM_INFO("Using calibration from driver and default pipeline settings");
+1
src/xrt/auxiliary/tracking/t_tracking.h
··· 465 465 { 466 466 enum u_logging_level log_level; //!< SLAM tracking logging level 467 467 const char *slam_config; //!< Config file path, format is specific to the SLAM implementation in use 468 + bool slam_ui; //!< Whether to open the external UI of the external SLAM system 468 469 bool submit_from_start; //!< Whether to submit data to the SLAM tracker without user action 469 470 enum t_slam_prediction_type prediction; //!< Which level of prediction to use 470 471 bool write_csvs; //!< Whether to enable CSV writers from the start for later analysis