Gazebo Rendering

API Reference

7.4.2
gz/rendering/GpuRays.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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_RENDERING_GPURAYS_HH_
18 #define GZ_RENDERING_GPURAYS_HH_
19 
20 #include <string>
21 
22 #include <gz/common/Event.hh>
23 
24 #include "gz/rendering/Image.hh"
25 #include "gz/rendering/Sensor.hh"
26 #include "gz/rendering/Scene.hh"
27 #include "gz/rendering/Camera.hh"
28 
29 namespace gz
30 {
31  namespace rendering
32  {
33  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
34  //
37  class GZ_RENDERING_VISIBLE GpuRays :
38  public virtual Camera
39  {
41  public: typedef std::function<void(const void*, unsigned int,
42  unsigned int, unsigned int, const std::string&)> NewFrameListener;
43 
45  public: virtual ~GpuRays();
46 
49  public: virtual const float *Data() const = 0;
50 
52  public: virtual void Copy(float *_data) = 0;
53 
56  // false to leave data values as +/-inf when out of camera range
57  public: virtual void SetClamp(const bool _clamp) = 0;
58 
61  // false if data values outside of camera range are returned as +/-inf
62  public: virtual bool Clamp() const = 0;
63 
78  public: virtual common::ConnectionPtr ConnectNewGpuRaysFrame(
79  std::function<void(const float *_frame, unsigned int _width,
80  unsigned int _height, unsigned int _depth,
81  const std::string &)> _subscriber) = 0;
82 
85  public: virtual void SetIsHorizontal(const bool _horizontal) = 0;
86 
89  public: virtual bool IsHorizontal() const = 0;
90 
93  public: virtual math::Angle VFOV() const = 0;
94 
97  public: virtual double RayCountRatio() const = 0;
98 
101  public: virtual double RangeCountRatio() const = 0;
102 
105  public: virtual void SetRayCountRatio(const double _rayCountRatio) = 0;
106 
108  // \return minimal horizontal angle value
109  public: virtual gz::math::Angle AngleMin() const = 0;
110 
112  public: virtual void SetAngleMin(double _angle) = 0;
113 
115  // \return maximal horizontal angle value
116  public: virtual gz::math::Angle AngleMax() const = 0;
117 
119  public: virtual void SetAngleMax(double _angle) = 0;
120 
122  // \return horizontal quantity of rays
123  public: virtual int RayCount() const = 0;
124 
126  public: virtual void SetRayCount(int _samples) = 0;
127 
129  // \return horizontal range count
130  public: virtual int RangeCount() const = 0;
131 
133  // \return vertical quantity of rays
134  public: virtual int VerticalRayCount() const = 0;
135 
137  public: virtual void SetVerticalRayCount(int _samples) = 0;
138 
140  // \return Vertical range count
141  public: virtual int VerticalRangeCount() const = 0;
142 
144  // \return minimal vertical angle value
145  public: virtual gz::math::Angle VerticalAngleMin() const = 0;
146 
148  public: virtual void SetVerticalAngleMin(const double _angle) = 0;
149 
151  // \return maximal vertical angle value
152  public: virtual gz::math::Angle VerticalAngleMax() const = 0;
153 
155  // \return minimal vertical angle value
156  public: virtual void SetVerticalAngleMax(const double _angle) = 0;
157 
160  public: virtual unsigned int Channels() const = 0;
161 
169  public: virtual void SetHorizontalResolution(double _resolution) = 0;
170 
176  public: virtual double HorizontalResolution() const = 0;
177 
185  public: virtual void SetVerticalResolution(double _resolution) = 0;
186 
192  public: virtual double VerticalResolution() const = 0;
193  };
194  }
195  }
196 }
197 #endif