forked from gaoxiang12/slambook2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0501be4
commit 8eee8ac
Showing
14 changed files
with
215 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// Created by gaoxiang on 19-5-2. | ||
// | ||
|
||
#ifndef MYSLAM_BACKEND_H | ||
#define MYSLAM_BACKEND_H | ||
|
||
#include "myslam/common_include.h" | ||
|
||
namespace myslam { | ||
class Backend { | ||
public: | ||
typedef std::shared_ptr<Backend> Ptr; | ||
|
||
private: | ||
|
||
}; | ||
|
||
} | ||
|
||
#endif //MYSLAM_BACKEND_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#ifndef MYSLAM_CONFIG_H | ||
#define MYSLAM_CONFIG_H | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#pragma once | ||
#ifndef MYSLAM_FRONTEND_H | ||
#define MYSLAM_FRONTEND_H | ||
|
||
#include "myslam/common_include.h" | ||
#include "myslam/frame.h" | ||
#include "myslam/map.h" | ||
|
||
namespace myslam { | ||
|
||
class Backend; | ||
|
||
class Frontend { | ||
public: | ||
typedef std::shared_ptr<Frontend> Ptr; | ||
enum FrontendStatus { | ||
INITING, | ||
TRACKING_GOOD, | ||
TRACKING_BAD, | ||
LOST | ||
}; | ||
|
||
Frontend(); | ||
|
||
bool AddFrame(Frame::Ptr frame); | ||
|
||
void SetMap(Map::Ptr map) { map_ = map; } | ||
|
||
void SetBackend(std::shared_ptr<Backend> backend) { backend_ = backend; } | ||
|
||
FrontendStatus GetStatus() const { return status_; } | ||
|
||
private: | ||
/** | ||
* Try init the frontend with stereo images saved in current_frame_ | ||
* @return true if success | ||
*/ | ||
bool StereoInit(); | ||
|
||
/** | ||
* Detect features in left image in current_frame_ | ||
* keypoints will be saved in current_frame_ | ||
* @return | ||
*/ | ||
int DetectFeatures(); | ||
|
||
/** | ||
* Find the corresponding features in right image of current_frame_ | ||
* @return num of features found | ||
*/ | ||
int FindFeaturesInRight(); | ||
|
||
/** | ||
* Build the initial map with single image | ||
* @return true if succeed | ||
*/ | ||
bool BuildInitMap(); | ||
|
||
// data | ||
FrontendStatus status_ = INITING; | ||
|
||
Frame::Ptr current_frame_ = nullptr; | ||
Frame::Ptr ref_frame_ = nullptr; | ||
Camera::Ptr camera_ = nullptr; | ||
|
||
Map::Ptr map_ = nullptr; | ||
std::shared_ptr<Backend> backend_ = nullptr; | ||
|
||
// params | ||
int num_features_init_ = 100; | ||
|
||
// utilities | ||
cv::Ptr<cv::GFTTDetector> gftt_; // feature detector in opencv | ||
}; | ||
|
||
} | ||
|
||
#endif //MYSLAM_FRONTEND_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// | ||
// Created by gaoxiang on 19-5-2. | ||
// | ||
|
||
#include "myslam/backend.h" | ||
|
||
namespace myslam { | ||
|
||
} |
Oops, something went wrong.