Ignition Sensors

API Reference

6.0.1
ThermalCameraSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef IGNITION_SENSORS_THERMALCAMERASENSOR_HH_
18 #define IGNITION_SENSORS_THERMALCAMERASENSOR_HH_
19 
20 #include <memory>
21 #include <cstdint>
22 #include <string>
23 
24 #include <sdf/sdf.hh>
25 
26 #include <ignition/common/Event.hh>
27 #include <ignition/common/SuppressWarning.hh>
28 
29 #ifdef _WIN32
30 #pragma warning(push)
31 #pragma warning(disable: 4005)
32 #pragma warning(disable: 4251)
33 #endif
34 #include <ignition/msgs.hh>
35 #ifdef _WIN32
36 #pragma warning(pop)
37 #endif
38 
39 // TODO(louise) Remove these pragmas once ign-rendering is disabling the
40 // warnings
41 #ifdef _WIN32
42 #pragma warning(push)
43 #pragma warning(disable: 4251)
44 #endif
45 #include <ignition/rendering/ThermalCamera.hh>
46 #ifdef _WIN32
47 #pragma warning(pop)
48 #endif
49 
50 #include "ignition/sensors/thermal_camera/Export.hh"
52 #include "ignition/sensors/Export.hh"
54 
55 namespace ignition
56 {
57  namespace sensors
58  {
59  // Inline bracket to help doxygen filtering.
60  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
61  // forward declarations
62  class ThermalCameraSensorPrivate;
63 
71  class IGNITION_SENSORS_THERMAL_CAMERA_VISIBLE ThermalCameraSensor
72  : public CameraSensor
73  {
75  public: ThermalCameraSensor();
76 
78  public: virtual ~ThermalCameraSensor();
79 
83  public: virtual bool Load(const sdf::Sensor &_sdf) override;
84 
88  public: virtual bool Load(sdf::ElementPtr _sdf) override;
89 
92  public: virtual bool Init() override;
93 
97  public: virtual bool Update(
98  const std::chrono::steady_clock::duration &_now) override;
99 
103  public: virtual rendering::ThermalCameraPtr ThermalCamera();
104 
111  public: void OnNewThermalFrame(const uint16_t *_scan,
112  unsigned int _width, unsigned int _height,
113  unsigned int _channels,
114  const std::string &_format);
115 
124  public: common::ConnectionPtr ConnectImageCallback(
125  std::function<void(const msgs::Image &)> _callback);
126 
129  public: virtual void SetScene(
130  ignition::rendering::ScenePtr _scene) override;
131 
134  public: virtual unsigned int ImageWidth() const override;
135 
138  public: virtual unsigned int ImageHeight() const override;
139 
142  public: virtual void SetAmbientTemperature(float _ambient);
143 
147  public: virtual void SetAmbientTemperatureRange(float _range);
148 
151  public: virtual void SetMinTemperature(float _min);
152 
155  public: virtual void SetMaxTemperature(float _max);
156 
162  public: virtual void SetLinearResolution(float _resolution);
163 
166  private: bool CreateCamera();
167 
171  private: void OnSceneChange(ignition::rendering::ScenePtr /*_scene*/)
172  { }
173 
174  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
178  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
179  };
180  }
181  }
182 }
183 
184 #endif
Camera Sensor Class.
Definition: CameraSensor.hh:71
STL class.
Thermal camera sensor class.
Definition: ThermalCameraSensor.hh:71
Definition: AirPressureSensor.hh:31