capture_stereo_synchronizer.h
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 /*********************************************************************
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2014, JSK Lab
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of the JSK Lab nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *********************************************************************/
35 
36 #ifndef JSK_PCL_ROS_CAPTURE_STEREO_SYNCHRONIZER_H_
37 #define JSK_PCL_ROS_CAPTURE_STEREO_SYNCHRONIZER_H_
38 
39 
40 
41 
42 #include <ros/ros.h>
46 #include <jsk_topic_tools/diagnostic_nodelet.h>
47 
48 #include <sensor_msgs/Image.h>
49 #include <sensor_msgs/CameraInfo.h>
50 #include <stereo_msgs/DisparityImage.h>
51 #include <geometry_msgs/PoseStamped.h>
52 #include <pcl_msgs/PointIndices.h>
54 
55 namespace jsk_pcl_ros
56 {
57  class CaptureStereoSynchronizer: public jsk_topic_tools::DiagnosticNodelet
58  {
59  public:
62  geometry_msgs::PoseStamped, // pose of checker board
63  sensor_msgs::Image, // mask image
64  pcl_msgs::PointIndices, // mask indices
65  sensor_msgs::Image, // left image rect
66  sensor_msgs::CameraInfo, // left cmaera info
67  sensor_msgs::CameraInfo, // right camera info
68  stereo_msgs::DisparityImage // stereo disparity
69  > SyncPolicy;
70  CaptureStereoSynchronizer(): DiagnosticNodelet("CaptureStereoSynchronizer") { }
72  protected:
74  // methods
76  virtual void onInit();
77  virtual void subscribe();
78  virtual void unsubscribe();
79  virtual void republish(
80  const geometry_msgs::PoseStamped::ConstPtr& pose, // pose of checker board
81  const sensor_msgs::Image::ConstPtr& mask, // mask image
82  const PCLIndicesMsg::ConstPtr& mask_indices, // mask indices
83  const sensor_msgs::Image::ConstPtr& left_image, // left image rect
84  const sensor_msgs::CameraInfo::ConstPtr& left_cam_info, // left cmaera info
85  const sensor_msgs::CameraInfo::ConstPtr& right_cam_info, // right camera info
86  const stereo_msgs::DisparityImage::ConstPtr& disparity // stereo disparity
87  );
88 
89  // check is there near pose or not
90  // if there is a near pose, return true
91  virtual bool checkNearPose(
92  const geometry_msgs::Pose& new_pose);
93 
95  // ROS variables
97  int counter_;
114  std::vector<geometry_msgs::Pose> poses_;
116  // Parameters
118  double rotational_bin_size_;
119  double positional_bin_size_;
120  private:
121 
122  };
123 }
124 #endif
jsk_pcl_ros::CaptureStereoSynchronizer::pub_disparity_
ros::Publisher pub_disparity_
Definition: capture_stereo_synchronizer.h:169
jsk_pcl_ros::CaptureStereoSynchronizer::pub_right_cam_info_
ros::Publisher pub_right_cam_info_
Definition: capture_stereo_synchronizer.h:168
jsk_pcl_ros::CaptureStereoSynchronizer::pub_pose_
ros::Publisher pub_pose_
Definition: capture_stereo_synchronizer.h:163
ros::Publisher
jsk_pcl_ros::CaptureStereoSynchronizer::sub_mask_
message_filters::Subscriber< sensor_msgs::Image > sub_mask_
Definition: capture_stereo_synchronizer.h:171
boost::shared_ptr
jsk_pcl_ros::CaptureStereoSynchronizer::sub_mask_indices_
message_filters::Subscriber< PCLIndicesMsg > sub_mask_indices_
Definition: capture_stereo_synchronizer.h:172
jsk_pcl_ros::CaptureStereoSynchronizer::pub_left_cam_info_
ros::Publisher pub_left_cam_info_
Definition: capture_stereo_synchronizer.h:167
ros.h
jsk_pcl_ros::CaptureStereoSynchronizer::counter_
int counter_
Definition: capture_stereo_synchronizer.h:161
jsk_pcl_ros::CaptureStereoSynchronizer::subscribe
virtual void subscribe()
Definition: capture_stereo_synchronizer_nodelet.cpp:101
time_synchronizer.h
jsk_pcl_ros::CaptureStereoSynchronizer::pub_count_
ros::Publisher pub_count_
Definition: capture_stereo_synchronizer.h:162
message_filters::Subscriber< geometry_msgs::PoseStamped >
jsk_pcl_ros::CaptureStereoSynchronizer::positional_bin_size_
double positional_bin_size_
Definition: capture_stereo_synchronizer.h:183
jsk_pcl_ros::CaptureStereoSynchronizer::sub_disparity_
message_filters::Subscriber< stereo_msgs::DisparityImage > sub_disparity_
Definition: capture_stereo_synchronizer.h:176
jsk_pcl_ros::CaptureStereoSynchronizer::sub_right_cam_info_
message_filters::Subscriber< sensor_msgs::CameraInfo > sub_right_cam_info_
Definition: capture_stereo_synchronizer.h:175
jsk_pcl_ros
Definition: add_color_from_image.h:51
jsk_pcl_ros::CaptureStereoSynchronizer::sync_
boost::shared_ptr< message_filters::Synchronizer< SyncPolicy > > sync_
Definition: capture_stereo_synchronizer.h:177
subscriber.h
jsk_pcl_ros::CaptureStereoSynchronizer::SyncPolicy
message_filters::sync_policies::ExactTime< geometry_msgs::PoseStamped, sensor_msgs::Image, pcl_msgs::PointIndices, sensor_msgs::Image, sensor_msgs::CameraInfo, sensor_msgs::CameraInfo, stereo_msgs::DisparityImage > SyncPolicy
Definition: capture_stereo_synchronizer.h:133
jsk_pcl_ros::CaptureStereoSynchronizer::checkNearPose
virtual bool checkNearPose(const geometry_msgs::Pose &new_pose)
Definition: capture_stereo_synchronizer_nodelet.cpp:79
jsk_pcl_ros::CaptureStereoSynchronizer::CaptureStereoSynchronizer
CaptureStereoSynchronizer()
Definition: capture_stereo_synchronizer.h:134
jsk_pcl_ros::CaptureStereoSynchronizer::unsubscribe
virtual void unsubscribe()
Definition: capture_stereo_synchronizer_nodelet.cpp:129
jsk_pcl_ros::CaptureStereoSynchronizer::pub_mask_
ros::Publisher pub_mask_
Definition: capture_stereo_synchronizer.h:164
pcl_conversion_util.h
jsk_pcl_ros::CaptureStereoSynchronizer::sub_left_cam_info_
message_filters::Subscriber< sensor_msgs::CameraInfo > sub_left_cam_info_
Definition: capture_stereo_synchronizer.h:174
jsk_pcl_ros::CaptureStereoSynchronizer::Ptr
boost::shared_ptr< CaptureStereoSynchronizer > Ptr
Definition: capture_stereo_synchronizer.h:124
jsk_pcl_ros::CaptureStereoSynchronizer::republish
virtual void republish(const geometry_msgs::PoseStamped::ConstPtr &pose, const sensor_msgs::Image::ConstPtr &mask, const PCLIndicesMsg::ConstPtr &mask_indices, const sensor_msgs::Image::ConstPtr &left_image, const sensor_msgs::CameraInfo::ConstPtr &left_cam_info, const sensor_msgs::CameraInfo::ConstPtr &right_cam_info, const stereo_msgs::DisparityImage::ConstPtr &disparity)
Definition: capture_stereo_synchronizer_nodelet.cpp:140
jsk_pcl_ros::CaptureStereoSynchronizer::poses_
std::vector< geometry_msgs::Pose > poses_
Definition: capture_stereo_synchronizer.h:178
jsk_pcl_ros::CaptureStereoSynchronizer::~CaptureStereoSynchronizer
virtual ~CaptureStereoSynchronizer()
Definition: capture_stereo_synchronizer_nodelet.cpp:68
jsk_pcl_ros::CaptureStereoSynchronizer::rotational_bin_size_
double rotational_bin_size_
Definition: capture_stereo_synchronizer.h:182
synchronizer.h
message_filters::sync_policies::ExactTime
jsk_pcl_ros::CaptureStereoSynchronizer::sub_left_image_
message_filters::Subscriber< sensor_msgs::Image > sub_left_image_
Definition: capture_stereo_synchronizer.h:173
jsk_pcl_ros::CaptureStereoSynchronizer::pub_left_image_
ros::Publisher pub_left_image_
Definition: capture_stereo_synchronizer.h:166
jsk_pcl_ros::CaptureStereoSynchronizer::onInit
virtual void onInit()
Definition: capture_stereo_synchronizer_nodelet.cpp:44
jsk_pcl_ros::CaptureStereoSynchronizer::sub_pose_
message_filters::Subscriber< geometry_msgs::PoseStamped > sub_pose_
Definition: capture_stereo_synchronizer.h:170
jsk_pcl_ros::CaptureStereoSynchronizer::pub_mask_indices_
ros::Publisher pub_mask_indices_
Definition: capture_stereo_synchronizer.h:165


jsk_pcl_ros
Author(s): Yohei Kakiuchi
autogenerated on Tue Jan 7 2025 04:05:44