Gazebo Rendering

API Reference

3.7.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 ignition
30 {
31  namespace rendering
32  {
33  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
34  //
37  class IGNITION_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  };
162  }
163  }
164 }
165 #endif
virtual void SetVerticalAngleMin(const double _angle)=0
Set minimal vertical angle value.
virtual ~GpuRays()
Destructor.
Definition: gz/rendering/GpuRays.hh:45
STL class.
std::function< void(const void *, unsigned int, unsigned int, unsigned int, const std::string &)> NewFrameListener
Callback function for new frame render event listeners.
Definition: gz/rendering/GpuRays.hh:42
STL class.
virtual void SetAngleMax(double _angle)=0
Set maximal horizontal angle value.
virtual int VerticalRangeCount() const =0
Get vertical range count, i.e. ray count * vert resolution.
virtual gz::math::Angle VerticalAngleMax() const =0
Get maximal vertical angle value.
Posable camera used for rendering the scene graph.
Definition: gz/rendering/Camera.hh:40
virtual void SetClamp(const bool _clamp)=0
Configure behaviour for data values outside of camera range.
virtual double RangeCountRatio() const =0
Get the ray count ratio (equivalent to aspect ratio)
virtual void SetVerticalAngleMax(const double _angle)=0
Set maximal vertical angle value.
virtual gz::math::Angle AngleMin() const =0
Get minimal horizontal angle value.
Generate depth ray data.
Definition: gz/rendering/GpuRays.hh:37
virtual void SetRayCountRatio(const double _rayCountRatio)=0
Sets the ray count ratio (equivalent to aspect ratio)
virtual bool IsHorizontal() const =0
Gets if sensor is horizontal.
virtual void SetIsHorizontal(const bool _horizontal)=0
Set sensor horizontal or vertical.
virtual bool Clamp() const =0
Get behaviour for data values outside of camera range.
virtual int VerticalRayCount() const =0
Get vertical quantity of rays.
virtual gz::math::Angle VerticalAngleMin() const =0
Get minimal vertical angle value.
virtual int RangeCount() const =0
Get hoizontal range count, i.e. ray count * horz resolution.
virtual void SetRayCount(int _samples)=0
Set horizontal quantity of rays.
virtual math::Angle VFOV() const =0
Get the vertical field-of-view.
virtual int RayCount() const =0
Get horizontal quantity of rays.
virtual void Copy(float *_data)=0
Copy to the specified memory direction the gpu rays data.
virtual common::ConnectionPtr ConnectNewGpuRaysFrame(std::function< void(const float *_frame, unsigned int _width, unsigned int _height, unsigned int _depth, const std::string &)> _subscriber)=0
Connect to a gpu rays frame signal.
virtual void SetAngleMin(double _angle)=0
Set minimal horizontal angle value.
virtual const float * Data() const =0
All things needed to get back z buffer for gpu rays data.
virtual double RayCountRatio() const =0
Get the ray count ratio (equivalent to aspect ratio)
virtual void SetVerticalRayCount(int _samples)=0
Set vertical quantity of rays.
virtual gz::math::Angle AngleMax() const =0
Get maximal horizontal angle value.
virtual unsigned int Channels() const =0
Get the number of channels used to store the ray data.