36 #define IMAGE_CONVERSION() \ 38 std::vector<cv_bridge::CvImageConstPtr> imageMsgs(2); \ 39 std::vector<cv_bridge::CvImageConstPtr> depthMsgs(2); \ 40 rtabmap_ros::toCvShare(image1Msg, imageMsgs[0], depthMsgs[0]); \ 41 rtabmap_ros::toCvShare(image2Msg, imageMsgs[1], depthMsgs[1]); \ 42 if(!depthMsgs[0].get()) \ 44 std::vector<sensor_msgs::CameraInfo> cameraInfoMsgs; \ 45 cameraInfoMsgs.push_back(image1Msg->rgb_camera_info); \ 46 cameraInfoMsgs.push_back(image2Msg->rgb_camera_info); \ 47 std::vector<sensor_msgs::CameraInfo> depthCameraInfoMsgs; \ 48 depthCameraInfoMsgs.push_back(image1Msg->depth_camera_info); \ 49 depthCameraInfoMsgs.push_back(image2Msg->depth_camera_info); \ 50 std::vector<rtabmap_ros::GlobalDescriptor> globalDescriptorMsgs; \ 51 std::vector<std::vector<rtabmap_ros::KeyPoint> > localKeyPoints; \ 52 std::vector<std::vector<rtabmap_ros::Point3f> > localPoints3d; \ 53 std::vector<cv::Mat> localDescriptors; \ 54 if(!image1Msg->global_descriptor.data.empty()) \ 55 globalDescriptorMsgs.push_back(image1Msg->global_descriptor); \ 56 if(!image2Msg->global_descriptor.data.empty()) \ 57 globalDescriptorMsgs.push_back(image2Msg->global_descriptor); \ 58 localKeyPoints.push_back(image1Msg->key_points); \ 59 localKeyPoints.push_back(image2Msg->key_points); \ 60 localPoints3d.push_back(image1Msg->points); \ 61 localPoints3d.push_back(image2Msg->points); \ 62 localDescriptors.push_back(rtabmap::uncompressData(image1Msg->descriptors)); \ 63 localDescriptors.push_back(rtabmap::uncompressData(image2Msg->descriptors)); 66 void CommonDataSubscriber::rgbd2Callback(
67 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
68 const rtabmap_ros::RGBDImageConstPtr& image2Msg)
72 nav_msgs::OdometryConstPtr odomMsg;
73 rtabmap_ros::UserDataConstPtr userDataMsg;
74 sensor_msgs::LaserScan scanMsg;
75 sensor_msgs::PointCloud2 scan3dMsg;
76 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
77 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
79 void CommonDataSubscriber::rgbd2Scan2dCallback(
80 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
81 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
82 const sensor_msgs::LaserScanConstPtr& scanMsg)
86 nav_msgs::OdometryConstPtr odomMsg;
87 rtabmap_ros::UserDataConstPtr userDataMsg;
88 sensor_msgs::PointCloud2 scan3dMsg;
89 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
90 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, *scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
92 void CommonDataSubscriber::rgbd2Scan3dCallback(
93 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
94 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
95 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg)
99 nav_msgs::OdometryConstPtr odomMsg;
100 rtabmap_ros::UserDataConstPtr userDataMsg;
101 sensor_msgs::LaserScan scanMsg;
102 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
103 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, *scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
105 void CommonDataSubscriber::rgbd2ScanDescCallback(
106 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
107 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
108 const rtabmap_ros::ScanDescriptorConstPtr& scanDescMsg)
112 nav_msgs::OdometryConstPtr odomMsg;
113 rtabmap_ros::UserDataConstPtr userDataMsg;
114 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
115 if(!scanDescMsg->global_descriptor.data.empty())
117 globalDescriptorMsgs.push_back(scanDescMsg->global_descriptor);
119 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanDescMsg->scan, scanDescMsg->scan_cloud, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
121 void CommonDataSubscriber::rgbd2InfoCallback(
122 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
123 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
124 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
128 nav_msgs::OdometryConstPtr odomMsg;
129 rtabmap_ros::UserDataConstPtr userDataMsg;
130 sensor_msgs::LaserScan scanMsg;
131 sensor_msgs::PointCloud2 scan3dMsg;
132 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
135 void CommonDataSubscriber::rgbd2OdomCallback(
136 const nav_msgs::OdometryConstPtr & odomMsg,
137 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
138 const rtabmap_ros::RGBDImageConstPtr& image2Msg)
142 rtabmap_ros::UserDataConstPtr userDataMsg;
143 sensor_msgs::LaserScan scanMsg;
144 sensor_msgs::PointCloud2 scan3dMsg;
145 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
146 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
148 void CommonDataSubscriber::rgbd2OdomScan2dCallback(
149 const nav_msgs::OdometryConstPtr & odomMsg,
150 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
151 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
152 const sensor_msgs::LaserScanConstPtr& scanMsg)
156 rtabmap_ros::UserDataConstPtr userDataMsg;
157 sensor_msgs::PointCloud2 scan3dMsg;
158 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
159 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, *scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
161 void CommonDataSubscriber::rgbd2OdomScan3dCallback(
162 const nav_msgs::OdometryConstPtr & odomMsg,
163 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
164 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
165 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg)
169 rtabmap_ros::UserDataConstPtr userDataMsg;
170 sensor_msgs::LaserScan scanMsg;
171 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
172 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, *scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
174 void CommonDataSubscriber::rgbd2OdomScanDescCallback(
175 const nav_msgs::OdometryConstPtr & odomMsg,
176 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
177 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
178 const rtabmap_ros::ScanDescriptorConstPtr& scanDescMsg)
182 rtabmap_ros::UserDataConstPtr userDataMsg;
183 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
184 if(!scanDescMsg->global_descriptor.data.empty())
186 globalDescriptorMsgs.push_back(scanDescMsg->global_descriptor);
188 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanDescMsg->scan, scanDescMsg->scan_cloud, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
190 void CommonDataSubscriber::rgbd2OdomInfoCallback(
191 const nav_msgs::OdometryConstPtr & odomMsg,
192 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
193 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
194 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
198 rtabmap_ros::UserDataConstPtr userDataMsg;
199 sensor_msgs::LaserScan scanMsg;
200 sensor_msgs::PointCloud2 scan3dMsg;
201 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
204 #ifdef RTABMAP_SYNC_USER_DATA 206 void CommonDataSubscriber::rgbd2DataCallback(
207 const rtabmap_ros::UserDataConstPtr& userDataMsg,
208 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
209 const rtabmap_ros::RGBDImageConstPtr& image2Msg)
213 nav_msgs::OdometryConstPtr odomMsg;
214 sensor_msgs::LaserScan scanMsg;
215 sensor_msgs::PointCloud2 scan3dMsg;
216 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
217 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
219 void CommonDataSubscriber::rgbd2DataScan2dCallback(
220 const rtabmap_ros::UserDataConstPtr& userDataMsg,
221 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
222 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
223 const sensor_msgs::LaserScanConstPtr& scanMsg)
227 nav_msgs::OdometryConstPtr odomMsg;
228 sensor_msgs::PointCloud2 scan3dMsg;
229 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
230 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, *scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
232 void CommonDataSubscriber::rgbd2DataScan3dCallback(
233 const rtabmap_ros::UserDataConstPtr& userDataMsg,
234 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
235 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
236 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg)
240 nav_msgs::OdometryConstPtr odomMsg;
241 sensor_msgs::LaserScan scanMsg;
242 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
243 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, *scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
245 void CommonDataSubscriber::rgbd2DataScanDescCallback(
246 const rtabmap_ros::UserDataConstPtr& userDataMsg,
247 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
248 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
249 const rtabmap_ros::ScanDescriptorConstPtr& scanDescMsg)
253 nav_msgs::OdometryConstPtr odomMsg;
254 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
255 if(!scanDescMsg->global_descriptor.data.empty())
257 globalDescriptorMsgs.push_back(scanDescMsg->global_descriptor);
259 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanDescMsg->scan, scanDescMsg->scan_cloud, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
261 void CommonDataSubscriber::rgbd2DataInfoCallback(
262 const rtabmap_ros::UserDataConstPtr& userDataMsg,
263 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
264 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
265 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
269 nav_msgs::OdometryConstPtr odomMsg;
270 sensor_msgs::LaserScan scanMsg;
271 sensor_msgs::PointCloud2 scan3dMsg;
272 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
276 void CommonDataSubscriber::rgbd2OdomDataCallback(
277 const nav_msgs::OdometryConstPtr& odomMsg,
278 const rtabmap_ros::UserDataConstPtr& userDataMsg,
279 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
280 const rtabmap_ros::RGBDImageConstPtr& image2Msg)
284 sensor_msgs::LaserScan scanMsg;
285 sensor_msgs::PointCloud2 scan3dMsg;
286 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
287 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
289 void CommonDataSubscriber::rgbd2OdomDataScan2dCallback(
290 const nav_msgs::OdometryConstPtr& odomMsg,
291 const rtabmap_ros::UserDataConstPtr& userDataMsg,
292 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
293 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
294 const sensor_msgs::LaserScanConstPtr& scanMsg)
298 sensor_msgs::PointCloud2 scan3dMsg;
299 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
300 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, *scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
302 void CommonDataSubscriber::rgbd2OdomDataScan3dCallback(
303 const nav_msgs::OdometryConstPtr& odomMsg,
304 const rtabmap_ros::UserDataConstPtr& userDataMsg,
305 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
306 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
307 const sensor_msgs::PointCloud2ConstPtr& scan3dMsg)
311 sensor_msgs::LaserScan scanMsg;
312 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
313 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, *scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
315 void CommonDataSubscriber::rgbd2OdomDataScanDescCallback(
316 const nav_msgs::OdometryConstPtr& odomMsg,
317 const rtabmap_ros::UserDataConstPtr& userDataMsg,
318 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
319 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
320 const rtabmap_ros::ScanDescriptorConstPtr& scanDescMsg)
324 rtabmap_ros::OdomInfoConstPtr odomInfoMsg;
325 if(!scanDescMsg->global_descriptor.data.empty())
327 globalDescriptorMsgs.push_back(scanDescMsg->global_descriptor);
329 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanDescMsg->scan, scanDescMsg->scan_cloud, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
331 void CommonDataSubscriber::rgbd2OdomDataInfoCallback(
332 const nav_msgs::OdometryConstPtr& odomMsg,
333 const rtabmap_ros::UserDataConstPtr& userDataMsg,
334 const rtabmap_ros::RGBDImageConstPtr& image1Msg,
335 const rtabmap_ros::RGBDImageConstPtr& image2Msg,
336 const rtabmap_ros::OdomInfoConstPtr& odomInfoMsg)
340 sensor_msgs::LaserScan scanMsg;
341 sensor_msgs::PointCloud2 scan3dMsg;
342 commonMultiCameraCallback(odomMsg, userDataMsg, imageMsgs, depthMsgs, cameraInfoMsgs, depthCameraInfoMsgs, scanMsg, scan3dMsg, odomInfoMsg, globalDescriptorMsgs, localKeyPoints, localPoints3d, localDescriptors);
346 void CommonDataSubscriber::setupRGBD2Callbacks(
350 bool subscribeUserData,
351 bool subscribeScan2d,
352 bool subscribeScan3d,
353 bool subscribeScanDesc,
354 bool subscribeOdomInfo,
361 for(
int i=0; i<2; ++i)
366 #ifdef RTABMAP_SYNC_USER_DATA 367 if(subscribeOdom && subscribeUserData)
371 if(subscribeScanDesc)
375 if(subscribeOdomInfo)
378 ROS_WARN(
"subscribe_odom_info ignored...");
382 else if(subscribeScan2d)
386 if(subscribeOdomInfo)
389 ROS_WARN(
"subscribe_odom_info ignored...");
393 else if(subscribeScan3d)
397 if(subscribeOdomInfo)
400 ROS_WARN(
"subscribe_odom_info ignored...");
404 else if(subscribeOdomInfo)
420 if(subscribeScanDesc)
424 if(subscribeOdomInfo)
427 ROS_WARN(
"subscribe_odom_info ignored...");
431 else if(subscribeScan2d)
435 if(subscribeOdomInfo)
438 ROS_WARN(
"subscribe_odom_info ignored...");
442 else if(subscribeScan3d)
446 if(subscribeOdomInfo)
449 ROS_WARN(
"subscribe_odom_info ignored...");
453 else if(subscribeOdomInfo)
464 #ifdef RTABMAP_SYNC_USER_DATA 465 else if(subscribeUserData)
468 if(subscribeScanDesc)
472 if(subscribeOdomInfo)
475 ROS_WARN(
"subscribe_odom_info ignored...");
479 else if(subscribeScan2d)
483 if(subscribeOdomInfo)
486 ROS_WARN(
"subscribe_odom_info ignored...");
490 else if(subscribeScan3d)
494 if(subscribeOdomInfo)
497 ROS_WARN(
"subscribe_odom_info ignored...");
501 else if(subscribeOdomInfo)
515 if(subscribeScanDesc)
519 if(subscribeOdomInfo)
522 ROS_WARN(
"subscribe_odom_info ignored...");
526 else if(subscribeScan2d)
530 if(subscribeOdomInfo)
533 ROS_WARN(
"subscribe_odom_info ignored...");
537 else if(subscribeScan3d)
541 if(subscribeOdomInfo)
544 ROS_WARN(
"subscribe_odom_info ignored...");
548 else if(subscribeOdomInfo)
CommonDataSubscriber(bool gui)
std::string uFormat(const char *fmt,...)
#define SYNC_DECL3(CLASS, PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2)
#define IMAGE_CONVERSION()
message_filters::Subscriber< rtabmap_ros::UserData > userDataSub_
bool subscribedToOdomInfo_
message_filters::Subscriber< rtabmap_ros::OdomInfo > odomInfoSub_
#define SYNC_DECL5(CLASS, PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2, SUB3, SUB4)
bool subscribedToScanDescriptor_
message_filters::Subscriber< sensor_msgs::LaserScan > scanSub_
message_filters::Subscriber< rtabmap_ros::ScanDescriptor > scanDescSub_
virtual void commonMultiCameraCallback(const nav_msgs::OdometryConstPtr &odomMsg, const rtabmap_ros::UserDataConstPtr &userDataMsg, const std::vector< cv_bridge::CvImageConstPtr > &imageMsgs, const std::vector< cv_bridge::CvImageConstPtr > &depthMsgs, const std::vector< sensor_msgs::CameraInfo > &cameraInfoMsgs, const std::vector< sensor_msgs::CameraInfo > &depthCameraInfoMsgs, const sensor_msgs::LaserScan &scanMsg, const sensor_msgs::PointCloud2 &scan3dMsg, const rtabmap_ros::OdomInfoConstPtr &odomInfoMsg, const std::vector< rtabmap_ros::GlobalDescriptor > &globalDescriptorMsgs=std::vector< rtabmap_ros::GlobalDescriptor >(), const std::vector< std::vector< rtabmap_ros::KeyPoint > > &localKeyPoints=std::vector< std::vector< rtabmap_ros::KeyPoint > >(), const std::vector< std::vector< rtabmap_ros::Point3f > > &localPoints3d=std::vector< std::vector< rtabmap_ros::Point3f > >(), const std::vector< cv::Mat > &localDescriptors=std::vector< cv::Mat >())=0
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)
std::vector< message_filters::Subscriber< rtabmap_ros::RGBDImage > * > rgbdSubs_
#define SYNC_DECL4(CLASS, PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1, SUB2, SUB3)
#define SYNC_DECL2(CLASS, PREFIX, APPROX, QUEUE_SIZE, SUB0, SUB1)