17 #ifndef _GAZEBO_RENDERING_GPULASER_HH_
18 #define _GAZEBO_RENDERING_GPULASER_HH_
35 class AutoParamDataSource;
50 class GpuLaserPrivate;
58 :
public Camera,
public Ogre::RenderObjectListener
64 public:
GpuLaser(
const std::string &_namePrefix,
65 ScenePtr _scene,
const bool _autoRender =
true);
71 public:
virtual void Load(sdf::ElementPtr _sdf);
74 public:
virtual void Load();
77 public:
virtual void Init();
80 public:
virtual void Fini();
84 public:
void CreateLaserTexture(
const std::string &_textureName);
87 public:
virtual void PostRender();
91 public:
const float *LaserData()
const;
98 std::function<
void (
const float *_frame,
unsigned int _width,
99 unsigned int _height,
unsigned int _depth,
100 const std::string &_format)> _subscriber);
111 public:
void SetRangeCount(
const unsigned int _w,
112 const unsigned int _h = 1);
116 public:
virtual void notifyRenderSingleObject(Ogre::Renderable *_rend,
117 const Ogre::Pass *_p,
const Ogre::AutoParamDataSource *_s,
118 const Ogre::LightList *_ll,
bool _supp);
122 public:
double HorzHalfAngle()
const;
126 public:
double VertHalfAngle()
const;
130 public:
void SetHorzHalfAngle(
const double _angle);
134 public:
void SetVertHalfAngle(
const double _angle);
138 public:
void SetIsHorizontal(
const bool _horizontal);
142 public:
bool IsHorizontal()
const;
146 public:
double HorzFOV()
const;
150 public:
double CosHorzFOV()
const;
154 public:
void SetCosHorzFOV(
const double _chfov);
158 public:
double VertFOV()
const;
162 public:
double CosVertFOV()
const;
166 public:
void SetCosVertFOV(
const double _cvfov);
170 public:
double NearClip()
const;
174 public:
double FarClip()
const;
178 public:
void SetNearClip(
const double _near);
182 public:
void SetFarClip(
const double _far);
186 public:
void SetHorzFOV(
const double _hfov);
190 public:
void SetVertFOV(
const double _vfov);
194 public:
unsigned int CameraCount()
const;
199 public:
void SetCameraCount(
const unsigned int _cameraCount);
203 public:
double RayCountRatio()
const;
207 public:
void SetRayCountRatio(
const double _rayCountRatio);
210 private:
virtual void RenderImpl();
217 private:
void UpdateRenderTarget(Ogre::RenderTarget *_target,
218 Ogre::Material *_material,
220 const bool _updateTex =
false);
223 private:
void CreateOrthoCam();
226 private:
void CreateMesh();
229 private:
void CreateCanvas();
239 private: Ogre::Matrix4 BuildScaledOrthoMatrix(
const float _left,
240 const float _right,
const float _bottom,
const float _top,
241 const float _near,
const float _far);
246 private:
virtual void Set1stPassTarget(Ogre::RenderTarget *_target,
247 const unsigned int _index);
251 private:
virtual void Set2ndPassTarget(Ogre::RenderTarget *_target);
288 private: std::unique_ptr<GpuLaserPrivate> dataPtr;
Basic camera sensor.
Definition: Camera.hh:85
double farClip
Far clip plane.
Definition: GpuLaser.hh:278
GPU based laser distance sensor.
Definition: GpuLaser.hh:57
double vertHalfAngle
Vertical half angle.
Definition: GpuLaser.hh:257
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:81
double nearClip
Near clip plane.
Definition: GpuLaser.hh:275
bool isHorizontal
True if the sensor is horizontal only.
Definition: GpuLaser.hh:281
double hfov
Horizontal field-of-view.
Definition: GpuLaser.hh:263
double vfov
Vertical field-of-view.
Definition: GpuLaser.hh:266
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
double chfov
Cos horizontal field-of-view.
Definition: GpuLaser.hh:269
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
double rayCountRatio
Ray count ratio.
Definition: GpuLaser.hh:260
double horzHalfAngle
Horizontal half angle.
Definition: GpuLaser.hh:254
double cvfov
Cos vertical field-of-view.
Definition: GpuLaser.hh:272
unsigned int cameraCount
Number of cameras needed to generate the rays.
Definition: GpuLaser.hh:284