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();
94 public: DataIter LaserDataBegin()
const;
97 public: DataIter LaserDataEnd()
const;
104 std::function<
void (
const float *_frame,
unsigned int _width,
105 unsigned int _height,
unsigned int _depth,
106 const std::string &_format)> _subscriber);
112 public:
void SetRangeCount(
const unsigned int _w,
113 const unsigned int _h = 1);
117 public:
virtual void notifyRenderSingleObject(Ogre::Renderable *_rend,
118 const Ogre::Pass *_p,
const Ogre::AutoParamDataSource *_s,
119 const Ogre::LightList *_ll,
bool _supp);
123 public:
double HorzHalfAngle()
const;
127 public:
double VertHalfAngle()
const;
131 public:
void SetHorzHalfAngle(
const double _angle);
135 public:
void SetVertHalfAngle(
const double _angle);
139 public:
void SetIsHorizontal(
const bool _horizontal);
143 public:
bool IsHorizontal()
const;
147 public:
double HorzFOV()
const;
151 public:
double CosHorzFOV()
const;
155 public:
void SetCosHorzFOV(
const double _chfov);
159 public:
double VertFOV()
const;
163 public:
double CosVertFOV()
const;
167 public:
void SetCosVertFOV(
const double _cvfov);
171 public:
double NearClip()
const;
175 public:
double FarClip()
const;
179 public:
void SetNearClip(
const double _near);
183 public:
void SetFarClip(
const double _far);
187 public:
void SetHorzFOV(
const double _hfov);
191 public:
void SetVertFOV(
const double _vfov);
195 public:
unsigned int CameraCount()
const;
200 public:
void SetCameraCount(
const unsigned int _cameraCount);
204 public:
double RayCountRatio()
const;
208 public:
void SetRayCountRatio(
const double _rayCountRatio);
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;
Basic camera sensor.
Definition: Camera.hh:84
double farClip
Far clip plane.
Definition: GpuLaser.hh:279
GPU based laser distance sensor.
Definition: GpuLaser.hh:58
Forward declarations for the common classes.
Definition: Animation.hh:26
double vertHalfAngle
Vertical half angle.
Definition: GpuLaser.hh:258
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
double nearClip
Near clip plane.
Definition: GpuLaser.hh:276
GpuLaserDataIterator< GpuLaser > DataIter
Constant iterator to access laser data.
Definition: GpuLaser.hh:91
bool isHorizontal
True if the sensor is horizontal only.
Definition: GpuLaser.hh:282
double hfov
Horizontal field-of-view.
Definition: GpuLaser.hh:264
double vfov
Vertical field-of-view.
Definition: GpuLaser.hh:267
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:270
Definition: JointMaker.hh:39
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
double rayCountRatio
Ray count ratio.
Definition: GpuLaser.hh:261
double horzHalfAngle
Horizontal half angle.
Definition: GpuLaser.hh:255
double cvfov
Cos vertical field-of-view.
Definition: GpuLaser.hh:273
unsigned int cameraCount
Number of cameras needed to generate the rays.
Definition: GpuLaser.hh:285