Go to the documentation of this file.
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);
117 public:
void SetRangeCount(
const unsigned int _w,
118 const unsigned int _h = 1);
122 public:
virtual void notifyRenderSingleObject(Ogre::Renderable *_rend,
123 const Ogre::Pass *_p,
const Ogre::AutoParamDataSource *_s,
124 const Ogre::LightList *_ll,
bool _supp);
128 public:
double HorzHalfAngle()
const;
132 public:
double VertHalfAngle()
const;
136 public:
void SetHorzHalfAngle(
const double _angle);
140 public:
void SetVertHalfAngle(
const double _angle);
144 public:
void SetIsHorizontal(
const bool _horizontal);
148 public:
bool IsHorizontal()
const;
152 public:
double HorzFOV()
const;
156 public:
double CosHorzFOV()
const;
160 public:
void SetCosHorzFOV(
const double _chfov);
164 public:
double VertFOV()
const;
168 public:
double CosVertFOV()
const;
172 public:
void SetCosVertFOV(
const double _cvfov);
176 public:
double NearClip()
const;
180 public:
double FarClip()
const;
184 public:
void SetNearClip(
const double _near);
188 public:
void SetFarClip(
const double _far);
192 public:
void SetHorzFOV(
const double _hfov);
196 public:
void SetVertFOV(
const double _vfov);
200 public:
unsigned int CameraCount()
const;
205 public:
void SetCameraCount(
const unsigned int _cameraCount);
209 public:
double RayCountRatio()
const;
213 public:
void SetRayCountRatio(
const double _rayCountRatio);
216 private:
virtual void RenderImpl();
223 private:
void UpdateRenderTarget(Ogre::RenderTarget *_target,
224 Ogre::Material *_material,
226 const bool _updateTex =
false);
229 private:
void CreateOrthoCam();
232 private:
void CreateMesh();
235 private:
void CreateCanvas();
245 private: Ogre::Matrix4 BuildScaledOrthoMatrix(
const float _left,
246 const float _right,
const float _bottom,
const float _top,
247 const float _near,
const float _far);
252 private:
virtual void Set1stPassTarget(Ogre::RenderTarget *_target,
253 const unsigned int _index);
257 private:
virtual void Set2ndPassTarget(Ogre::RenderTarget *_target);
294 private: std::unique_ptr<GpuLaserPrivate> dataPtr;
double vfov
Vertical field-of-view.
Definition: GpuLaser.hh:272
Definition: JointMaker.hh:39
void SetVertFOV(const double _vfov)
Set the vertical fov.
virtual void Load()
Load the camera with default parmeters.
double horzHalfAngle
Horizontal half angle.
Definition: GpuLaser.hh:260
Forward declarations for the common classes.
Definition: Animation.hh:26
virtual ~GpuLaser()
Destructor.
double CosVertFOV() const
Get Cos Vert field-of-view.
void SetCosVertFOV(const double _cvfov)
Set the Cos Horz FOV.
void SetIsHorizontal(const bool _horizontal)
Set sensor horizontal or vertical.
void SetHorzFOV(const double _hfov)
Set the horizontal fov.
double NearClip() const
Get near clip.
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.
double hfov
Horizontal field-of-view.
Definition: GpuLaser.hh:269
bool IsHorizontal() const
Gets if sensor is horizontal.
virtual void notifyRenderSingleObject(Ogre::Renderable *_rend, const Ogre::Pass *_p, const Ogre::AutoParamDataSource *_s, const Ogre::LightList *_ll, bool _supp)
void SetNearClip(const double _near)
Set the near clip distance.
void CreateLaserTexture(const std::string &_textureName)
Create the texture which is used to render laser data.
GpuLaser(const std::string &_namePrefix, ScenePtr _scene, const bool _autoRender=true)
Constructor.
double chfov
Cos horizontal field-of-view.
Definition: GpuLaser.hh:275
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.
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
unsigned int CameraCount() const
Get the number of cameras required.
double vertHalfAngle
Vertical half angle.
Definition: GpuLaser.hh:263
double VertFOV() const
Get the vertical field-of-view.
double HorzFOV() const
Get the horizontal field of view of the laser sensor.
GpuLaserDataIterator< GpuLaser > DataIter
Constant iterator to access laser data.
Definition: GpuLaser.hh:96
double VertHalfAngle() const
Get (vertical_max_angle + vertical_min_angle) * 0.5.
void SetVertHalfAngle(const double _angle)
Set the vertical half angle.
virtual void Fini()
Finalize the camera.
virtual void PostRender()
Post render.
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
const float * LaserData() const GAZEBO_DEPRECATED(9.0)
All things needed to get back z buffer for laser data.
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
void SetHorzHalfAngle(const double _angle)
Set the horizontal half angle.
double nearClip
Near clip plane.
Definition: GpuLaser.hh:281
void SetRayCountRatio(const double _rayCountRatio)
Sets the ray count ratio (equivalent to aspect ratio)
bool isHorizontal
True if the sensor is horizontal only.
Definition: GpuLaser.hh:287
double rayCountRatio
Ray count ratio.
Definition: GpuLaser.hh:266
double RayCountRatio() const
Get the ray count ratio (equivalent to aspect ratio)
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:328
double HorzHalfAngle() const
Get (horizontal_max_angle + horizontal_min_angle) * 0.5.
void SetCosHorzFOV(const double _chfov)
Set the Cos Horz FOV.
virtual void Init()
Initialize the camera.
DataIter LaserDataEnd() const
Return an iterator to one past the end of the laser data.
double CosHorzFOV() const
Get Cos Horz field-of-view.
double farClip
Far clip plane.
Definition: GpuLaser.hh:284
Basic camera sensor.
Definition: Camera.hh:81
DataIter LaserDataBegin() const
Return an iterator to the begining of the laser data.
double cvfov
Cos vertical field-of-view.
Definition: GpuLaser.hh:278
const Bidirectional iterator for laser data
Definition: GpuLaserDataIterator.hh:53
double FarClip() const
Get far clip.
void SetCameraCount(const unsigned int _cameraCount)
Set the number of cameras required.
unsigned int cameraCount
Number of cameras needed to generate the rays.
Definition: GpuLaser.hh:290
GPU based laser distance sensor.
Definition: GpuLaser.hh:58
void SetFarClip(const double _far)
Set the far clip distance.