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();
104 std::function<
void (
const float *_frame,
unsigned int _width,
105 unsigned int _height,
unsigned int _depth,
106 const std::string &_format)> _subscriber);
113 const unsigned int _h = 1);
118 const Ogre::Pass *_p,
const Ogre::AutoParamDataSource *_s,
119 const Ogre::LightList *_ll,
bool _supp);
211 private:
virtual void RenderImpl();
218 private:
void UpdateRenderTarget(Ogre::RenderTarget *_target,
219 Ogre::Material *_material,
221 const bool _updateTex =
false);
224 private:
void CreateOrthoCam();
227 private:
void CreateMesh();
230 private:
void CreateCanvas();
240 private: Ogre::Matrix4 BuildScaledOrthoMatrix(
const float _left,
241 const float _right,
const float _bottom,
const float _top,
242 const float _near,
const float _far);
247 private:
virtual void Set1stPassTarget(Ogre::RenderTarget *_target,
248 const unsigned int _index);
252 private:
virtual void Set2ndPassTarget(Ogre::RenderTarget *_target);
289 private: std::unique_ptr<GpuLaserPrivate> dataPtr;
common
Definition FuelModelDatabase.hh:37
rendering
Definition RenderEngine.hh:31
Basic camera sensor.
Definition Camera.hh:86
const Bidirectional iterator for laser data
Definition GpuLaserDataIterator.hh:54
GPU based laser distance sensor.
Definition GpuLaser.hh:60
double FarClip() const
Get far clip.
void SetCameraCount(const unsigned int _cameraCount)
Set the number of cameras required.
double HorzFOV() const
Get the horizontal field of view of the laser sensor.
double HorzHalfAngle() const
Get (horizontal_max_angle + horizontal_min_angle) * 0.5.
event::ConnectionPtr ConnectNewLaserFrame(std::function< void(const float *_frame, unsigned int _width, unsigned int _height, unsigned int _depth, const std::string &_format)> _subscriber)
Connect to a laser frame signal.
double VertFOV() const
Get the vertical field-of-view.
DataIter LaserDataEnd() const
Return an iterator to one past the end of the laser data.
void SetRangeCount(const unsigned int _w, const unsigned int _h=1)
Set the number of samples in the width and height for the first pass texture.
void SetRayCountRatio(const double _rayCountRatio)
Sets the ray count ratio (equivalent to aspect ratio)
virtual void notifyRenderSingleObject(Ogre::Renderable *_rend, const Ogre::Pass *_p, const Ogre::AutoParamDataSource *_s, const Ogre::LightList *_ll, bool _supp)
double hfov
Horizontal field-of-view.
Definition GpuLaser.hh:264
GpuLaser(const std::string &_namePrefix, ScenePtr _scene, const bool _autoRender=true)
Constructor.
double chfov
Cos horizontal field-of-view.
Definition GpuLaser.hh:270
virtual void Fini()
Finalize the camera.
double farClip
Far clip plane.
Definition GpuLaser.hh:279
double CosHorzFOV() const
Get Cos Horz field-of-view.
virtual void Init()
Initialize the camera.
void CreateLaserTexture(const std::string &_textureName)
Create the texture which is used to render laser data.
double vertHalfAngle
Vertical half angle.
Definition GpuLaser.hh:258
void SetCosVertFOV(const double _cvfov)
Set the Cos Horz FOV.
void SetCosHorzFOV(const double _chfov)
Set the Cos Horz FOV.
virtual ~GpuLaser()
Destructor.
void SetNearClip(const double _near)
Set the near clip distance.
double vfov
Vertical field-of-view.
Definition GpuLaser.hh:267
void SetHorzFOV(const double _hfov)
Set the horizontal fov.
virtual void Load()
Load the camera with default parameters.
double VertHalfAngle() const
Get (vertical_max_angle + vertical_min_angle) * 0.5.
double RayCountRatio() const
Get the ray count ratio (equivalent to aspect ratio)
void SetIsHorizontal(const bool _horizontal)
Set sensor horizontal or vertical.
double NearClip() const
Get near clip.
double horzHalfAngle
Horizontal half angle.
Definition GpuLaser.hh:255
unsigned int CameraCount() const
Get the number of cameras required.
double rayCountRatio
Ray count ratio.
Definition GpuLaser.hh:261
void SetFarClip(const double _far)
Set the far clip distance.
void SetHorzHalfAngle(const double _angle)
Set the horizontal half angle.
unsigned int cameraCount
Number of cameras needed to generate the rays.
Definition GpuLaser.hh:285
virtual void Load(sdf::ElementPtr _sdf)
Load the camera with a set of parameters.
double CosVertFOV() const
Get Cos Vert field-of-view.
bool IsHorizontal() const
Gets if sensor is horizontal.
double nearClip
Near clip plane.
Definition GpuLaser.hh:276
DataIter LaserDataBegin() const
Return an iterator to the begining of the laser data.
void SetVertHalfAngle(const double _angle)
Set the vertical half angle.
void SetVertFOV(const double _vfov)
Set the vertical fov.
double cvfov
Cos vertical field-of-view.
Definition GpuLaser.hh:273
bool isHorizontal
True if the sensor is horizontal only.
Definition GpuLaser.hh:282
virtual void PostRender()
Post render.
GpuLaserDataIterator< GpuLaser > DataIter
Constant iterator to access laser data.
Definition GpuLaser.hh:91
Definition JointMaker.hh:40
boost::shared_ptr< Connection > ConnectionPtr
Definition CommonTypes.hh:134
boost::shared_ptr< Scene > ScenePtr
Definition RenderTypes.hh:82
Forward declarations for the common classes.
Definition Animation.hh:27