33 void CommonDataSubscriber::depthCallback(
34 const sensor_msgs::ImageConstPtr& imageMsg,
35 const sensor_msgs::ImageConstPtr& depthMsg,
36 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg)
38 rtabmap_ros::UserDataConstPtr userDataMsg;
39 nav_msgs::OdometryConstPtr odomMsg;
40 sensor_msgs::LaserScanConstPtr scanMsg;
41 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
42 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
45 void CommonDataSubscriber::depthScan2dCallback(
46 const sensor_msgs::ImageConstPtr& imageMsg,
47 const sensor_msgs::ImageConstPtr& depthMsg,
48 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
49 const sensor_msgs::LaserScanConstPtr& scanMsg)
51 rtabmap_ros::UserDataConstPtr userDataMsg;
52 nav_msgs::OdometryConstPtr odomMsg;
53 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
54 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
57 void CommonDataSubscriber::depthScan3dCallback(
58 const sensor_msgs::ImageConstPtr& imageMsg,
59 const sensor_msgs::ImageConstPtr& depthMsg,
60 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
61 const sensor_msgs::PointCloud2ConstPtr& scanMsg)
63 rtabmap_ros::UserDataConstPtr userDataMsg;
64 nav_msgs::OdometryConstPtr odomMsg;
65 sensor_msgs::LaserScanConstPtr scan2dMsg;
66 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
69 void CommonDataSubscriber::depthInfoCallback(
70 const sensor_msgs::ImageConstPtr& imageMsg,
71 const sensor_msgs::ImageConstPtr& depthMsg,
72 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
73 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
75 rtabmap_ros::UserDataConstPtr userDataMsg;
76 nav_msgs::OdometryConstPtr odomMsg;
77 sensor_msgs::LaserScanConstPtr scan2dMsg;
78 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
81 void CommonDataSubscriber::depthScan2dInfoCallback(
82 const sensor_msgs::ImageConstPtr& imageMsg,
83 const sensor_msgs::ImageConstPtr& depthMsg,
84 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
85 const sensor_msgs::LaserScanConstPtr& scanMsg,
86 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
88 rtabmap_ros::UserDataConstPtr userDataMsg;
89 nav_msgs::OdometryConstPtr odomMsg;
90 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
93 void CommonDataSubscriber::depthScan3dInfoCallback(
94 const sensor_msgs::ImageConstPtr& imageMsg,
95 const sensor_msgs::ImageConstPtr& depthMsg,
96 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
97 const sensor_msgs::PointCloud2ConstPtr& scanMsg,
98 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
100 rtabmap_ros::UserDataConstPtr userDataMsg;
101 nav_msgs::OdometryConstPtr odomMsg;
102 sensor_msgs::LaserScanConstPtr scan2dMsg;
107 void CommonDataSubscriber::depthOdomCallback(
108 const nav_msgs::OdometryConstPtr & odomMsg,
109 const sensor_msgs::ImageConstPtr& imageMsg,
110 const sensor_msgs::ImageConstPtr& depthMsg,
111 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg)
113 rtabmap_ros::UserDataConstPtr userDataMsg;
114 sensor_msgs::LaserScanConstPtr scanMsg;
115 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
116 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
119 void CommonDataSubscriber::depthOdomScan2dCallback(
120 const nav_msgs::OdometryConstPtr & odomMsg,
121 const sensor_msgs::ImageConstPtr& imageMsg,
122 const sensor_msgs::ImageConstPtr& depthMsg,
123 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
124 const sensor_msgs::LaserScanConstPtr& scanMsg)
126 rtabmap_ros::UserDataConstPtr userDataMsg;
127 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
128 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
131 void CommonDataSubscriber::depthOdomScan3dCallback(
132 const nav_msgs::OdometryConstPtr & odomMsg,
133 const sensor_msgs::ImageConstPtr& imageMsg,
134 const sensor_msgs::ImageConstPtr& depthMsg,
135 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
136 const sensor_msgs::PointCloud2ConstPtr& scanMsg)
138 rtabmap_ros::UserDataConstPtr userDataMsg;
139 sensor_msgs::LaserScanConstPtr scan2dMsg;
140 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
143 void CommonDataSubscriber::depthOdomInfoCallback(
144 const nav_msgs::OdometryConstPtr & odomMsg,
145 const sensor_msgs::ImageConstPtr& imageMsg,
146 const sensor_msgs::ImageConstPtr& depthMsg,
147 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
148 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
150 rtabmap_ros::UserDataConstPtr userDataMsg;
151 sensor_msgs::LaserScanConstPtr scan2dMsg;
152 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
155 void CommonDataSubscriber::depthOdomScan2dInfoCallback(
156 const nav_msgs::OdometryConstPtr & odomMsg,
157 const sensor_msgs::ImageConstPtr& imageMsg,
158 const sensor_msgs::ImageConstPtr& depthMsg,
159 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
160 const sensor_msgs::LaserScanConstPtr& scanMsg,
161 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
163 rtabmap_ros::UserDataConstPtr userDataMsg;
164 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
167 void CommonDataSubscriber::depthOdomScan3dInfoCallback(
168 const nav_msgs::OdometryConstPtr & odomMsg,
169 const sensor_msgs::ImageConstPtr& imageMsg,
170 const sensor_msgs::ImageConstPtr& depthMsg,
171 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
172 const sensor_msgs::PointCloud2ConstPtr& scanMsg,
173 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
175 rtabmap_ros::UserDataConstPtr userDataMsg;
176 sensor_msgs::LaserScanConstPtr scan2dMsg;
181 void CommonDataSubscriber::depthDataCallback(
182 const rtabmap_ros::UserDataConstPtr & userDataMsg,
183 const sensor_msgs::ImageConstPtr& imageMsg,
184 const sensor_msgs::ImageConstPtr& depthMsg,
185 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg)
187 nav_msgs::OdometryConstPtr odomMsg;
188 sensor_msgs::LaserScanConstPtr scanMsg;
189 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
190 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
193 void CommonDataSubscriber::depthDataScan2dCallback(
194 const rtabmap_ros::UserDataConstPtr & userDataMsg,
195 const sensor_msgs::ImageConstPtr& imageMsg,
196 const sensor_msgs::ImageConstPtr& depthMsg,
197 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
198 const sensor_msgs::LaserScanConstPtr& scanMsg)
200 nav_msgs::OdometryConstPtr odomMsg;
201 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
202 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
205 void CommonDataSubscriber::depthDataScan3dCallback(
206 const rtabmap_ros::UserDataConstPtr & userDataMsg,
207 const sensor_msgs::ImageConstPtr& imageMsg,
208 const sensor_msgs::ImageConstPtr& depthMsg,
209 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
210 const sensor_msgs::PointCloud2ConstPtr& scanMsg)
212 nav_msgs::OdometryConstPtr odomMsg;
213 sensor_msgs::LaserScanConstPtr scan2dMsg;
214 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
217 void CommonDataSubscriber::depthDataInfoCallback(
218 const rtabmap_ros::UserDataConstPtr & userDataMsg,
219 const sensor_msgs::ImageConstPtr& imageMsg,
220 const sensor_msgs::ImageConstPtr& depthMsg,
221 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
222 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
224 nav_msgs::OdometryConstPtr odomMsg;
225 sensor_msgs::LaserScanConstPtr scan2dMsg;
226 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
229 void CommonDataSubscriber::depthDataScan2dInfoCallback(
230 const rtabmap_ros::UserDataConstPtr & userDataMsg,
231 const sensor_msgs::ImageConstPtr& imageMsg,
232 const sensor_msgs::ImageConstPtr& depthMsg,
233 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
234 const sensor_msgs::LaserScanConstPtr& scanMsg,
235 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
237 nav_msgs::OdometryConstPtr odomMsg;
238 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
241 void CommonDataSubscriber::depthDataScan3dInfoCallback(
242 const rtabmap_ros::UserDataConstPtr & userDataMsg,
243 const sensor_msgs::ImageConstPtr& imageMsg,
244 const sensor_msgs::ImageConstPtr& depthMsg,
245 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
246 const sensor_msgs::PointCloud2ConstPtr& scanMsg,
247 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
249 nav_msgs::OdometryConstPtr odomMsg;
250 sensor_msgs::LaserScanConstPtr scan2dMsg;
255 void CommonDataSubscriber::depthOdomDataCallback(
256 const nav_msgs::OdometryConstPtr & odomMsg,
257 const rtabmap_ros::UserDataConstPtr & userDataMsg,
258 const sensor_msgs::ImageConstPtr& imageMsg,
259 const sensor_msgs::ImageConstPtr& depthMsg,
260 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg)
262 sensor_msgs::LaserScanConstPtr scanMsg;
263 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
264 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
267 void CommonDataSubscriber::depthOdomDataScan2dCallback(
268 const nav_msgs::OdometryConstPtr & odomMsg,
269 const rtabmap_ros::UserDataConstPtr & userDataMsg,
270 const sensor_msgs::ImageConstPtr& imageMsg,
271 const sensor_msgs::ImageConstPtr& depthMsg,
272 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
273 const sensor_msgs::LaserScanConstPtr& scanMsg)
275 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
276 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
279 void CommonDataSubscriber::depthOdomDataScan3dCallback(
280 const nav_msgs::OdometryConstPtr & odomMsg,
281 const rtabmap_ros::UserDataConstPtr & userDataMsg,
282 const sensor_msgs::ImageConstPtr& imageMsg,
283 const sensor_msgs::ImageConstPtr& depthMsg,
284 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
285 const sensor_msgs::PointCloud2ConstPtr& scanMsg)
287 sensor_msgs::LaserScanConstPtr scan2dMsg;
288 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
291 void CommonDataSubscriber::depthOdomDataInfoCallback(
292 const nav_msgs::OdometryConstPtr & odomMsg,
293 const rtabmap_ros::UserDataConstPtr & userDataMsg,
294 const sensor_msgs::ImageConstPtr& imageMsg,
295 const sensor_msgs::ImageConstPtr& depthMsg,
296 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
297 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
299 sensor_msgs::LaserScanConstPtr scan2dMsg;
300 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
303 void CommonDataSubscriber::depthOdomDataScan2dInfoCallback(
304 const nav_msgs::OdometryConstPtr & odomMsg,
305 const rtabmap_ros::UserDataConstPtr & userDataMsg,
306 const sensor_msgs::ImageConstPtr& imageMsg,
307 const sensor_msgs::ImageConstPtr& depthMsg,
308 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
309 const sensor_msgs::LaserScanConstPtr& scanMsg,
310 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
312 sensor_msgs::PointCloud2ConstPtr scan3dMsg;
315 void CommonDataSubscriber::depthOdomDataScan3dInfoCallback(
316 const nav_msgs::OdometryConstPtr & odomMsg,
317 const rtabmap_ros::UserDataConstPtr & userDataMsg,
318 const sensor_msgs::ImageConstPtr& imageMsg,
319 const sensor_msgs::ImageConstPtr& depthMsg,
320 const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
321 const sensor_msgs::PointCloud2ConstPtr& scanMsg,
322 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
324 sensor_msgs::LaserScanConstPtr scan2dMsg;
332 bool subscribeUserData,
333 bool subscribeScan2d,
334 bool subscribeScan3d,
335 bool subscribeOdomInfo,
341 std::string rgbPrefix =
"rgb";
342 std::string depthPrefix =
"depth";
356 if(subscribeOdom && subscribeUserData)
365 if(subscribeOdomInfo)
376 else if(subscribeScan3d)
380 if(subscribeOdomInfo)
391 else if(subscribeOdomInfo)
402 else if(subscribeOdom)
410 if(subscribeOdomInfo)
421 else if(subscribeScan3d)
425 if(subscribeOdomInfo)
436 else if(subscribeOdomInfo)
447 else if(subscribeUserData)
456 if(subscribeOdomInfo)
467 else if(subscribeScan3d)
471 if(subscribeOdomInfo)
482 else if(subscribeOdomInfo)
499 if(subscribeOdomInfo)
510 else if(subscribeScan3d)
514 if(subscribeOdomInfo)
525 else if(subscribeOdomInfo)
CvImageConstPtr toCvShare(const sensor_msgs::ImageConstPtr &source, const std::string &encoding=std::string())
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)
#define SYNC_DECL7(PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2, SUB3, SUB4, SUB5, SUB6)
#define SYNC_DECL5(PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2, SUB3, SUB4)
std::string resolveName(const std::string &name, bool remap=true) const
#define SYNC_DECL3(PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2)
message_filters::Subscriber< rtabmap_ros::UserData > userDataSub_
bool subscribedToOdomInfo_
#define SYNC_DECL6(PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2, SUB3, SUB4, SUB5)
message_filters::Subscriber< rtabmap_ros::OdomInfo > odomInfoSub_
image_transport::SubscriberFilter imageDepthSub_
image_transport::SubscriberFilter imageSub_
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_
void subscribe(ImageTransport &it, const std::string &base_topic, uint32_t queue_size, const TransportHints &transport_hints=TransportHints())
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)
message_filters::Subscriber< sensor_msgs::CameraInfo > cameraInfoSub_
void setupDepthCallbacks(ros::NodeHandle &nh, ros::NodeHandle &pnh, bool subscribeOdom, bool subscribeUserData, bool subscribeScan2d, bool subscribeScan3d, bool subscribeOdomInfo, int queueSize, bool approxSync)