Gazebo Sensors

API Reference

6.9.0
gz/sensors/RgbdCameraSensor.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_RGBDCAMERASENSOR_HH_
18 #define GZ_SENSORS_RGBDCAMERASENSOR_HH_
19 
20 #include <memory>
21 
22 #include <sdf/sdf.hh>
23 
24 #include <gz/common/SuppressWarning.hh>
25 
27 #include "gz/sensors/config.hh"
28 #include "gz/sensors/rgbd_camera/Export.hh"
29 #include "gz/sensors/Export.hh"
30 
31 namespace ignition
32 {
33  namespace sensors
34  {
35  // Inline bracket to help doxygen filtering.
36  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
37  // forward declarations
38  class RgbdCameraSensorPrivate;
39 
51  class IGNITION_SENSORS_RGBD_CAMERA_VISIBLE RgbdCameraSensor
52  : public CameraSensor
53  {
55  public: RgbdCameraSensor();
56 
58  public: virtual ~RgbdCameraSensor();
59 
63  public: virtual bool Load(const sdf::Sensor &_sdf) override;
64 
68  public: virtual bool Load(sdf::ElementPtr _sdf) override;
69 
72  public: virtual bool Init() override;
73 
77  public: virtual bool Update(
78  const std::chrono::steady_clock::duration &_now) override;
79 
82  public: virtual void SetScene(
83  gz::rendering::ScenePtr _scene) override;
84 
87  public: virtual unsigned int ImageWidth() const override;
88 
91  public: virtual unsigned int ImageHeight() const override;
92 
96  public: bool HasConnections() const;
97 
101  public: bool HasColorConnections() const;
102 
106  public: bool HasDepthConnections() const;
107 
111  public: bool HasPointConnections() const;
112 
115  private: bool CreateCameras();
116 
117  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
121  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
122  };
123  }
124  }
125 }
126 
127 #endif
Camera Sensor Class.
Definition: gz/sensors/CameraSensor.hh:72
RGBD camera sensor class.
Definition: gz/sensors/RgbdCameraSensor.hh:53
virtual void SetScene(gz::rendering::ScenePtr _scene) override
Set the rendering scene.
bool HasColorConnections() const
Check if there are color subscribers.
bool HasDepthConnections() const
Check if there are depth subscribers.
virtual bool Load(sdf::ElementPtr _sdf) override
Load the sensor with SDF parameters.
virtual bool Load(const sdf::Sensor &_sdf) override
Load the sensor based on data from an sdf::Sensor object.
virtual unsigned int ImageHeight() const override
Get image height.
virtual bool Update(const std::chrono::steady_clock::duration &_now) override
Force the sensor to generate data.
virtual bool Init() override
Initialize values in the sensor.
bool HasConnections() const
Check if there are any subscribers.
bool HasPointConnections() const
Check if there are point cloud subscribers.
virtual unsigned int ImageWidth() const override
Get image width.
virtual ~RgbdCameraSensor()
destructor
Definition: gz/sensors/AirPressureSensor.hh:32