OculusCamera.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-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 
18 #ifndef _GAZEBO_OCULUS_CAMERA_HH_
19 #define _GAZEBO_OCULUS_CAMERA_HH_
20 
21 #include <string>
22 
24 
25 namespace gazebo
26 {
27  namespace rendering
28  {
29  class OculusCameraPrivate;
30 
33 
36  class GZ_RENDERING_VISIBLE OculusCamera : public Camera
37  {
41  public: OculusCamera(const std::string &_name, ScenePtr _scene);
42 
44  public: virtual ~OculusCamera();
45 
48  public: void Load(sdf::ElementPtr _sdf);
49 
51  public: void Load();
52 
54  public: void Init();
55 
57  public: virtual void Update();
58 
60  public: virtual void PostRender();
61 
63  public: void Fini();
64 
68  public: void Resize(unsigned int _w, unsigned int _h);
69 
72  public: void MoveToVisual(VisualPtr _visual);
73 
74  // Doxygen automatically pulls in the correct documentation.
75  public: virtual bool MoveToPosition(const math::Pose &_pose,
76  double _time);
77 
80  public: void MoveToVisual(const std::string &_visualName);
81 
86  public: virtual void SetRenderTarget(Ogre::RenderTarget *_target);
87 
90  public: void AdjustAspect(double _v);
91 
92  // Documentation inherited
93  public: virtual unsigned int GetImageWidth() const;
94 
95  // Documentation inherited
96  public: virtual unsigned int GetImageHeight() const;
97 
99  public: void ResetSensor();
100 
103  public: bool Ready();
104 
105  // Documentation inherited
106  protected: virtual void RenderImpl();
107 
119  protected: virtual bool AttachToVisualImpl(VisualPtr _visual,
120  bool _inheritOrientation, double _minDist = 0,
121  double _maxDist = 0);
122 
128  protected: virtual bool TrackVisualImpl(VisualPtr _visual);
129 
132  private: void OnControl(ConstWorldControlPtr &_data);
133 
135  private: void Oculus();
136 
139  private: OculusCameraPrivate *dataPtr;
140  };
142  }
143 }
144 #endif
Basic camera sensor.
Definition: Camera.hh:85
Forward declarations for the common classes.
Definition: Animation.hh:33
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:80
A camera used for user visualization of a scene.
Definition: OculusCamera.hh:36
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.