-
Notifications
You must be signed in to change notification settings - Fork 0
/
camera.cpp
62 lines (48 loc) · 947 Bytes
/
camera.cpp
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
#include "camera.h"
#include <iostream>
Camera::Camera(const Sophus::SE3d& pose, int id, double focus, double k1, double k2, bool fixed) :pose_(pose), id_(id), focus_(focus), k1_(k1), k2_(k2),fixed_(fixed), state_index_(-1) {}
double Camera::getFocus()
{
return focus_;
}
double Camera::getK1()
{
return k1_;
}
double Camera::getK2()
{
return k2_;
}
const Sophus::SE3d& Camera::getPose()
{
return pose_;
}
void Camera::setPose(const Sophus::SE3d& pose)
{
pose_ = pose;
}
int Camera::getId()
{
return id_;
}
void Camera::setId(int id)
{
id_ = id;
}
void Camera::setFixed()
{
fixed_ = true;
}
bool Camera::isFixed()
{
return fixed_;
}
void Camera::addDeltaPose(const Eigen::Matrix<double, 6, 1>& delta_pose)
{
Sophus::SE3d delta_SE3d = Sophus::SE3d::exp(delta_pose);
pose_ = delta_SE3d * pose_;
}
void Camera::addDeltaPose(const Sophus::SE3d& delta_pose)
{
pose_ = delta_pose * pose_;
}