uvc_ros.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2012 by Markus Bader *
3  * markus.bader@tuwien.ac.at *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
21 
22 #ifndef V4R_CAM_NODE_H
23 #define V4R_CAM_NODE_H
24 
25 #include <ros/ros.h>
26 #include <tuw_uvc/uvc.h>
27 #include <tuw_uvc/Sphere.h>
28 #include <opencv2/opencv.hpp>
31 #include <sensor_msgs/SetCameraInfo.h>
32 
34 class V4RCamNode : public V4RCam {
35 public:
36  static const int CONVERT_RAW = 0;
37  static const int CONVERT_YUV422toRGB = 1;
38  static const int CONVERT_YUV422toBGR = 2;
39  static const int CONVERT_YUV422toGray = 3;
40 
42  ~V4RCamNode();
43  void publishCamera();
44  void showCameraImage();
45 protected:
51  sensor_msgs::CameraInfo cameraInfo_;
52  sensor_msgs::Image cameraImage_;
53  sensor_msgs::Image cameraThumbnail_;
56  void callbackSphere (const tuw_uvc::SphereConstPtr& msg);
57  bool setCameraInfo(sensor_msgs::SetCameraInfoRequest &req, sensor_msgs::SetCameraInfoResponse &rsp);
63  boost::thread showCameraImageThread_;
64 protected:
65  void readInitParams();
66  void commitRosParamsToV4L(bool force = false);
67  void commitV4LToRosParams();
68  void loopCamera();
71 
76  void readCameraControls();
81  void writeCameraControls();
82 
87  void readControlEntryInfo ( ControlEntry *entry );
92  void updateControlEntry ( ControlEntry *entry );
96  void updateDynamicReconfigureFile ( const char* filename ) const;
97 };
98 
99 #endif // V4R_CAM_NODE_H
bool queueRosParamToV4LCommit_
Definition: uvc_ros.h:61
image_transport::ImageTransport imageTransport_
Definition: uvc_ros.h:48
sensor_msgs::Image cameraImage_
Definition: uvc_ros.h:52
void showCameraImage()
Definition: uvc_ros.cpp:254
void updateDynamicReconfigureFile(const char *filename) const
v4l2 camera abstraction
Definition: uvc.h:40
void readInitParams()
Definition: uvc_ros.cpp:107
bool camera_freeze_
Definition: uvc_ros.h:60
ros::ServiceServer set_camera_info_srv_
Definition: uvc_ros.h:54
image_transport::CameraPublisher cameraPublisher_
Definition: uvc_ros.h:49
void writeCameraControls()
boost::thread showCameraImageThread_
Definition: uvc_ros.h:63
bool setCameraInfo(sensor_msgs::SetCameraInfoRequest &req, sensor_msgs::SetCameraInfoResponse &rsp)
Definition: uvc_ros.cpp:297
ROS camera abstraction.
Definition: uvc_ros.h:34
ros::NodeHandle n_
Definition: uvc_ros.h:46
static const int CONVERT_YUV422toBGR
Definition: uvc_ros.h:38
sensor_msgs::CameraInfo cameraInfo_
Definition: uvc_ros.h:51
static const int CONVERT_YUV422toGray
Definition: uvc_ros.h:39
~V4RCamNode()
Definition: uvc_ros.cpp:39
image_transport::Publisher cameraThumbnailPublisher_
Definition: uvc_ros.h:50
bool showCameraImageThreadActive_
Definition: uvc_ros.h:62
ros::NodeHandle n_param_
Definition: uvc_ros.h:47
static const int CONVERT_RAW
Definition: uvc_ros.h:36
void loopCamera()
ros::Subscriber subSphere_
Definition: uvc_ros.h:55
void commitV4LToRosParams()
Definition: uvc_ros.cpp:92
void readControlEntryInfo(ControlEntry *entry)
bool generate_dynamic_reconfigure_
Definition: uvc_ros.h:58
bool show_camera_image_
Definition: uvc_ros.h:59
int convert_image_
Definition: uvc_ros.h:69
void callbackSphere(const tuw_uvc::SphereConstPtr &msg)
Definition: uvc_ros.cpp:290
void commitRosParamsToV4L(bool force=false)
Definition: uvc_ros.cpp:63
void updateControlEntry(ControlEntry *entry)
sensor_msgs::Image cameraThumbnail_
Definition: uvc_ros.h:53
static const int CONVERT_YUV422toRGB
Definition: uvc_ros.h:37
void readCameraControls()
void publishCamera()
Definition: uvc_ros.cpp:183
V4RCamNode(ros::NodeHandle &n)
Definition: uvc_ros.cpp:45
shared pointer for v4l2 control entries
Definition: uvc.h:52
int ratioThumbnail_
Definition: uvc_ros.h:70


tuw_uvc
Author(s): Markus Bader
autogenerated on Mon Jun 10 2019 15:39:24