image_processing_nodelet.h
Go to the documentation of this file.
1 // -*- mode: C++ -*-
2 
3 #ifndef IMAGE_PROCESSING_NODELET_H_
4 #define IMAGE_PROCESSING_NODELET_H_
5 
6 #include <ros/ros.h>
7 #include <nodelet/nodelet.h>
8 #include <sensor_msgs/Image.h>
9 #include <sensor_msgs/CameraInfo.h>
10 
12 #include <opencv2/opencv.hpp>
13 #include <cv_bridge/cv_bridge.h>
14 #include <std_srvs/Empty.h>
15 #include <std_msgs/Empty.h>
16 #if ( CV_MAJOR_VERSION >= 4)
17 #include <opencv2/imgproc/imgproc_c.h>
18 #endif
19 
20 #include <boost/thread/mutex.hpp>
21 #include <boost/foreach.hpp>
22 #include <boost/circular_buffer.hpp>
23 #include <boost/lambda/lambda.hpp>
24 
25 // dynamic reconfigure
26 #include <dynamic_reconfigure/server.h>
30 
32 {
34  {
35  public:
36  protected:
37  //publishser and subscriber
43 
50 
51  sensor_msgs::CameraInfoConstPtr info_msg_;
52 
60  bool use_bytes_;
62  bool verbose_;
65  boost::mutex mutex_;
66 
67  boost::circular_buffer<double> in_times;
68  boost::circular_buffer<double> out_times;
69  boost::circular_buffer<double> in_bytes;
70  boost::circular_buffer<double> out_bytes;
71 
75 
76  virtual void updateDiagnostic(
78  void onInit();
79  void initReconfigure();
80  void initParams();
82  virtual void subscribe();
83  virtual void unsubscribe();
84  public:
86  in_times(boost::circular_buffer<double>(100)),
87  out_times(boost::circular_buffer<double>(100)),
88  in_bytes(boost::circular_buffer<double>(100)),
89  out_bytes(boost::circular_buffer<double>(100)),
90  DiagnosticNodelet("ImageProcessing")
91  { }
93 
94  protected:
95  virtual void process(const sensor_msgs::ImageConstPtr &src_img, const sensor_msgs::CameraInfoConstPtr &src_info,
96  sensor_msgs::ImagePtr &dst_img, sensor_msgs::CameraInfo &dst_info) = 0;
97 
98  void snapshot_msg_cb (const std_msgs::EmptyConstPtr msg);
99 
100  bool snapshot_srv_cb (std_srvs::Empty::Request &req,
101  std_srvs::Empty::Response &res);
102 
103  void image_cb(const sensor_msgs::ImageConstPtr &img);
104  void info_cb(const sensor_msgs::CameraInfoConstPtr &info);
105  void image_nonsync_cb(const sensor_msgs::ImageConstPtr &img);
106  void callback(const sensor_msgs::ImageConstPtr &img,
107  const sensor_msgs::CameraInfoConstPtr &info);
108  };
109 }
110 
111 #endif
msg
void callback(const sensor_msgs::ImageConstPtr &img, const sensor_msgs::CameraInfoConstPtr &info)
jsk_topic_tools::VitalChecker::Ptr info_vital_
img
boost::circular_buffer< double > in_times
bool snapshot_srv_cb(std_srvs::Empty::Request &req, std_srvs::Empty::Response &res)
virtual void process(const sensor_msgs::ImageConstPtr &src_img, const sensor_msgs::CameraInfoConstPtr &src_info, sensor_msgs::ImagePtr &dst_img, sensor_msgs::CameraInfo &dst_info)=0
void image_nonsync_cb(const sensor_msgs::ImageConstPtr &img)
void info_cb(const sensor_msgs::CameraInfoConstPtr &info)
boost::circular_buffer< double > out_times
boost::circular_buffer< double > in_bytes
DiagnosticNodelet(const std::string &name)
jsk_topic_tools::VitalChecker::Ptr image_vital_
void image_cb(const sensor_msgs::ImageConstPtr &img)
virtual void updateDiagnostic(diagnostic_updater::DiagnosticStatusWrapper &stat)
void snapshot_msg_cb(const std_msgs::EmptyConstPtr msg)
jsk_topic_tools::TimeredDiagnosticUpdater::Ptr diagnostic_updater_
boost::circular_buffer< double > out_bytes


resized_image_transport
Author(s): Yohei Kakiuchi
autogenerated on Mon May 3 2021 03:03:39