17 #ifndef _GAZEBO_RENDERING_GPULASER_HH_
18 #define _GAZEBO_RENDERING_GPULASER_HH_
36 class AutoParamDataSource;
51 class GpuLaserPrivate;
59 :
public Camera,
public Ogre::RenderObjectListener
65 public:
GpuLaser(
const std::string &_namePrefix,
66 ScenePtr _scene,
const bool _autoRender =
true);
72 public:
virtual void Load(sdf::ElementPtr _sdf);
75 public:
virtual void Load();
78 public:
virtual void Init();
81 public:
virtual void Fini();
85 public:
void CreateLaserTexture(
const std::string &_textureName);
88 public:
virtual void PostRender();
99 public:
DataIter LaserDataBegin()
const;
102 public:
DataIter LaserDataEnd()
const;
109 std::function<
void (
const float *_frame,
unsigned int _width,
110 unsigned int _height,
unsigned int _depth,
111 const std::string &_format)> _subscriber);
116 public:
void SetRangeCount(
const unsigned int _w,
117 const unsigned int _h = 1);
121 public:
virtual void notifyRenderSingleObject(Ogre::Renderable *_rend,
122 const Ogre::Pass *_p,
const Ogre::AutoParamDataSource *_s,
123 const Ogre::LightList *_ll,
bool _supp);
127 public:
double HorzHalfAngle()
const;
131 public:
double VertHalfAngle()
const;
135 public:
void SetHorzHalfAngle(
const double _angle);
139 public:
void SetVertHalfAngle(
const double _angle);
143 public:
void SetIsHorizontal(
const bool _horizontal);
147 public:
bool IsHorizontal()
const;
151 public:
double HorzFOV()
const;
155 public:
double CosHorzFOV()
const;
159 public:
void SetCosHorzFOV(
const double _chfov);
163 public:
double VertFOV()
const;
167 public:
double CosVertFOV()
const;
171 public:
void SetCosVertFOV(
const double _cvfov);
175 public:
double NearClip()
const;
179 public:
double FarClip()
const;
183 public:
void SetNearClip(
const double _near);
187 public:
void SetFarClip(
const double _far);
191 public:
void SetHorzFOV(
const double _hfov);
195 public:
void SetVertFOV(
const double _vfov);
199 public:
unsigned int CameraCount()
const;
204 public:
void SetCameraCount(
const unsigned int _cameraCount);
208 public:
double RayCountRatio()
const;
212 public:
void SetRayCountRatio(
const double _rayCountRatio);
215 private:
virtual void RenderImpl();
222 private:
void UpdateRenderTarget(Ogre::RenderTarget *_target,
223 Ogre::Material *_material,
225 const bool _updateTex =
false);
228 private:
void CreateOrthoCam();
231 private:
void CreateMesh();
234 private:
void CreateCanvas();
244 private: Ogre::Matrix4 BuildScaledOrthoMatrix(
const float _left,
245 const float _right,
const float _bottom,
const float _top,
246 const float _near,
const float _far);
251 private:
virtual void Set1stPassTarget(Ogre::RenderTarget *_target,
252 const unsigned int _index);
256 private:
virtual void Set2ndPassTarget(Ogre::RenderTarget *_target);
293 private: std::unique_ptr<GpuLaserPrivate> dataPtr;
Basic camera sensor.
Definition: Camera.hh:81
double farClip
Far clip plane.
Definition: GpuLaser.hh:283
GPU based laser distance sensor.
Definition: GpuLaser.hh:58
double vertHalfAngle
Vertical half angle.
Definition: GpuLaser.hh:262
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
double nearClip
Near clip plane.
Definition: GpuLaser.hh:280
GpuLaserDataIterator< GpuLaser > DataIter
Constant iterator to access laser data.
Definition: GpuLaser.hh:96
bool isHorizontal
True if the sensor is horizontal only.
Definition: GpuLaser.hh:286
double hfov
Horizontal field-of-view.
Definition: GpuLaser.hh:268
double vfov
Vertical field-of-view.
Definition: GpuLaser.hh:271
const Bidirectional iterator for laser data
Definition: GpuLaserDataIterator.hh:53
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
double chfov
Cos horizontal field-of-view.
Definition: GpuLaser.hh:274
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:328
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
double rayCountRatio
Ray count ratio.
Definition: GpuLaser.hh:265
double horzHalfAngle
Horizontal half angle.
Definition: GpuLaser.hh:259
double cvfov
Cos vertical field-of-view.
Definition: GpuLaser.hh:277
unsigned int cameraCount
Number of cameras needed to generate the rays.
Definition: GpuLaser.hh:289