naoqidriver
camera_info_definitions.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef CAMERA_INFO_DEF_HPP
19 #define CAMERA_INFO_DEF_HPP
20 
21 #include <sensor_msgs/CameraInfo.h>
22 #include <boost/assign/list_of.hpp>
23 
24 namespace naoqi
25 {
26 namespace converter
27 {
28 namespace camera_info_definitions
29 {
30 
34 inline sensor_msgs::CameraInfo createCameraInfoTOPVGA()
35 {
36  sensor_msgs::CameraInfo cam_info_msg;
37 
38  cam_info_msg.header.frame_id = "CameraTop_optical_frame";
39 
40  cam_info_msg.width = 640;
41  cam_info_msg.height = 480;
42  cam_info_msg.K = boost::array<double, 9>{{ 556.845054830986, 0, 309.366895338178, 0, 555.898679730161, 230.592233628776, 0, 0, 1 }};
43 
44  cam_info_msg.distortion_model = "plumb_bob";
45  cam_info_msg.D = boost::assign::list_of(-0.0545211535376379)(0.0691973423510287)(-0.00241094929163055)(-0.00112245009306511)(0).convert_to_container<std::vector<double> >();
46 
47  cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
48 
49  cam_info_msg.P = boost::array<double, 12>{{ 551.589721679688, 0, 308.271132841983, 0, 0, 550.291320800781, 229.20143668168, 0, 0, 0, 1, 0 }};
50 
51  return cam_info_msg;
52 }
53 
54 
55 inline sensor_msgs::CameraInfo createCameraInfoTOPQVGA()
56 {
57  sensor_msgs::CameraInfo cam_info_msg;
58 
59  cam_info_msg.header.frame_id = "CameraTop_optical_frame";
60 
61  cam_info_msg.width = 320;
62  cam_info_msg.height = 240;
63  cam_info_msg.K = boost::array<double, 9>{{ 274.139508945831, 0, 141.184472810944, 0, 275.741846757374, 106.693773654172, 0, 0, 1 }};
64 
65  cam_info_msg.distortion_model = "plumb_bob";
66  cam_info_msg.D = boost::assign::list_of(-0.0870160932911717)(0.128210165050533)(0.003379500659424)(-0.00106205540818586)(0).convert_to_container<std::vector<double> >();
67 
68  cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
69 
70  cam_info_msg.P = boost::array<double, 12>{{ 272.423675537109, 0, 141.131930791285, 0, 0, 273.515747070312, 107.391746054313, 0, 0, 0, 1, 0 }};
71 
72  return cam_info_msg;
73 }
74 
75 
76 inline sensor_msgs::CameraInfo createCameraInfoTOPQQVGA()
77 {
78  sensor_msgs::CameraInfo cam_info_msg;
79 
80  cam_info_msg.header.frame_id = "CameraTop_optical_frame";
81 
82  cam_info_msg.width = 160;
83  cam_info_msg.height = 120;
84  cam_info_msg.K = boost::array<double, 9>{{ 139.424539568966, 0, 76.9073669920582, 0, 139.25542782325, 59.5554242026743, 0, 0, 1 }};
85 
86  cam_info_msg.distortion_model = "plumb_bob";
87  cam_info_msg.D = boost::assign::list_of(-0.0843564504845967)(0.125733083790192)(0.00275901756247071)(-0.00138645823460527)(0).convert_to_container<std::vector<double> >();
88 
89  cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
90 
91  cam_info_msg.P = boost::array<double, 12>{{ 137.541534423828, 0, 76.3004646597892, 0, 0, 136.815216064453, 59.3909799751191, 0, 0, 0, 1, 0 }};
92 
93  return cam_info_msg;
94 }
95 
96 
100 inline sensor_msgs::CameraInfo createCameraInfoBOTTOMVGA()
101 {
102  sensor_msgs::CameraInfo cam_info_msg;
103 
104  cam_info_msg.header.frame_id = "CameraBottom_optical_frame";
105 
106  cam_info_msg.width = 640;
107  cam_info_msg.height = 480;
108  cam_info_msg.K = boost::array<double, 9>{{ 558.570339530768, 0, 308.885375457296, 0, 556.122943034837, 247.600724811385, 0, 0, 1 }};
109 
110  cam_info_msg.distortion_model = "plumb_bob";
111  cam_info_msg.D = boost::assign::list_of(-0.0648763971625288)(0.0612520196884308)(0.0038281538281731)(-0.00551104078371959)(0).convert_to_container<std::vector<double> >();
112 
113  cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
114 
115  cam_info_msg.P = boost::array<double, 12>{{ 549.571655273438, 0, 304.799679526441, 0, 0, 549.687316894531, 248.526959297022, 0, 0, 0, 1, 0 }};
116 
117  return cam_info_msg;
118 }
119 
120 
121 inline sensor_msgs::CameraInfo createCameraInfoBOTTOMQVGA()
122 {
123  sensor_msgs::CameraInfo cam_info_msg;
124 
125  cam_info_msg.header.frame_id = "CameraBottom_optical_frame";
126 
127  cam_info_msg.width = 320;
128  cam_info_msg.height = 240;
129  cam_info_msg.K = boost::array<double, 9>{{ 278.236008818534, 0, 156.194471689706, 0, 279.380102992049, 126.007123836447, 0, 0, 1 }};
130 
131  cam_info_msg.distortion_model = "plumb_bob";
132  cam_info_msg.D = boost::assign::list_of(-0.0481869853715082)(0.0201858398559121)(0.0030362056699177)(-0.00172241952442813)(0).convert_to_container<std::vector<double> >();
133 
134  cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
135 
136  cam_info_msg.P = boost::array<double, 12>{{ 273.491455078125, 0, 155.112454709117, 0, 0, 275.743133544922, 126.057357467223, 0, 0, 0, 1, 0 }};
137 
138  return cam_info_msg;
139 }
140 
141 
142 inline sensor_msgs::CameraInfo createCameraInfoBOTTOMQQVGA()
143 {
144  sensor_msgs::CameraInfo cam_info_msg;
145 
146  cam_info_msg.header.frame_id = "CameraBottom_optical_frame";
147 
148  cam_info_msg.width = 160;
149  cam_info_msg.height = 120;
150  cam_info_msg.K = boost::array<double, 9>{{ 141.611855886672, 0, 78.6494086288656, 0, 141.367163830175, 58.9220646201529, 0, 0, 1 }};
151 
152  cam_info_msg.distortion_model = "plumb_bob";
153  cam_info_msg.D = boost::assign::list_of(-0.0688388724945936)(0.0697453843669642)(0.00309518737071049)(-0.00570486993696543)(0).convert_to_container<std::vector<double> >();
154 
155  cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
156 
157  cam_info_msg.P = boost::array<double, 12>{{ 138.705535888672, 0, 77.2544255212306, 0, 0, 138.954086303711, 58.7000861760043, 0, 0, 0, 1, 0 }};
158 
159  return cam_info_msg;
160 }
161 
162 
166 inline sensor_msgs::CameraInfo createCameraInfoDEPTHVGA()
167 {
168  sensor_msgs::CameraInfo cam_info_msg;
169 
170  cam_info_msg.header.frame_id = "CameraDepth_optical_frame";
171 
172  cam_info_msg.width = 640;
173  cam_info_msg.height = 480;
174  cam_info_msg.K = boost::array<double, 9>{{ 525, 0, 319.5000000, 0, 525, 239.5000000000000, 0, 0, 1 }};
175 
176  //cam_info_msg.distortion_model = "plumb_bob";
177  //cam_info_msg.D = boost::assign::list_of(-0.0688388724945936)(0.0697453843669642)(0.00309518737071049)(-0.00570486993696543)(0);
178 
179  cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
180 
181  cam_info_msg.P = boost::array<double, 12>{{ 525, 0, 319.500000, 0, 0, 525, 239.5000000000, 0, 0, 0, 1, 0 }};
182 
183  return cam_info_msg;
184 }
185 
186 
187 inline sensor_msgs::CameraInfo createCameraInfoDEPTHQVGA()
188 {
189  sensor_msgs::CameraInfo cam_info_msg;
190 
191  cam_info_msg.header.frame_id = "CameraDepth_optical_frame";
192 
193  cam_info_msg.width = 320;
194  cam_info_msg.height = 240;
195  cam_info_msg.K = boost::array<double, 9>{{ 525/2.0f, 0, 319.5000000/2.0f, 0, 525/2.0f, 239.5000000000000/2.0f, 0, 0, 1 }};
196 
197  //cam_info_msg.distortion_model = "plumb_bob";
198  //cam_info_msg.D = boost::assign::list_of(-0.0688388724945936)(0.0697453843669642)(0.00309518737071049)(-0.00570486993696543)(0);
199 
200  cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
201 
202  cam_info_msg.P = boost::array<double, 12>{{ 525/2.0f, 0, 319.500000/2.0f, 0, 0, 525/2.0f, 239.5000000000/2.0f, 0, 0, 0, 1, 0 }};
203 
204  return cam_info_msg;
205 }
206 
207 inline sensor_msgs::CameraInfo createCameraInfoDEPTHQQVGA()
208 {
209  sensor_msgs::CameraInfo cam_info_msg;
210 
211  cam_info_msg.header.frame_id = "CameraDepth_optical_frame";
212 
213  cam_info_msg.width = 160;
214  cam_info_msg.height = 120;
215  cam_info_msg.K = boost::array<double, 9>{{ 525/4.0f, 0, 319.5000000/4.0f, 0, 525/4.0f, 239.5000000000000/4.0f, 0, 0, 1 }};
216 
217  //cam_info_msg.distortion_model = "plumb_bob";
218  //cam_info_msg.D = boost::assign::list_of(-0.0688388724945936)(0.0697453843669642)(0.00309518737071049)(-0.00570486993696543)(0);
219 
220  cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
221 
222  cam_info_msg.P = boost::array<double, 12>{{ 525/4.0f, 0, 319.500000/4.0f, 0, 0, 525/4.0f, 239.5000000000/4.0f, 0, 0, 0, 1, 0 }};
223 
224  return cam_info_msg;
225 }
226 } // camera_info_definitions
227 } //publisher
228 } //naoqi
229 
230 
231 #endif
sensor_msgs::CameraInfo createCameraInfoDEPTHVGA()
Definition: camera_info_definitions.hpp:166
Definition: audio.cpp:29
sensor_msgs::CameraInfo createCameraInfoTOPQVGA()
Definition: camera_info_definitions.hpp:55
sensor_msgs::CameraInfo createCameraInfoTOPVGA()
Definition: camera_info_definitions.hpp:34
sensor_msgs::CameraInfo createCameraInfoDEPTHQQVGA()
Definition: camera_info_definitions.hpp:207
sensor_msgs::CameraInfo createCameraInfoDEPTHQVGA()
Definition: camera_info_definitions.hpp:187
sensor_msgs::CameraInfo createCameraInfoBOTTOMQVGA()
Definition: camera_info_definitions.hpp:121
sensor_msgs::CameraInfo createCameraInfoBOTTOMVGA()
Definition: camera_info_definitions.hpp:100
sensor_msgs::CameraInfo createCameraInfoTOPQQVGA()
Definition: camera_info_definitions.hpp:76
sensor_msgs::CameraInfo createCameraInfoBOTTOMQQVGA()
Definition: camera_info_definitions.hpp:142