Skip to content

Commit

Permalink
Changed get_tracking_state to return a string (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymd-stella authored Dec 17, 2023
1 parent 30850bb commit acf1a41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/stella_vslam/publish/frame_publisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,19 @@ cv::Mat frame_publisher::draw_frame() {
return img;
}

tracker_state_t frame_publisher::get_tracking_state() {
std::string frame_publisher::get_tracking_state() {
std::lock_guard<std::mutex> lock(mtx_);
return tracking_state_;
std::string state_str;
if (tracking_state_ == tracker_state_t::Initializing) {
state_str = "Initializing";
}
else if (tracking_state_ == tracker_state_t::Lost) {
state_str = "Lost";
}
else if (tracking_state_ == tracker_state_t::Tracking) {
state_str = "Tracking";
}
return state_str;
}

std::vector<cv::KeyPoint> frame_publisher::get_keypoints() {
Expand Down
2 changes: 1 addition & 1 deletion src/stella_vslam/publish/frame_publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class frame_publisher {
*/
cv::Mat draw_frame();

tracker_state_t get_tracking_state();
std::string get_tracking_state();

std::vector<cv::KeyPoint> get_keypoints();

Expand Down

0 comments on commit acf1a41

Please sign in to comment.