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();
123 public:
virtual void Update();
128 public:
virtual void Fini();
203 public:
void SetImageSize(
unsigned int _w,
unsigned int _h);
247 unsigned int _height,
248 const std::string &_format);
255 public:
double GetZValue(
int _x,
int _y);
280 public:
bool SaveFrame(
const std::string &_filename);
339 public:
virtual const unsigned char *
GetImageData(
unsigned int i = 0);
343 public: std::string
GetName()
const;
347 public:
void SetName(
const std::string &_name);
404 bool _inheritOrientation,
405 double _minDist = 0.0,
double _maxDist = 0.0);
416 bool _inheritOrientation,
417 double _minDist = 0.0,
double _maxDist = 0.0);
421 public:
void TrackVisual(
const std::string &_visualName);
435 public:
template<
typename T>
452 public:
static bool SaveFrame(
const unsigned char *_image,
453 unsigned int _width,
unsigned int _height,
int _depth,
454 const std::string &_format,
455 const std::string &_filename);
472 public:
bool IsVisible(
const std::string &_visualName);
493 boost::function<
void()> _onComplete =
NULL);
525 bool _inheritOrientation,
526 double _minDist = 0,
double _maxDist = 0);
538 bool _inheritOrientation,
539 double _minDist = 0,
double _maxDist = 0);
551 bool _inheritOrientation,
552 double _minDist = 0,
double _maxDist = 0);
569 private:
void ConvertRGBToBAYER(
unsigned char *_dst,
unsigned char *_src,
570 std::string _format,
int _width,
int _height);
573 private:
void SetClipDist();
578 private:
static int GetOgrePixelFormat(
const std::string &_format);
582 private:
void CreateCamera();
588 protected: sdf::ElementPtr
sdf;
655 unsigned int,
unsigned int,
unsigned int,
677 private: sdf::ElementPtr imageElem;
683 private:
static unsigned int cameraCounter;
686 private: Ogre::CompositorInstance *dsGBufferInstance;
689 private: Ogre::CompositorInstance *dsMergeInstance;
692 private: Ogre::CompositorInstance *dlGBufferInstance;
695 private: Ogre::CompositorInstance *dlMergeInstance;
698 private: Ogre::CompositorInstance *ssaoInstance;
701 private: Ogre::CompositorInstance *gaussianNoiseInstance;
704 private: boost::shared_ptr<GaussianNoiseCompositorListener>
705 gaussianNoiseCompositorListener;
708 private: std::deque<std::pair<math::Pose, double> > moveToPositionQueue;
723 private:
enum NoiseModelType
731 private:
bool noiseActive;
734 private:
enum NoiseModelType noiseType;
738 private:
double noiseMean;
742 private:
double noiseStdDev;
751 public:
void Render(
bool _force);