All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DepthCameraSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 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 /* Desc: A persepective X11 OpenGL Camera Sensor
18  * Author: Nate Koenig
19  * Date: 15 July 2003
20  */
21 
22 #ifndef _DEPTHCAMERASENSOR_HH_
23 #define _DEPTHCAMERASENSOR_HH_
24 
25 #include <string>
26 
27 #include "gazebo/sensors/Sensor.hh"
28 #include "gazebo/msgs/MessageTypes.hh"
30 #include "gazebo/util/system.hh"
31 
32 namespace gazebo
33 {
36  namespace sensors
37  {
45  {
47  public: DepthCameraSensor();
48 
50  public: virtual ~DepthCameraSensor();
51 
55  protected: virtual void Load(const std::string &_worldName,
56  sdf::ElementPtr _sdf);
57 
60  protected: virtual void Load(const std::string &_worldName);
61 
63  protected: virtual void Init();
64 
65  // Documentation inherited
66  protected: virtual bool UpdateImpl(bool _force);
67 
69  protected: virtual void Fini();
70 
73  public: virtual void SetActive(bool _value);
74 
78  {return this->camera;}
79 
83  public: bool SaveFrame(const std::string &_filename);
84 
86  private: void Render();
87 
89  private: rendering::DepthCameraPtr camera;
90 
92  private: bool rendered;
93  };
95  }
96 }
97 #endif