Gazebo Sensors

API Reference

3.6.0
gz/sensors/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 GZ_SENSORS_THERMALCAMERASENSOR_HH_
18 #define GZ_SENSORS_THERMALCAMERASENSOR_HH_
19 
20 #include <memory>
21 #include <cstdint>
22 #include <string>
23 
24 #include <sdf/sdf.hh>
25 
26 #include <gz/common/Event.hh>
27 #include <gz/common/PluginMacros.hh>
28 #include <gz/common/SuppressWarning.hh>
29 #include <gz/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 <gz/rendering/ThermalCamera.hh>
48 #ifdef _WIN32
49 #pragma warning(pop)
50 #endif
51 
52 #include "gz/sensors/thermal_camera/Export.hh"
54 #include "gz/sensors/Export.hh"
55 #include "gz/sensors/Sensor.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 Update(const common::Time &_now) override;
100 
104  public: virtual rendering::ThermalCameraPtr ThermalCamera();
105 
112  public: void OnNewThermalFrame(const uint16_t *_scan,
113  unsigned int _width, unsigned int _height,
114  unsigned int _channels,
115  const std::string &_format);
116 
125  public: common::ConnectionPtr ConnectImageCallback(
126  std::function<void(const msgs::Image &)> _callback);
127 
130  public: virtual void SetScene(
131  gz::rendering::ScenePtr _scene) override;
132 
135  public: virtual unsigned int ImageWidth() const override;
136 
139  public: virtual unsigned int ImageHeight() const override;
140 
143  public: virtual void SetAmbientTemperature(float _ambient);
144 
148  public: virtual void SetAmbientTemperatureRange(float _range);
149 
152  public: virtual void SetMinTemperature(float _min);
153 
156  public: virtual void SetMaxTemperature(float _max);
157 
163  public: virtual void SetLinearResolution(float _resolution);
164 
167  private: bool CreateCamera();
168 
172  private: void OnSceneChange(gz::rendering::ScenePtr /*_scene*/)
173  { }
174 
175  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
179  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
180  };
181  }
182  }
183 }
184 
185 #endif
Thermal camera sensor class.
Definition: gz/sensors/ThermalCameraSensor.hh:73
Definition: gz/sensors/AirPressureSensor.hh:32
STL class.
Camera Sensor Class.
Definition: gz/sensors/CameraSensor.hh:73