-
Notifications
You must be signed in to change notification settings - Fork 0
/
slam.h
67 lines (50 loc) · 1.13 KB
/
slam.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* slam.h
*
* Created on: Dec 31, 2012
* Author: michael
*/
#ifndef SLAM_H_
#define SLAM_H_
#include <functional>
#include <memory>
#include <set>
#include "localmap.h"
namespace ceres {
class Problem;
}
class Slam {
public:
Slam();
virtual ~Slam();
bool SolveFrames(
LocalMap* map,
int num_to_solve,
int num_to_present,
double range);
bool SolveAllFrames(
LocalMap* map,
double range,
bool solve_cameras);
bool SolveFramePose(
const Frame* f1,
Frame* f2);
// TODO: This belong in LocalMap which means the projection
// should be lifted out.
double ReprojectMap(LocalMap* map);
// Project a point into a frame.
void Project(const Frame* frame, const TrackedPoint* point) const;
int iterations() const { return iterations_; }
double error() const { return error_; }
private:
unique_ptr<ceres::Problem> problem_;
std::set<Frame*> frame_set_;
std::set<TrackedPoint*> point_set_;
bool SetupProblem(
double range,
const std::map<Frame*, bool>& frames);
bool Run(bool fine);
int iterations_;
double error_;
};
#endif /* SLAM_H_ */