18 #ifndef CAMERA_INFO_DEF_HPP 19 #define CAMERA_INFO_DEF_HPP 21 #include <sensor_msgs/CameraInfo.h> 22 #include <boost/assign/list_of.hpp> 28 namespace camera_info_definitions
36 sensor_msgs::CameraInfo cam_info_msg;
38 cam_info_msg.header.frame_id =
"CameraTop_optical_frame";
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 }};
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> >();
47 cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
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 }};
57 sensor_msgs::CameraInfo cam_info_msg;
59 cam_info_msg.header.frame_id =
"CameraTop_optical_frame";
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 }};
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> >();
68 cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
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 }};
78 sensor_msgs::CameraInfo cam_info_msg;
80 cam_info_msg.header.frame_id =
"CameraTop_optical_frame";
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 }};
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> >();
89 cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
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 }};
102 sensor_msgs::CameraInfo cam_info_msg;
104 cam_info_msg.header.frame_id =
"CameraBottom_optical_frame";
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 }};
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> >();
113 cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
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 }};
123 sensor_msgs::CameraInfo cam_info_msg;
125 cam_info_msg.header.frame_id =
"CameraBottom_optical_frame";
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 }};
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> >();
134 cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
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 }};
144 sensor_msgs::CameraInfo cam_info_msg;
146 cam_info_msg.header.frame_id =
"CameraBottom_optical_frame";
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 }};
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> >();
155 cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
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 }};
168 sensor_msgs::CameraInfo cam_info_msg;
170 cam_info_msg.header.frame_id =
"CameraDepth_optical_frame";
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 }};
179 cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
181 cam_info_msg.P = boost::array<double, 12>{{ 525, 0, 319.500000, 0, 0, 525, 239.5000000000, 0, 0, 0, 1, 0 }};
189 sensor_msgs::CameraInfo cam_info_msg;
191 cam_info_msg.header.frame_id =
"CameraDepth_optical_frame";
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 }};
200 cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
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 }};
209 sensor_msgs::CameraInfo cam_info_msg;
211 cam_info_msg.header.frame_id =
"CameraDepth_optical_frame";
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 }};
220 cam_info_msg.R = boost::array<double, 9>{{ 1, 0, 0, 0, 1, 0, 0, 0, 1 }};
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 }};
233 const float &reductionFactor) {
235 sensor_msgs::CameraInfo cam_info_msg;
237 cam_info_msg.header.frame_id =
"CameraDepth_optical_frame";
242 const size_t nP = 12;
244 float kTab[nK] = {703.102356f/reductionFactor, 0, 647.821594f/reductionFactor,
245 0, 702.432312f/reductionFactor, 380.971680f/reductionFactor,
248 float dTab[nD] = {-0.168594331,
254 float rTab[nR] = {0.999984741, 0.000130843779, 0.00552622462,
255 -0.000111592424, 0.999993920, -0.00348380185,
256 -0.00552664697, 0.00348313176, 0.999978662};
258 float pTab[nP] = {569.869568f/reductionFactor, 0, 644.672058f/reductionFactor, 0,
259 0, 569.869568f/reductionFactor, 393.368958f/reductionFactor, 0,
263 cam_info_msg.width = width;
264 cam_info_msg.height = height;
266 for (
int i = 0; i < nK; ++i)
267 cam_info_msg.K.at(i) = kTab[i];
269 cam_info_msg.distortion_model =
"plumb_bob";
270 cam_info_msg.D.assign(dTab, dTab + nD);
272 for (
int i = 0; i < nR; ++i)
273 cam_info_msg.R.at(i) = rTab[i];
275 for (
int i = 0; i < nP; ++i)
276 cam_info_msg.P.at(i) = pTab[i];
sensor_msgs::CameraInfo createCameraInfoStereoQ720PX2()
sensor_msgs::CameraInfo createCameraInfoStereoQQQ720PX2()
sensor_msgs::CameraInfo createCameraInfoDEPTHVGA()
sensor_msgs::CameraInfo createCameraInfoDEPTHQQQ720P()
sensor_msgs::CameraInfo createCameraInfoStereoQQ720PX2()
sensor_msgs::CameraInfo createCameraInfoTOPQVGA()
sensor_msgs::CameraInfo createCameraInfoTOPVGA()
sensor_msgs::CameraInfo createCameraInfoDEPTHQQQQ720P()
sensor_msgs::CameraInfo createCameraInfoDEPTHQQVGA()
sensor_msgs::CameraInfo createCameraInfoDEPTHQVGA()
sensor_msgs::CameraInfo createCameraInfoBOTTOMQVGA()
sensor_msgs::CameraInfo createCameraInfoStereoQQQQ720PX2()
sensor_msgs::CameraInfo createCameraInfoStereo720PX2()
sensor_msgs::CameraInfo createCameraInfoDEPTHQQ720P()
sensor_msgs::CameraInfo createCameraInfoBOTTOMVGA()
sensor_msgs::CameraInfo createCameraInfoDEPTH720P()
sensor_msgs::CameraInfo createCameraInfoStereo(const int &width, const int &height, const float &reductionFactor)
sensor_msgs::CameraInfo createCameraInfoDEPTHQ720P()
sensor_msgs::CameraInfo createCameraInfoTOPQQVGA()
sensor_msgs::CameraInfo createCameraInfoBOTTOMQQVGA()