Gazebo Sensors

API Reference

6.9.0
gz/sensors/LogicalCameraSensor.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_LOGICALCAMERASENSOR_HH_
18 #define GZ_SENSORS_LOGICALCAMERASENSOR_HH_
19 
20 #include <map>
21 #include <memory>
22 #include <string>
23 
24 #include <sdf/sdf.hh>
25 
26 #include <gz/common/SuppressWarning.hh>
27 
28 #include <gz/math/Angle.hh>
29 
30 #ifdef _WIN32
31 #pragma warning(push)
32 #pragma warning(disable: 4005)
33 #pragma warning(disable: 4251)
34 #endif
35 #include <ignition/msgs.hh>
36 #ifdef _WIN32
37 #pragma warning(pop)
38 #endif
39 
40 #include "gz/sensors/config.hh"
41 #include "gz/sensors/Export.hh"
42 #include "gz/sensors/logical_camera/Export.hh"
43 #include "gz/sensors/Sensor.hh"
44 
45 namespace ignition
46 {
47  namespace sensors
48  {
49  // Inline bracket to help doxygen filtering.
50  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
51  //
53  class LogicalCameraSensorPrivate;
54 
60  class IGNITION_SENSORS_LOGICAL_CAMERA_VISIBLE LogicalCameraSensor
61  : public Sensor
62  {
65 
67  public: virtual ~LogicalCameraSensor();
68 
72  public: virtual bool Load(sdf::ElementPtr _sdf) override;
73 
76  public: virtual bool Init() override;
77 
81  public: virtual bool Update(
82  const std::chrono::steady_clock::duration &_now) override;
83 
87  public: double Near() const;
88 
92  public: double Far() const;
93 
97 
102  public: gz::math::Angle HorizontalFOV() const;
103 
107  public: double AspectRatio() const;
108 
112  public: bool HasConnections() const;
113 
117  public: msgs::LogicalCameraImage Image() const;
118 
119  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
123  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
124  };
125  }
126  }
127 }
128 
129 #endif
Logical Camera Sensor Class.
Definition: gz/sensors/LogicalCameraSensor.hh:62
msgs::LogicalCameraImage Image() const
Get the latest image. An image is an instance of msgs::LogicalCameraImage, which contains a list of d...
double AspectRatio() const
Get the aspect ratio, which is the width divided by height of the near or far planes.
double Near() const
Get the near distance. This is the distance from the frustum's vertex to the closest plane.
gz::math::Angle HorizontalFOV() const
Get the horizontal field of view. The field of view is the angle between the frustum's vertex and the...
virtual bool Load(sdf::ElementPtr _sdf) override
Load the sensor with SDF parameters.
virtual bool Update(const std::chrono::steady_clock::duration &_now) override
Force the sensor to generate data.
virtual ~LogicalCameraSensor()
destructor
void SetModelPoses(std::map< std::string, math::Pose3d > &&_models)
Set the models currently in the world.
virtual bool Init() override
Initialize values in the sensor.
bool HasConnections() const
Check if there are any subscribers.
double Far() const
Get the far distance. This is the distance from the frustum's vertex to the farthest plane.
a base sensor class
Definition: gz/sensors/Sensor.hh:60
Definition: gz/sensors/AirPressureSensor.hh:32