BosonCamera.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2019 AutonomouStuff, LLC
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy of this
5  * software and associated documentation files (the “Software”), to deal in the Software
6  * without restriction, including without limitation the rights to use, copy, modify,
7  * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in all copies
11  * or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
15  * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
18  * OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 #ifndef FLIR_BOSON_USB_BOSONCAMERA_H
22 #define FLIR_BOSON_USB_BOSONCAMERA_H
23 
24 // C++ Includes
25 #include <string>
26 
27 // Linux system includes
28 #include <fcntl.h>
29 #include <unistd.h>
30 #include <sys/ioctl.h>
31 #include <asm/types.h>
32 #include <sys/mman.h>
33 #include <sys/types.h>
34 #include <sys/stat.h>
35 #include <linux/videodev2.h>
36 
37 // OpenCV Includes
38 #include <opencv2/opencv.hpp>
39 
40 // ROS Includes
41 #include <ros/ros.h>
42 #include <nodelet/nodelet.h>
43 #include <cv_bridge/cv_bridge.h>
46 
47 #include <sensor_msgs/CameraInfo.h>
48 #include <sensor_msgs/Image.h>
49 
50 namespace flir_boson_usb
51 {
52 
54 {
55  YUV = 0,
56  RAW16 = 1
57 };
58 
60 {
63 };
64 
66 {
67  public:
68  BosonCamera();
69  ~BosonCamera();
70 
71  private:
72  virtual void onInit();
73  void agcBasicLinear(const cv::Mat& input_16,
74  cv::Mat* output_8,
75  const int& height,
76  const int& width);
77  bool openCamera();
78  bool closeCamera();
79  void captureAndPublish(const ros::TimerEvent& evt);
80 
82  std::shared_ptr<camera_info_manager::CameraInfoManager> camera_info;
83  std::shared_ptr<image_transport::ImageTransport> it;
86  sensor_msgs::ImagePtr pub_image;
88  int32_t width, height;
89  int32_t fd;
90  int32_t i;
91  struct v4l2_capability cap;
92  int32_t frame = 0; // First frame number enumeration
93  int8_t thermal_sensor_name[20]; // To store the sensor name
94  struct v4l2_buffer bufferinfo;
95  void* buffer_start;
96 
99 
100  // Default Program options
103  float frame_rate;
107 };
108 
109 } // namespace flir_boson_usb
110 
111 #endif // FLIR_BOSON_USB_BOSONCAMERA_H
void agcBasicLinear(const cv::Mat &input_16, cv::Mat *output_8, const int &height, const int &width)
std::shared_ptr< image_transport::ImageTransport > it
Definition: BosonCamera.h:83
void captureAndPublish(const ros::TimerEvent &evt)
cv_bridge::CvImage cv_img
Definition: BosonCamera.h:85
struct v4l2_buffer bufferinfo
Definition: BosonCamera.h:94
sensor_msgs::ImagePtr pub_image
Definition: BosonCamera.h:86
struct v4l2_capability cap
Definition: BosonCamera.h:91
image_transport::CameraPublisher image_pub
Definition: BosonCamera.h:84
std::shared_ptr< camera_info_manager::CameraInfoManager > camera_info
Definition: BosonCamera.h:82


flir_boson_usb
Author(s): Joe Driscoll , Joshua Whitley
autogenerated on Mon Jul 1 2019 20:02:05