From 23aea80e85486ce8756879c71ebadbd8d38eed98 Mon Sep 17 00:00:00 2001 From: ymd-stella Date: Sun, 17 Dec 2023 10:34:04 +0900 Subject: [PATCH] Reset before create a frame --- src/stella_vslam/system.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stella_vslam/system.cc b/src/stella_vslam/system.cc index 6e91aaafd..cbc5cfed4 100644 --- a/src/stella_vslam/system.cc +++ b/src/stella_vslam/system.cc @@ -437,6 +437,8 @@ data::frame system::create_RGBD_frame(const cv::Mat& rgb_img, const cv::Mat& dep } std::shared_ptr system::feed_monocular_frame(const cv::Mat& img, const double timestamp, const cv::Mat& mask) { + check_reset_request(); + assert(camera_->setup_type_ == camera::setup_type_t::Monocular); if (img.empty()) { spdlog::warn("preprocess: empty image"); @@ -446,6 +448,8 @@ std::shared_ptr system::feed_monocular_frame(const cv::Mat& img, const } std::shared_ptr system::feed_stereo_frame(const cv::Mat& left_img, const cv::Mat& right_img, const double timestamp, const cv::Mat& mask) { + check_reset_request(); + assert(camera_->setup_type_ == camera::setup_type_t::Stereo); if (left_img.empty() || right_img.empty()) { spdlog::warn("preprocess: empty image"); @@ -455,6 +459,8 @@ std::shared_ptr system::feed_stereo_frame(const cv::Mat& left_img, cons } std::shared_ptr system::feed_RGBD_frame(const cv::Mat& rgb_img, const cv::Mat& depthmap, const double timestamp, const cv::Mat& mask) { + check_reset_request(); + assert(camera_->setup_type_ == camera::setup_type_t::RGBD); if (rgb_img.empty() || depthmap.empty()) { spdlog::warn("preprocess: empty image"); @@ -464,8 +470,6 @@ std::shared_ptr system::feed_RGBD_frame(const cv::Mat& rgb_img, const c } std::shared_ptr system::feed_frame(const data::frame& frm, const cv::Mat& img) { - check_reset_request(); - const auto start = std::chrono::system_clock::now(); const auto cam_pose_wc = tracker_->feed_frame(frm);