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;
Basic camera sensor.
Definition: Camera.hh:81
double farClip
Far clip plane.
Definition: GpuLaser.hh:284
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:263
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
double nearClip
Near clip plane.
Definition: GpuLaser.hh:281
GpuLaserDataIterator< GpuLaser > DataIter
Constant iterator to access laser data.
Definition: GpuLaser.hh:96
bool isHorizontal
True if the sensor is horizontal only.
Definition: GpuLaser.hh:287
double hfov
Horizontal field-of-view.
Definition: GpuLaser.hh:269
double vfov
Vertical field-of-view.
Definition: GpuLaser.hh:272
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:275
Definition: JointMaker.hh:39
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:328
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
double rayCountRatio
Ray count ratio.
Definition: GpuLaser.hh:266
double horzHalfAngle
Horizontal half angle.
Definition: GpuLaser.hh:260
double cvfov
Cos vertical field-of-view.
Definition: GpuLaser.hh:278
unsigned int cameraCount
Number of cameras needed to generate the rays.
Definition: GpuLaser.hh:290