Gazebo Sensors

API Reference

7.3.1
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/utils/SuppressWarning.hh>
27 
28 #include <gz/math/Angle.hh>
29 
30 #include <gz/msgs/logical_camera_image.pb.h>
31 
32 #include "gz/sensors/config.hh"
33 #include "gz/sensors/Export.hh"
34 #include "gz/sensors/logical_camera/Export.hh"
35 #include "gz/sensors/Sensor.hh"
36 
37 namespace gz
38 {
39  namespace sensors
40  {
41  // Inline bracket to help doxygen filtering.
42  inline namespace GZ_SENSORS_VERSION_NAMESPACE {
43  //
45  class LogicalCameraSensorPrivate;
46 
52  class GZ_SENSORS_LOGICAL_CAMERA_VISIBLE LogicalCameraSensor
53  : public Sensor
54  {
56  public: LogicalCameraSensor();
57 
59  public: virtual ~LogicalCameraSensor();
60 
64  public: virtual bool Load(sdf::ElementPtr _sdf) override;
65 
68  public: virtual bool Init() override;
69 
70  using Sensor::Update;
71 
75  public: virtual bool Update(
76  const std::chrono::steady_clock::duration &_now) override;
77 
81  public: double Near() const;
82 
86  public: double Far() const;
87 
90  public: void SetModelPoses(std::map<std::string, math::Pose3d> &&_models);
91 
96  public: gz::math::Angle HorizontalFOV() const;
97 
101  public: double AspectRatio() const;
102 
105  public: virtual bool HasConnections() const override;
106 
110  public: msgs::LogicalCameraImage Image() const;
111 
112  GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
116  GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
117  };
118  }
119  }
120 }
121 
122 #endif