MultiCameraSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _GAZEBO_SENSORS_MULTICAMERASENSOR_HH_
18 #define _GAZEBO_SENSORS_MULTICAMERASENSOR_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include "gazebo/msgs/MessageTypes.hh"
26 #include "gazebo/sensors/Sensor.hh"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace sensors
33  {
34  // Forward declare private data class.
35  class MultiCameraSensorPrivate;
36 
40 
44  class GZ_SENSORS_VISIBLE MultiCameraSensor : public Sensor
45  {
47  public: MultiCameraSensor();
48 
50  public: virtual ~MultiCameraSensor();
51 
52  // Documentation inherited
53  public: virtual void Load(const std::string &_worldName);
54 
55  // Documentation inherited
56  public: virtual void Init();
57 
58  // Documentation inherited
59  public: virtual std::string Topic() const;
60 
63  public: unsigned int CameraCount() const;
64 
70  public: rendering::CameraPtr Camera(const unsigned int _index) const;
71 
76  public: unsigned int ImageWidth(const unsigned int _index) const;
77 
82  public: unsigned int ImageHeight(const unsigned int _index) const;
83 
88  public: const unsigned char *ImageData(const unsigned int _index);
89 
94  public: bool SaveFrame(const std::vector<std::string> &_filenames);
95 
96  // Documentation inherited.
97  public: virtual bool IsActive() const;
98 
99  // Documentation inherited.
100  protected: virtual bool UpdateImpl(const bool _force);
101 
102  // Documentation inherited.
103  protected: virtual void Fini();
104 
106  private: void Render();
107 
110  private: std::unique_ptr<MultiCameraSensorPrivate> dataPtr;
111  };
113  }
114 }
115 #endif
Forward declarations for the common classes.
Definition: Animation.hh:26
Forward declarations for transport.
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Multiple camera sensor.
Definition: MultiCameraSensor.hh:44
Base class for sensors.
Definition: Sensor.hh:51
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:90