Go to the documentation of this file.
17 #ifndef GAZEBO_SENSORS_CAMERASENSOR_HH_
18 #define GAZEBO_SENSORS_CAMERASENSOR_HH_
22 #include <ignition/transport/Node.hh>
34 class CameraSensorPrivate;
54 public:
virtual void Load(
const std::string &_worldName,
55 sdf::ElementPtr _sdf)
override;
59 public:
virtual void Load(
const std::string &_worldName)
override;
62 public:
virtual void Init()
override;
73 public:
void Update(
bool _force)
override;
81 public:
virtual std::string
Topic()
const override;
116 protected:
virtual bool UpdateImpl(
const bool _force)
override;
119 protected:
virtual void Fini()
override;
145 private: std::unique_ptr<CameraSensorPrivate> dataPtr;
double NextRequiredTimestamp() const override
Return the next timestamp going to be used by the sensor.
Forward declarations for the common classes.
Definition: Animation.hh:27
rendering::CameraPtr Camera() const
Returns a pointer to the rendering::Camera.
virtual std::string Topic() const override
Gets the topic name of the sensor.
unsigned int ImageWidth() const
Gets the width of the image in pixels.
bool NeedsUpdate() override
Return true if the sensor needs to be updated.
sensors
Definition: SensorManager.hh:37
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
Forward declarations for transport.
virtual void Fini() override
Finalize the camera.
virtual bool UpdateImpl(const bool _force) override
This gets overwritten by derived sensor types.
void SetActive(bool _value) override
Set whether the sensor is active or not.
void Update(bool _force) override
Update the sensor.
virtual void Load(const std::string &_worldName, sdf::ElementPtr _sdf) override
Load the sensor with SDF parameters.
void SetRendered(const bool _value)
Set the value of the rendered flag.
CameraSensor()
Constructor.
virtual void Load(const std::string &_worldName) override
Load the sensor with default parameters.
void ResetLastUpdateTime() override
reset timing related members
transport::PublisherPtr imagePub
Publisher of image messages.
Definition: CameraSensor.hh:138
unsigned int ImageHeight() const
Gets the height of the image in pixels.
virtual void Init() override
Initialize the camera.
virtual ~CameraSensor()
Destructor.
virtual bool IsActive() const override
Returns true if sensor generation is active.
Base class for sensors.
Definition: Sensor.hh:53
std::string TopicIgn() const
Gets the ignition topic name of the sensor.
virtual void Render()
Handle the render event.
ignition::transport::Node::Publisher imagePubIgn
Publisher of image messages.
Definition: CameraSensor.hh:141
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:90
bool Rendered() const
Get the value of the rendered flag.
void PrerenderEnded()
Handle the prerenderEnded event.
const unsigned char * ImageData() const
Gets the raw image data from the sensor.
bool SaveFrame(const std::string &_filename)
Saves the image to the disk.
rendering::CameraPtr camera
Pointer to the camera.
Definition: CameraSensor.hh:135
Basic camera sensor.
Definition: CameraSensor.hh:44