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();
97 public:
const float *LaserData()
const;
104 std::function<
void (
const float *_frame,
unsigned int _width,
105 unsigned int _height,
unsigned int _depth,
106 const std::string &_format)> _subscriber);
115 public:
void SetRangeCount(
const unsigned int _w,
116 const unsigned int _h = 1);
120 public:
virtual void notifyRenderSingleObject(Ogre::Renderable *_rend,
121 const Ogre::Pass *_p,
const Ogre::AutoParamDataSource *_s,
122 const Ogre::LightList *_ll,
bool _supp);
131 public:
double HorzHalfAngle()
const;
140 public:
double VertHalfAngle()
const;
144 public:
void SetHorzHalfAngle(
const double _angle);
148 public:
void SetVertHalfAngle(
const double _angle);
152 public:
void SetIsHorizontal(
const bool _horizontal);
156 public:
bool IsHorizontal()
const;
165 public:
double HorzFOV()
const;
174 public:
double CosHorzFOV()
const;
178 public:
void SetCosHorzFOV(
const double _chfov);
187 public:
double VertFOV()
const;
196 public:
double CosVertFOV()
const;
200 public:
void SetCosVertFOV(
const double _cvfov);
209 public:
double NearClip()
const;
218 public:
double FarClip()
const;
222 public:
void SetNearClip(
const double _near);
226 public:
void SetFarClip(
const double _far);
230 public:
void SetHorzFOV(
const double _hfov);
234 public:
void SetVertFOV(
const double _vfov);
243 public:
unsigned int CameraCount()
const;
248 public:
void SetCameraCount(
const unsigned int _cameraCount);
257 public:
double RayCountRatio()
const;
261 public:
void SetRayCountRatio(
const double _rayCountRatio);
264 private:
virtual void RenderImpl();
271 private:
void UpdateRenderTarget(Ogre::RenderTarget *_target,
272 Ogre::Material *_material,
274 const bool _updateTex =
false);
277 private:
void CreateOrthoCam();
280 private:
void CreateMesh();
283 private:
void CreateCanvas();
293 private: Ogre::Matrix4 BuildScaledOrthoMatrix(
const float _left,
294 const float _right,
const float _bottom,
const float _top,
295 const float _near,
const float _far);
300 private:
virtual void Set1stPassTarget(Ogre::RenderTarget *_target,
301 const unsigned int _index);
305 private:
virtual void Set2ndPassTarget(Ogre::RenderTarget *_target);
342 private: std::unique_ptr<GpuLaserPrivate> dataPtr;
Basic camera sensor.
Definition: Camera.hh:85
double farClip
Far clip plane.
Definition: GpuLaser.hh:332
GPU based laser distance sensor.
Definition: GpuLaser.hh:58
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
double vertHalfAngle
Vertical half angle.
Definition: GpuLaser.hh:311
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:80
double nearClip
Near clip plane.
Definition: GpuLaser.hh:329
bool isHorizontal
True if the sensor is horizontal only.
Definition: GpuLaser.hh:335
double hfov
Horizontal field-of-view.
Definition: GpuLaser.hh:317
double vfov
Vertical field-of-view.
Definition: GpuLaser.hh:320
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
double chfov
Cos horizontal field-of-view.
Definition: GpuLaser.hh:323
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
double rayCountRatio
Ray count ratio.
Definition: GpuLaser.hh:314
double horzHalfAngle
Horizontal half angle.
Definition: GpuLaser.hh:308
double cvfov
Cos vertical field-of-view.
Definition: GpuLaser.hh:326
unsigned int cameraCount
Number of cameras needed to generate the rays.
Definition: GpuLaser.hh:338