The open source OpenXR runtime
0
fork

Configure Feed

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

external/slam: Update interface to support multiple cameras

authored by

Mateo de Mayo and committed by
Jakob Bornecrantz
09d7aac8 52cac31d

+11 -7
+10 -7
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 = 5; //!< API Breakages 32 + constexpr int HEADER_VERSION_MAJOR = 6; //!< 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 ··· 81 81 struct img_sample { 82 82 std::int64_t timestamp; 83 83 cv::Mat img; 84 - bool is_left; 84 + int cam_index; 85 85 img_sample() = default; 86 - img_sample(std::int64_t timestamp, const cv::Mat &img, bool is_left) 87 - : timestamp(timestamp), img(img), is_left(is_left) {} 86 + img_sample(std::int64_t timestamp, const cv::Mat &img, int cam_index) 87 + : timestamp(timestamp), img(img), cam_index(cam_index) {} 88 88 }; 89 89 90 90 /*! ··· 94 94 //! Path to a implementation-specific config file. If null, use defaults. 95 95 std::shared_ptr<std::string> config_file; 96 96 97 + //! Number of cameras to use. Required. 98 + int cam_count = -1; 99 + 97 100 //! If supported, whether to open the system's UI. 98 - bool show_ui; 101 + bool show_ui = false; 99 102 }; 100 103 101 104 /*! ··· 132 135 * @brief Push an image sample into the tracker. 133 136 * 134 137 * Same conditions as @ref push_imu_sample apply. 135 - * When using stereo frames, they must be pushed in a left-right order. 136 - * The consecutive left-right pair must have the same timestamps. 138 + * When using N>1 cameras, the N frames must be pushed following cam_id order. 139 + * The bundle of N frames must have the same timestamps. 137 140 */ 138 141 void push_frame(const img_sample &sample); 139 142
+1
src/xrt/auxiliary/tracking/t_tracker_slam.cpp
··· 1357 1357 1358 1358 slam_config system_config = {}; 1359 1359 system_config.config_file = config_file ? make_shared<string>(config_file) : nullptr; 1360 + system_config.cam_count = NUM_CAMS; 1360 1361 system_config.show_ui = config->slam_ui; 1361 1362 t.slam = new slam_tracker{system_config}; 1362 1363