CameraROS.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef CAMERAROS_H_
29 #define CAMERAROS_H_
30 
31 #include <ros/ros.h>
32 #include <ros/spinner.h>
33 #include <cv_bridge/cv_bridge.h>
34 
38 
41 
42 #include <sensor_msgs/CameraInfo.h>
43 #include <sensor_msgs/Image.h>
44 
45 #include "find_object/Camera.h"
46 #include <QtCore/QStringList>
47 
49  Q_OBJECT
50 public:
51  CameraROS(bool subscribeDepth, QObject * parent = 0);
52  virtual ~CameraROS() {}
53 
54  virtual bool start();
55  virtual void stop();
56 
57  QStringList subscribedTopics() const;
58 
59 Q_SIGNALS:
60  void rosDataReceived(const std::string & frameId,
61  const ros::Time & stamp,
62  const cv::Mat & depth,
63  float depthConstant);
64 
65 private Q_SLOTS:
66  virtual void takeImage();
67 
68 private:
69  void imgReceivedCallback(const sensor_msgs::ImageConstPtr & msg);
71  const sensor_msgs::ImageConstPtr& rgbMsg,
72  const sensor_msgs::ImageConstPtr& depthMsg,
73  const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg);
74 
75 private:
78 
82 
84  sensor_msgs::Image,
85  sensor_msgs::Image,
86  sensor_msgs::CameraInfo> MySyncPolicy;
88 };
89 
90 #endif /* CAMERAROS_H_ */
message_filters::sync_policies::ApproximateTime< sensor_msgs::Image, sensor_msgs::Image, sensor_msgs::CameraInfo > MySyncPolicy
Definition: CameraROS.h:86
void rosDataReceived(const std::string &frameId, const ros::Time &stamp, const cv::Mat &depth, float depthConstant)
message_filters::Subscriber< sensor_msgs::CameraInfo > cameraInfoSub_
Definition: CameraROS.h:81
virtual void takeImage()
Definition: CameraROS.cpp:102
image_transport::SubscriberFilter rgbSub_
Definition: CameraROS.h:79
void imgDepthReceivedCallback(const sensor_msgs::ImageConstPtr &rgbMsg, const sensor_msgs::ImageConstPtr &depthMsg, const sensor_msgs::CameraInfoConstPtr &cameraInfoMsg)
Definition: CameraROS.cpp:132
virtual bool start()
Definition: CameraROS.cpp:91
void imgReceivedCallback(const sensor_msgs::ImageConstPtr &msg)
Definition: CameraROS.cpp:107
image_transport::SubscriberFilter depthSub_
Definition: CameraROS.h:80
message_filters::Synchronizer< MySyncPolicy > * sync_
Definition: CameraROS.h:87
CameraROS(bool subscribeDepth, QObject *parent=0)
Definition: CameraROS.cpp:36
virtual ~CameraROS()
Definition: CameraROS.h:52
image_transport::Subscriber imageSub_
Definition: CameraROS.h:77
bool subscribeDepth_
Definition: CameraROS.h:76
QStringList subscribedTopics() const
Definition: CameraROS.cpp:75
virtual void stop()
Definition: CameraROS.cpp:97


find_object_2d
Author(s): Mathieu Labbe
autogenerated on Thu Jun 6 2019 19:22:26