Distortion.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_RENDERING_DISTORTION_HH_
19 #define _GAZEBO_RENDERING_DISTORTION_HH_
20 
21 #include <sdf/sdf.hh>
23 #include "gazebo/util/system.hh"
24 
25 namespace gazebo
26 {
29  namespace rendering
30  {
31  class DistortionPrivate;
32 
35 
39  class GZ_RENDERING_VISIBLE Distortion
40  {
42  public: Distortion();
43 
45  public: virtual ~Distortion();
46 
49  public: virtual void Load(sdf::ElementPtr _sdf);
50 
53  public: void SetCamera(CameraPtr _camera);
54 
58  public: void SetCrop(bool _crop);
59 
62  public: double GetK1() const;
63 
66  public: double GetK2() const;
67 
70  public: double GetK3() const;
71 
74  public: double GetP1() const;
75 
78  public: double GetP2() const;
79 
82  public: math::Vector2d GetCenter() const;
83 
93  public: static math::Vector2d Distort(const math::Vector2d &_in,
94  const math::Vector2d &_center, double _k1, double _k2, double _k3,
95  double _p1, double _p2);
96 
98  protected: sdf::ElementPtr sdf;
99 
102  private: DistortionPrivate *dataPtr;
103  };
105  }
106 }
107 #endif
Generic double x, y vector.
Definition: Vector2d.hh:36
Camera distortion based on Brown's model.
Definition: Distortion.hh:39
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:88
sdf::ElementPtr sdf
Distortion SDF values.
Definition: Distortion.hh:98