22 #ifndef _RENDERING_CAMERA_HH_
23 #define _RENDERING_CAMERA_HH_
25 #include <boost/enable_shared_from_this.hpp>
42 #include "gazebo/msgs/MessageTypes.hh"
54 class CompositorInstance;
66 class GaussianNoiseCompositorListener;
76 class Camera :
public boost::enable_shared_from_this<Camera>
83 bool _autoRender =
true);
90 public:
virtual void Load(sdf::ElementPtr _sdf);
93 public:
virtual void Load();
96 public:
virtual void Init();
122 public:
virtual void Update();
127 public:
virtual void Fini();
202 public:
void SetImageSize(
unsigned int _w,
unsigned int _h);
246 unsigned int _height,
247 const std::string &_format);
254 public:
double GetZValue(
int _x,
int _y);
279 public:
bool SaveFrame(
const std::string &_filename);
338 public:
virtual const unsigned char *
GetImageData(
unsigned int i = 0);
342 public: std::string
GetName()
const;
346 public:
void SetName(
const std::string &_name);
403 bool _inheritOrientation,
404 double _minDist = 0.0,
double _maxDist = 0.0);
415 bool _inheritOrientation,
416 double _minDist = 0.0,
double _maxDist = 0.0);
420 public:
void TrackVisual(
const std::string &_visualName);
434 public:
template<
typename T>
451 public:
static bool SaveFrame(
const unsigned char *_image,
452 unsigned int _width,
unsigned int _height,
int _depth,
453 const std::string &_format,
454 const std::string &_filename);
471 public:
bool IsVisible(
const std::string &_visualName);
492 boost::function<
void()> _onComplete =
NULL);
524 bool _inheritOrientation,
525 double _minDist = 0,
double _maxDist = 0);
537 bool _inheritOrientation,
538 double _minDist = 0,
double _maxDist = 0);
550 bool _inheritOrientation,
551 double _minDist = 0,
double _maxDist = 0);
568 private:
void ConvertRGBToBAYER(
unsigned char *_dst,
unsigned char *_src,
569 std::string _format,
int _width,
int _height);
572 private:
void SetClipDist();
577 private:
static int GetOgrePixelFormat(
const std::string &_format);
581 private:
void CreateCamera();
587 protected: sdf::ElementPtr
sdf;
654 unsigned int,
unsigned int,
unsigned int,
676 private: sdf::ElementPtr imageElem;
682 private:
static unsigned int cameraCounter;
685 private: Ogre::CompositorInstance *dsGBufferInstance;
688 private: Ogre::CompositorInstance *dsMergeInstance;
691 private: Ogre::CompositorInstance *dlGBufferInstance;
694 private: Ogre::CompositorInstance *dlMergeInstance;
697 private: Ogre::CompositorInstance *ssaoInstance;
700 private: Ogre::CompositorInstance *gaussianNoiseInstance;
703 private: boost::shared_ptr<GaussianNoiseCompositorListener>
704 gaussianNoiseCompositorListener;
707 private: std::deque<std::pair<math::Pose, double> > moveToPositionQueue;
722 private:
enum NoiseModelType
730 private:
bool noiseActive;
733 private:
enum NoiseModelType noiseType;
737 private:
double noiseMean;
741 private:
double noiseStdDev;