MultiCameraSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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 
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 
64  public: unsigned int GetCameraCount() const GAZEBO_DEPRECATED(7.0);
65 
68  public: unsigned int CameraCount() const;
69 
75  public: rendering::CameraPtr GetCamera(unsigned int _index) const
76  GAZEBO_DEPRECATED(7.0);
77 
83  public: rendering::CameraPtr Camera(const unsigned int _index) const;
84 
90  public: unsigned int GetImageWidth(unsigned int _index) const
91  GAZEBO_DEPRECATED(7.0);
92 
97  public: unsigned int ImageWidth(const unsigned int _index) const;
98 
104  public: unsigned int GetImageHeight(
105  unsigned int _index) const GAZEBO_DEPRECATED(7.0);
106 
111  public: unsigned int ImageHeight(const unsigned int _index) const;
112 
118  public: const unsigned char *GetImageData(unsigned int _index)
119  GAZEBO_DEPRECATED(7.0);
120 
125  public: const unsigned char *ImageData(const unsigned int _index);
126 
131  public: bool SaveFrame(const std::vector<std::string> &_filenames);
132 
133  // Documentation inherited.
134  public: virtual bool IsActive() const;
135 
136  // Documentation inherited.
137  protected: virtual bool UpdateImpl(const bool _force);
138 
139  // Documentation inherited.
140  protected: virtual void Fini();
141 
143  private: void Render();
144 
147  private: std::unique_ptr<MultiCameraSensorPrivate> dataPtr;
148  };
150  }
151 }
152 #endif
Forward declarations for transport.
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
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:50
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:88