37 const rtabmap_ros::RGBDImageConstPtr& image1Msg)
42 rtabmap_ros::UserDataConstPtr userDataMsg;
43 nav_msgs::OdometryConstPtr odomMsg;
44 sensor_msgs::LaserScanConstPtr scanMsg;
45 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
46 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
47 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
49 void CommonDataSubscriber::rgbdScan2dCallback(
50 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
51 const sensor_msgs::LaserScanConstPtr& scanMsg)
56 rtabmap_ros::UserDataConstPtr userDataMsg;
57 nav_msgs::OdometryConstPtr odomMsg;
58 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
59 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
60 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
62 void CommonDataSubscriber::rgbdScan3dCallback(
63 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
64 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg)
69 rtabmap_ros::UserDataConstPtr userDataMsg;
70 nav_msgs::OdometryConstPtr odomMsg;
71 sensor_msgs::LaserScanConstPtr scanMsg;
72 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
73 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
75 void CommonDataSubscriber::rgbdInfoCallback(
76 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
77 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
82 rtabmap_ros::UserDataConstPtr userDataMsg;
83 nav_msgs::OdometryConstPtr odomMsg;
84 sensor_msgs::LaserScanConstPtr scanMsg;
85 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
86 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
88 void CommonDataSubscriber::rgbdScan2dInfoCallback(
89 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
90 const sensor_msgs::LaserScanConstPtr& scanMsg,
91 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
96 rtabmap_ros::UserDataConstPtr userDataMsg;
97 nav_msgs::OdometryConstPtr odomMsg;
98 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
99 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
101 void CommonDataSubscriber::rgbdScan3dInfoCallback(
102 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
103 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg,
104 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
109 rtabmap_ros::UserDataConstPtr userDataMsg;
110 nav_msgs::OdometryConstPtr odomMsg;
111 sensor_msgs::LaserScanConstPtr scanMsg;
112 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
116 void CommonDataSubscriber::rgbdOdomCallback(
117 const nav_msgs::OdometryConstPtr & odomMsg,
118 const rtabmap_ros::RGBDImageConstPtr& image1Msg)
123 rtabmap_ros::UserDataConstPtr userDataMsg;
124 sensor_msgs::LaserScanConstPtr scanMsg;
125 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
126 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
127 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
129 void CommonDataSubscriber::rgbdOdomScan2dCallback(
130 const nav_msgs::OdometryConstPtr & odomMsg,
131 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
132 const sensor_msgs::LaserScanConstPtr& scanMsg)
137 rtabmap_ros::UserDataConstPtr userDataMsg;
138 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
139 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
140 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
142 void CommonDataSubscriber::rgbdOdomScan3dCallback(
143 const nav_msgs::OdometryConstPtr & odomMsg,
144 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
145 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg)
150 rtabmap_ros::UserDataConstPtr userDataMsg;
151 sensor_msgs::LaserScanConstPtr scanMsg;
152 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
153 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
155 void CommonDataSubscriber::rgbdOdomInfoCallback(
156 const nav_msgs::OdometryConstPtr & odomMsg,
157 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
158 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
163 rtabmap_ros::UserDataConstPtr userDataMsg;
164 sensor_msgs::LaserScanConstPtr scanMsg;
165 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
166 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
168 void CommonDataSubscriber::rgbdOdomScan2dInfoCallback(
169 const nav_msgs::OdometryConstPtr & odomMsg,
170 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
171 const sensor_msgs::LaserScanConstPtr& scanMsg,
172 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
177 rtabmap_ros::UserDataConstPtr userDataMsg;
178 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
179 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
181 void CommonDataSubscriber::rgbdOdomScan3dInfoCallback(
182 const nav_msgs::OdometryConstPtr & odomMsg,
183 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
184 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg,
185 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
190 rtabmap_ros::UserDataConstPtr userDataMsg;
191 sensor_msgs::LaserScanConstPtr scanMsg;
192 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
196 void CommonDataSubscriber::rgbdDataCallback(
197 const rtabmap_ros::UserDataConstPtr & userDataMsg,
198 const rtabmap_ros::RGBDImageConstPtr& image1Msg)
203 nav_msgs::OdometryConstPtr odomMsg;
204 sensor_msgs::LaserScanConstPtr scanMsg;
205 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
206 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
207 commonSingleDepthCallback(odomMsg, userDataMsg, rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
209 void CommonDataSubscriber::rgbdDataScan2dCallback(
210 const rtabmap_ros::UserDataConstPtr & userDataMsg,
211 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
212 const sensor_msgs::LaserScanConstPtr& scanMsg)
217 nav_msgs::OdometryConstPtr odomMsg;
218 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
219 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
220 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
222 void CommonDataSubscriber::rgbdDataScan3dCallback(
223 const rtabmap_ros::UserDataConstPtr & userDataMsg,
224 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
225 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg)
230 nav_msgs::OdometryConstPtr odomMsg;
231 sensor_msgs::LaserScanConstPtr scanMsg;
232 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
233 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
235 void CommonDataSubscriber::rgbdDataInfoCallback(
236 const rtabmap_ros::UserDataConstPtr & userDataMsg,
237 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
238 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
243 nav_msgs::OdometryConstPtr odomMsg;
244 sensor_msgs::LaserScanConstPtr scanMsg;
245 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
246 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
248 void CommonDataSubscriber::rgbdDataScan2dInfoCallback(
249 const rtabmap_ros::UserDataConstPtr & userDataMsg,
250 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
251 const sensor_msgs::LaserScanConstPtr& scanMsg,
252 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
257 nav_msgs::OdometryConstPtr odomMsg;
258 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
259 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
261 void CommonDataSubscriber::rgbdDataScan3dInfoCallback(
262 const rtabmap_ros::UserDataConstPtr & userDataMsg,
263 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
264 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg,
265 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
270 nav_msgs::OdometryConstPtr odomMsg;
271 sensor_msgs::LaserScanConstPtr scanMsg;
272 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
276 void CommonDataSubscriber::rgbdOdomDataCallback(
277 const nav_msgs::OdometryConstPtr & odomMsg,
278 const rtabmap_ros::UserDataConstPtr & userDataMsg,
279 const rtabmap_ros::RGBDImageConstPtr& image1Msg)
284 sensor_msgs::LaserScanConstPtr scanMsg;
285 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
286 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
287 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
289 void CommonDataSubscriber::rgbdOdomDataScan2dCallback(
290 const nav_msgs::OdometryConstPtr & odomMsg,
291 const rtabmap_ros::UserDataConstPtr & userDataMsg,
292 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
293 const sensor_msgs::LaserScanConstPtr& scanMsg)
298 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
299 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
300 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
302 void CommonDataSubscriber::rgbdOdomDataScan3dCallback(
303 const nav_msgs::OdometryConstPtr & odomMsg,
304 const rtabmap_ros::UserDataConstPtr & userDataMsg,
305 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
306 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg)
311 sensor_msgs::LaserScanConstPtr scanMsg;
312 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
313 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
315 void CommonDataSubscriber::rgbdOdomDataInfoCallback(
316 const nav_msgs::OdometryConstPtr & odomMsg,
317 const rtabmap_ros::UserDataConstPtr & userDataMsg,
318 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
319 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
324 sensor_msgs::LaserScanConstPtr scanMsg;
325 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
326 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
328 void CommonDataSubscriber::rgbdOdomDataScan2dInfoCallback(
329 const nav_msgs::OdometryConstPtr & odomMsg,
330 const rtabmap_ros::UserDataConstPtr & userDataMsg,
331 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
332 const sensor_msgs::LaserScanConstPtr& scanMsg,
333 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
338 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
339 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
341 void CommonDataSubscriber::rgbdOdomDataScan3dInfoCallback(
342 const nav_msgs::OdometryConstPtr & odomMsg,
343 const rtabmap_ros::UserDataConstPtr & userDataMsg,
344 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
345 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg,
346 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
351 sensor_msgs::LaserScanConstPtr scanMsg;
352 commonSingleDepthCallback(odomMsg, userDataMsg,rgb, depth, image1Msg->rgbCameraInfo, image1Msg->depthCameraInfo, scanMsg, scan3dMsg, odomInfoMsg);
359 bool subscribeUserData,
360 bool subscribeScan2d,
361 bool subscribeScan3d,
362 bool subscribeOdomInfo,
368 if(subscribeOdom || subscribeUserData || subscribeScan2d || subscribeScan3d || subscribeOdomInfo)
372 rgbdSubs_[0]->subscribe(nh,
"rgbd_image", 1);
375 if(subscribeOdom && subscribeUserData)
383 if(subscribeOdomInfo)
394 else if(subscribeScan3d)
398 if(subscribeOdomInfo)
409 else if(subscribeOdomInfo)
420 else if(subscribeOdom)
427 if(subscribeOdomInfo)
438 else if(subscribeScan3d)
442 if(subscribeOdomInfo)
453 else if(subscribeOdomInfo)
464 else if(subscribeUserData)
471 if(subscribeOdomInfo)
482 else if(subscribeScan3d)
486 if(subscribeOdomInfo)
497 else if(subscribeOdomInfo)
514 if(subscribeOdomInfo)
525 else if(subscribeScan3d)
529 if(subscribeOdomInfo)
540 else if(subscribeOdomInfo)
557 uFormat(
"\n%s subscribed to:\n %s",
void rgbdCallback(const rtabmap_ros::RGBDImageConstPtr &)
std::string uFormat(const char *fmt,...)
void commonSingleDepthCallback(const nav_msgs::OdometryConstPtr &odomMsg, const rtabmap_ros::UserDataConstPtr &userDataMsg, const cv_bridge::CvImageConstPtr &imageMsg, const cv_bridge::CvImageConstPtr &depthMsg, const sensor_msgs::CameraInfo &rgbCameraInfoMsg, const sensor_msgs::CameraInfo &depthCameraInfoMsg, const sensor_msgs::LaserScanConstPtr &scanMsg, const sensor_msgs::PointCloud2ConstPtr &scan3dMsg, const rtabmap_ros::OdomInfoConstPtr &odomInfoMsg)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
#define SYNC_DECL5(PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2, SUB3, SUB4)
ROSCPP_DECL const std::string & getName()
#define SYNC_DECL3(PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2)
message_filters::Subscriber< rtabmap_ros::UserData > userDataSub_
bool subscribedToOdomInfo_
message_filters::Subscriber< rtabmap_ros::OdomInfo > odomInfoSub_
void setupRGBDCallbacks(ros::NodeHandle &nh, ros::NodeHandle &pnh, bool subscribeOdom, bool subscribeUserData, bool subscribeScan2d, bool subscribeScan3d, bool subscribeOdomInfo, int queueSize, bool approxSync)
std::string getTopic() const
#define SYNC_DECL2(PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1)
message_filters::Subscriber< sensor_msgs::LaserScan > scanSub_
#define SYNC_DECL4(PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2, SUB3)
message_filters::Subscriber< nav_msgs::Odometry > odomSub_
message_filters::Subscriber< sensor_msgs::PointCloud2 > scan3dSub_
void subscribe(ros::NodeHandle &nh, const std::string &topic, uint32_t queue_size, const ros::TransportHints &transport_hints=ros::TransportHints(), ros::CallbackQueueInterface *callback_queue=0)
void toCvShare(const rtabmap_ros::RGBDImageConstPtr &image, cv_bridge::CvImageConstPtr &rgb, cv_bridge::CvImageConstPtr &depth)
std::string subscribedTopicsMsg_
std::vector< message_filters::Subscriber< rtabmap_ros::RGBDImage > * > rgbdSubs_