Ignition Sensors

API Reference

3.1.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 
28 #include <ignition/common/PluginMacros.hh>
29 #include <ignition/common/Time.hh>
30 
31 #include <ignition/msgs.hh>
32 
33 #include <ignition/rendering/ThermalCamera.hh>
34 
35 #include "ignition/sensors/thermal_camera/Export.hh"
37 #include "ignition/sensors/Export.hh"
39 
40 namespace ignition
41 {
42  namespace sensors
43  {
44  // Inline bracket to help doxygen filtering.
45  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
46  // forward declarations
47  class ThermalCameraSensorPrivate;
48 
56  class IGNITION_SENSORS_THERMAL_CAMERA_VISIBLE ThermalCameraSensor
57  : public CameraSensor
58  {
60  public: ThermalCameraSensor();
61 
63  public: virtual ~ThermalCameraSensor();
64 
68  public: virtual bool Load(const sdf::Sensor &_sdf) override;
69 
73  public: virtual bool Load(sdf::ElementPtr _sdf) override;
74 
77  public: virtual bool Init() override;
78 
82  public: virtual bool Update(const common::Time &_now) override;
83 
87  public: virtual rendering::ThermalCameraPtr ThermalCamera();
88 
95  public: void OnNewThermalFrame(const uint16_t *_scan,
96  unsigned int _width, unsigned int _height,
97  unsigned int _channels,
98  const std::string &_format);
99 
108  public: common::ConnectionPtr ConnectImageCallback(
109  std::function<void(const msgs::Image &)> _callback);
110 
113  public: virtual void SetScene(
114  ignition::rendering::ScenePtr _scene) override;
115 
118  public: virtual unsigned int ImageWidth() const override;
119 
122  public: virtual unsigned int ImageHeight() const override;
123 
126  public: virtual void SetAmbientTemperature(float _ambient);
127 
131  public: virtual void SetAmbientTemperatureRange(float _range);
132 
135  public: virtual void SetMinTemperature(float _min);
136 
139  public: virtual void SetMaxTemperature(float _max);
140 
146  public: virtual void SetLinearResolution(float _resolution);
147 
150  private: bool CreateCamera();
151 
155  private: void OnSceneChange(ignition::rendering::ScenePtr /*_scene*/)
156  { }
157 
161  };
162  }
163  }
164 }
165 
166 #endif
Camera Sensor Class.
Definition: CameraSensor.hh:54
STL class.
Thermal camera sensor class.
Definition: ThermalCameraSensor.hh:56
Definition: AirPressureSensor.hh:31