Ignition Sensors

API Reference

5.0.0
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/PluginMacros.hh>
28 #include <ignition/common/SuppressWarning.hh>
29 #include <ignition/common/Time.hh>
30 
31 #ifdef _WIN32
32 #pragma warning(push)
33 #pragma warning(disable: 4005)
34 #pragma warning(disable: 4251)
35 #endif
36 #include <ignition/msgs.hh>
37 #ifdef _WIN32
38 #pragma warning(pop)
39 #endif
40 
41 // TODO(louise) Remove these pragmas once ign-rendering is disabling the
42 // warnings
43 #ifdef _WIN32
44 #pragma warning(push)
45 #pragma warning(disable: 4251)
46 #endif
47 #include <ignition/rendering/ThermalCamera.hh>
48 #ifdef _WIN32
49 #pragma warning(pop)
50 #endif
51 
52 #include "ignition/sensors/thermal_camera/Export.hh"
54 #include "ignition/sensors/Export.hh"
56 
57 namespace ignition
58 {
59  namespace sensors
60  {
61  // Inline bracket to help doxygen filtering.
62  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
63  // forward declarations
64  class ThermalCameraSensorPrivate;
65 
73  class IGNITION_SENSORS_THERMAL_CAMERA_VISIBLE ThermalCameraSensor
74  : public CameraSensor
75  {
77  public: ThermalCameraSensor();
78 
80  public: virtual ~ThermalCameraSensor();
81 
85  public: virtual bool Load(const sdf::Sensor &_sdf) override;
86 
90  public: virtual bool Load(sdf::ElementPtr _sdf) override;
91 
94  public: virtual bool Init() override;
95 
99  public: virtual bool IGN_DEPRECATED(4) Update(
100  const ignition::common::Time &_now) override;
101 
105  public: virtual bool Update(
106  const std::chrono::steady_clock::duration &_now) override;
107 
111  public: virtual rendering::ThermalCameraPtr ThermalCamera();
112 
119  public: void OnNewThermalFrame(const uint16_t *_scan,
120  unsigned int _width, unsigned int _height,
121  unsigned int _channels,
122  const std::string &_format);
123 
132  public: common::ConnectionPtr ConnectImageCallback(
133  std::function<void(const msgs::Image &)> _callback);
134 
137  public: virtual void SetScene(
138  ignition::rendering::ScenePtr _scene) override;
139 
142  public: virtual unsigned int ImageWidth() const override;
143 
146  public: virtual unsigned int ImageHeight() const override;
147 
150  public: virtual void SetAmbientTemperature(float _ambient);
151 
155  public: virtual void SetAmbientTemperatureRange(float _range);
156 
159  public: virtual void SetMinTemperature(float _min);
160 
163  public: virtual void SetMaxTemperature(float _max);
164 
170  public: virtual void SetLinearResolution(float _resolution);
171 
174  private: bool CreateCamera();
175 
179  private: void OnSceneChange(ignition::rendering::ScenePtr /*_scene*/)
180  { }
181 
182  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
186  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
187  };
188  }
189  }
190 }
191 
192 #endif
Camera Sensor Class.
Definition: CameraSensor.hh:73
STL class.
Thermal camera sensor class.
Definition: ThermalCameraSensor.hh:73
Definition: AirPressureSensor.hh:32