##

MultiCameraSensor.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_SENSORS_MULTICAMERASENSOR_HH_
#define _GAZEBO_SENSORS_MULTICAMERASENSOR_HH_
#include <memory>
#include <string>
#include <vector>
#include "gazebo/msgs/MessageTypes.hh"
#include "gazebo/rendering/RenderTypes.hh"
#include "gazebo/sensors/Sensor.hh"
#include "gazebo/transport/TransportTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace sensors
{
// Forward declare private data class.
class MultiCameraSensorPrivate;
class GZ_SENSORS_VISIBLE MultiCameraSensor : public Sensor
{
public: MultiCameraSensor();
public: virtual ~MultiCameraSensor();
// Documentation inherited
public: virtual void Load(const std::string &_worldName);
// Documentation inherited
public: virtual void Init();
// Documentation inherited
public: virtual std::string Topic() const;
public: unsigned int CameraCount() const;
public: rendering::CameraPtr Camera(const unsigned int _index) const;
public: unsigned int ImageWidth(const unsigned int _index) const;
public: unsigned int ImageHeight(const unsigned int _index) const;
public: const unsigned char *ImageData(const unsigned int _index);
public: bool SaveFrame(const std::vector<std::string> &_filenames);
// Documentation inherited.
public: virtual bool IsActive() const;
// Documentation inherited.
protected: virtual bool UpdateImpl(const bool _force);
// Documentation inherited.
protected: virtual void Fini();
private: void Render();
private: std::unique_ptr<MultiCameraSensorPrivate> dataPtr;
};
}
}
#endif
gazebo::sensors::MultiCameraSensor::SaveFrame
bool SaveFrame(const std::vector< std::string > &_filenames)
Saves the camera image(s) to the disk.
gazebo::sensors::MultiCameraSensor::IsActive
virtual bool IsActive() const
Returns true if sensor generation is active.
gazebo::sensors::MultiCameraSensor::~MultiCameraSensor
virtual ~MultiCameraSensor()
Destructor.
gazebo::sensors::MultiCameraSensor::ImageWidth
unsigned int ImageWidth(const unsigned int _index) const
Gets the width of the image in pixels.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
sensors
sensors
Definition: SensorManager.hh:35
TransportTypes.hh
Forward declarations for transport.
system.hh
gazebo::sensors::MultiCameraSensor::Load
virtual void Load(const std::string &_worldName)
Load the sensor with default parameters.
gazebo::sensors::MultiCameraSensor::UpdateImpl
virtual bool UpdateImpl(const bool _force)
This gets overwritten by derived sensor types.
gazebo::sensors::MultiCameraSensor::Init
virtual void Init()
Initialize the sensor.
Sensor.hh
RenderTypes.hh
gazebo::sensors::MultiCameraSensor::MultiCameraSensor
MultiCameraSensor()
Constructor.
gazebo::sensors::MultiCameraSensor::Camera
rendering::CameraPtr Camera(const unsigned int _index) const
Returns a pointer to a rendering::Camera.
gazebo::sensors::MultiCameraSensor::Topic
virtual std::string Topic() const
Returns the topic name as set in SDF.
gazebo::sensors::MultiCameraSensor::ImageData
const unsigned char * ImageData(const unsigned int _index)
Gets the raw image data from the sensor.
gazebo::sensors::MultiCameraSensor
Multiple camera sensor. This sensor type can create one or more synchronized cameras.
Definition: MultiCameraSensor.hh:44
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::sensors::Sensor
Base class for sensors.
Definition: Sensor.hh:51
gazebo::sensors::MultiCameraSensor::ImageHeight
unsigned int ImageHeight(const unsigned int _index) const
Gets the height of the image in pixels.
gazebo::sensors::MultiCameraSensor::Fini
virtual void Fini()
Finalize the sensor.
gazebo::rendering::CameraPtr
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:90
gazebo::sensors::MultiCameraSensor::CameraCount
unsigned int CameraCount() const
Get the number of cameras.