Gazebo Sensors

API Reference

6.9.0
gz/sensors/BoundingBoxCameraSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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 
18 #ifndef IGNITION_SENSORS_BOUNDINGBOXCAMERASENSOR_HH_
19 #define IGNITION_SENSORS_BOUNDINGBOXCAMERASENSOR_HH_
20 
21 #include <memory>
22 #include <vector>
23 
24 #include <ignition/rendering/BoundingBoxCamera.hh>
25 #include <sdf/Sensor.hh>
26 
29 
30 namespace ignition
31 {
32  namespace sensors
33  {
34  // Inline bracket to help doxygen filtering.
35  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
36  // forward declarations
37  class BoundingBoxCameraSensorPrivate;
38 
46  class IGNITION_SENSORS_BOUNDINGBOX_CAMERA_VISIBLE
48  {
51 
53  public: virtual ~BoundingBoxCameraSensor();
54 
58  public: virtual bool Load(const sdf::Sensor &_sdf) override;
59 
63  public: virtual bool Load(sdf::ElementPtr _sdf) override;
64 
67  public: virtual bool Init() override;
68 
72  public: virtual bool Update(
73  const std::chrono::steady_clock::duration &_now) override;
74 
77  public: virtual rendering::BoundingBoxCameraPtr
79 
82  public: void OnNewBoundingBoxes(
84 
87  public: virtual void SetScene(
88  ignition::rendering::ScenePtr _scene) override;
89 
92  public: virtual unsigned int ImageWidth() const override;
93 
96  public: virtual unsigned int ImageHeight() const override;
97 
101  public: bool HasConnections() const;
102 
105  private: bool CreateCamera();
106 
107  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
111  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
112  };
113  }
114  }
115 }
116 
117 #endif
BoundingBox camera sensor class.
Definition: gz/sensors/BoundingBoxCameraSensor.hh:48
virtual void SetScene(ignition::rendering::ScenePtr _scene) override
Set the rendering scene.
void OnNewBoundingBoxes(const std::vector< rendering::BoundingBox > &_boxes)
Callback on new bounding boxes from bounding boxes camera.
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 rendering::BoundingBoxCameraPtr BoundingBoxCamera() const
Get the rendering BoundingBox camera.
virtual bool Init() override
Initialize values in the sensor.
bool HasConnections() const
Check if there are any subscribers.
virtual unsigned int ImageWidth() const override
Get image width.
Camera Sensor Class.
Definition: gz/sensors/CameraSensor.hh:72
Definition: gz/sensors/AirPressureSensor.hh:32