-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDiscreteModel.cpp
More file actions
123 lines (98 loc) · 3.57 KB
/
Copy pathDiscreteModel.cpp
File metadata and controls
123 lines (98 loc) · 3.57 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
Copyright [2024] [Yao Yao]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
//
// Created by yao on 9/15/19.
//
#include "DiscreteModel.h"
#include "GroupModel.h"
#include <boost/preprocessor/seq/for_each.hpp>
namespace rba
{
template<typename CaptureParamsType>
IModel::IntriType IDiscreteModel<CaptureParamsType>::getIntriType() const {
return decltype(CaptureParamsType{}.intrinsics)::intriType;
}
template<typename Traits>
IdxPt DiscreteModel<Traits>::addPoint(double3 position, bool fixed) {
return mGrpModel->addPoint(position, fixed);
}
template<typename Traits>
double3 DiscreteModel<Traits>::getPointPosition(IdxPt idx) const {
return mGrpModel->getPointPosition(idx);
}
template<typename Traits>
void DiscreteModel<Traits>::setPointFixed(IdxPt idx, bool fixed) {
mGrpModel->setPointFixed(idx, fixed);
}
template<typename Traits>
void DiscreteModel<Traits>::setCaptureFixed(IdxCap idx, bool fixed) {
mGrpModel->setCaptureFixed(idx, fixed);
}
template <typename Traits>
void DiscreteModel<Traits>::setCaptureGNSS(IdxCap idx, double3 position, float omega[3][3], float huber) {
mGrpModel->setCaptureGNSS(idx, position, omega, huber);
}
template <typename Traits>
void DiscreteModel<Traits>::setSoftCtrlPoint(IdxPt idx, double3 position, float omega[3][3], float huber) {
mGrpModel->setSoftCtrlPoint(idx, position, omega, huber);
}
template<typename Traits>
void DiscreteModel<Traits>::initializeOptimization() {
mGrpModel->initializeOptimization();
}
template<typename Traits>
void DiscreteModel<Traits>::setInitDamp(float damp) {
mGrpModel->setInitDamp(damp);
}
template<typename Traits>
void DiscreteModel<Traits>::optimize(size_t maxIters) {
mGrpModel->optimize(maxIters);
}
template<typename Traits>
IdxCap DiscreteModel<Traits>::addCapture(const CapParamType ¶ms, bool fixed) {
return mGrpModel->addCapture(badIdx<IdxCam>(), params, fixed);
}
template<typename Traits>
void DiscreteModel<Traits>::setCaptureParams(IdxCap idx, const CapParamType& params) {
mGrpModel->setCaptureParams(idx, params);
}
template<typename Traits>
typename DiscreteModel<Traits>::CapParamType DiscreteModel<Traits>::getCaptureParams(IdxCap idx) const {
return mGrpModel->getCaptureParams(idx);
}
template<typename Traits>
void DiscreteModel<Traits>::addObservation(IdxCap idxCap, IdxPt idxPt, float2 proj, float omega, float huber) {
mGrpModel->addObservation(idxCap, idxPt, proj, omega, huber);
}
template<typename Traits>
DiscreteModel<Traits>::DiscreteModel()
: mGrpModel{std::make_unique<grouped::GroupModel<Traits>>()}{}
template<typename Traits>
void DiscreteModel<Traits>::filterModel() {
mGrpModel->filterModel();
}
template<typename Traits>
DiscreteModel<Traits>::~DiscreteModel() = default;
template<typename Traits>
void DiscreteModel<Traits>::clear() {
mGrpModel->clear();
}
template<typename Traits>
void DiscreteModel<Traits>::setVerbose(bool verbose) {
mGrpModel->setVerbose(verbose);
}
#define INSTANTIATE_TEMPLATES(r, data, TRAITS)\
template class DiscreteModel<TRAITS>;
BOOST_PP_SEQ_FOR_EACH(INSTANTIATE_TEMPLATES, data, ALL_DISCRETE_TRAITS)
#undef INSTANTIATE_TEMPLATES
}