SensorCalibration.cpp
Go to the documentation of this file.
2 
3 namespace rokubimini
4 {
5 namespace calibration
6 {
7 bool SensorCalibration::load(const std::string& key, NodeHandlePtr nh)
8 {
9  // Do something
10  bool success = false;
11  std::string calibration_matrix_key = key + "/calibration_matrix";
12  std::string local_key;
13  local_key = calibration_matrix_key + "/1_1";
14  if (nh->hasParam(local_key))
15  {
16  nh->getParam(local_key, calibrationMatrix_(0, 0));
17  success = true;
18  }
19  local_key = calibration_matrix_key + "/1_2";
20  if (nh->hasParam(local_key))
21  {
22  nh->getParam(local_key, calibrationMatrix_(0, 1));
23  success = true;
24  }
25  local_key = calibration_matrix_key + "/1_3";
26  if (nh->hasParam(local_key))
27  {
28  nh->getParam(local_key, calibrationMatrix_(0, 2));
29  success = true;
30  }
31  local_key = calibration_matrix_key + "/1_4";
32  if (nh->hasParam(local_key))
33  {
34  nh->getParam(local_key, calibrationMatrix_(0, 3));
35  success = true;
36  }
37  local_key = calibration_matrix_key + "/1_5";
38  if (nh->hasParam(local_key))
39  {
40  nh->getParam(local_key, calibrationMatrix_(0, 4));
41  success = true;
42  }
43  local_key = calibration_matrix_key + "/1_6";
44  if (nh->hasParam(local_key))
45  {
46  nh->getParam(local_key, calibrationMatrix_(0, 5));
47  success = true;
48  }
49  local_key = calibration_matrix_key + "/2_1";
50  if (nh->hasParam(local_key))
51  {
52  nh->getParam(local_key, calibrationMatrix_(1, 0));
53  success = true;
54  }
55  local_key = calibration_matrix_key + "/2_2";
56  if (nh->hasParam(local_key))
57  {
58  nh->getParam(local_key, calibrationMatrix_(1, 1));
59  success = true;
60  }
61  local_key = calibration_matrix_key + "/2_3";
62  if (nh->hasParam(local_key))
63  {
64  nh->getParam(local_key, calibrationMatrix_(1, 2));
65  success = true;
66  }
67  local_key = calibration_matrix_key + "/2_4";
68  if (nh->hasParam(local_key))
69  {
70  nh->getParam(local_key, calibrationMatrix_(1, 3));
71  success = true;
72  }
73  local_key = calibration_matrix_key + "/2_5";
74  if (nh->hasParam(local_key))
75  {
76  nh->getParam(local_key, calibrationMatrix_(1, 4));
77  success = true;
78  }
79  local_key = calibration_matrix_key + "/2_6";
80  if (nh->hasParam(local_key))
81  {
82  nh->getParam(local_key, calibrationMatrix_(1, 5));
83  success = true;
84  }
85  local_key = calibration_matrix_key + "/3_1";
86  if (nh->hasParam(local_key))
87  {
88  nh->getParam(local_key, calibrationMatrix_(2, 0));
89  success = true;
90  }
91  local_key = calibration_matrix_key + "/3_2";
92  if (nh->hasParam(local_key))
93  {
94  nh->getParam(local_key, calibrationMatrix_(2, 1));
95  success = true;
96  }
97  local_key = calibration_matrix_key + "/3_3";
98  if (nh->hasParam(local_key))
99  {
100  nh->getParam(local_key, calibrationMatrix_(2, 2));
101  success = true;
102  }
103  local_key = calibration_matrix_key + "/3_4";
104  if (nh->hasParam(local_key))
105  {
106  nh->getParam(local_key, calibrationMatrix_(2, 3));
107  success = true;
108  }
109  local_key = calibration_matrix_key + "/3_5";
110  if (nh->hasParam(local_key))
111  {
112  nh->getParam(local_key, calibrationMatrix_(2, 4));
113  success = true;
114  }
115  local_key = calibration_matrix_key + "/3_6";
116  if (nh->hasParam(local_key))
117  {
118  nh->getParam(local_key, calibrationMatrix_(2, 5));
119  success = true;
120  }
121  local_key = calibration_matrix_key + "/4_1";
122  if (nh->hasParam(local_key))
123  {
124  nh->getParam(local_key, calibrationMatrix_(3, 0));
125  success = true;
126  }
127  local_key = calibration_matrix_key + "/4_2";
128  if (nh->hasParam(local_key))
129  {
130  nh->getParam(local_key, calibrationMatrix_(3, 1));
131  success = true;
132  }
133  local_key = calibration_matrix_key + "/4_3";
134  if (nh->hasParam(local_key))
135  {
136  nh->getParam(local_key, calibrationMatrix_(3, 2));
137  success = true;
138  }
139  local_key = calibration_matrix_key + "/4_4";
140  if (nh->hasParam(local_key))
141  {
142  nh->getParam(local_key, calibrationMatrix_(3, 3));
143  success = true;
144  }
145  local_key = calibration_matrix_key + "/4_5";
146  if (nh->hasParam(local_key))
147  {
148  nh->getParam(local_key, calibrationMatrix_(3, 4));
149  success = true;
150  }
151  local_key = calibration_matrix_key + "/4_6";
152  if (nh->hasParam(local_key))
153  {
154  nh->getParam(local_key, calibrationMatrix_(3, 5));
155  success = true;
156  }
157  local_key = calibration_matrix_key + "/5_1";
158  if (nh->hasParam(local_key))
159  {
160  nh->getParam(local_key, calibrationMatrix_(4, 0));
161  success = true;
162  }
163  local_key = calibration_matrix_key + "/5_2";
164  if (nh->hasParam(local_key))
165  {
166  nh->getParam(local_key, calibrationMatrix_(4, 1));
167  success = true;
168  }
169  local_key = calibration_matrix_key + "/5_3";
170  if (nh->hasParam(local_key))
171  {
172  nh->getParam(local_key, calibrationMatrix_(4, 2));
173  success = true;
174  }
175  local_key = calibration_matrix_key + "/5_4";
176  if (nh->hasParam(local_key))
177  {
178  nh->getParam(local_key, calibrationMatrix_(4, 3));
179  success = true;
180  }
181  local_key = calibration_matrix_key + "/5_5";
182  if (nh->hasParam(local_key))
183  {
184  nh->getParam(local_key, calibrationMatrix_(4, 4));
185  success = true;
186  }
187  local_key = calibration_matrix_key + "/5_6";
188  if (nh->hasParam(local_key))
189  {
190  nh->getParam(local_key, calibrationMatrix_(4, 5));
191  success = true;
192  }
193  local_key = calibration_matrix_key + "/6_1";
194  if (nh->hasParam(local_key))
195  {
196  nh->getParam(local_key, calibrationMatrix_(5, 0));
197  success = true;
198  }
199  local_key = calibration_matrix_key + "/6_2";
200  if (nh->hasParam(local_key))
201  {
202  nh->getParam(local_key, calibrationMatrix_(5, 1));
203  success = true;
204  }
205  local_key = calibration_matrix_key + "/6_3";
206  if (nh->hasParam(local_key))
207  {
208  nh->getParam(local_key, calibrationMatrix_(5, 2));
209  success = true;
210  }
211  local_key = calibration_matrix_key + "/6_4";
212  if (nh->hasParam(local_key))
213  {
214  nh->getParam(local_key, calibrationMatrix_(5, 3));
215  success = true;
216  }
217  local_key = calibration_matrix_key + "/6_5";
218  if (nh->hasParam(local_key))
219  {
220  nh->getParam(local_key, calibrationMatrix_(5, 4));
221  success = true;
222  }
223  local_key = calibration_matrix_key + "/6_6";
224  if (nh->hasParam(local_key))
225  {
226  nh->getParam(local_key, calibrationMatrix_(5, 5));
227  success = true;
228  }
229  return success;
230 }
231 } // namespace calibration
232 } // namespace rokubimini
std::shared_ptr< ros::NodeHandle > NodeHandlePtr
Eigen::Matrix< double, 6, 6 > calibrationMatrix_
The calibration matrix.
bool load(const std::string &key, NodeHandlePtr nh)
Loads the calibrations from the parameter server.
Tests Configuration.


rokubimini
Author(s):
autogenerated on Wed Mar 3 2021 03:09:12