Distortion.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 #ifndef GAZEBO_RENDERING_DISTORTION_HH_
18 #define GAZEBO_RENDERING_DISTORTION_HH_
19 
20 #include <memory>
21 #include <ignition/math/Vector2.hh>
22 
23 #include "gazebo/math/Vector2d.hh"
25 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
31  namespace rendering
32  {
33  class DistortionPrivate;
34 
37 
41  class GZ_RENDERING_VISIBLE Distortion
42  {
44  public: Distortion();
45 
47  public: virtual ~Distortion();
48 
51  public: virtual void Load(sdf::ElementPtr _sdf);
52 
55  public: void SetCamera(CameraPtr _camera);
56 
61  public: void SetCrop(const bool _crop);
62 
67  public: bool Crop() const;
68 
72  public: double GetK1() const GAZEBO_DEPRECATED(8.0);
73 
76  public: double K1() const;
77 
81  public: double GetK2() const GAZEBO_DEPRECATED(8.0);
82 
85  public: double K2() const;
86 
90  public: double GetK3() const GAZEBO_DEPRECATED(8.0);
91 
94  public: double K3() const;
95 
99  public: double GetP1() const GAZEBO_DEPRECATED(8.0);
100 
103  public: double P1() const;
104 
108  public: double GetP2() const GAZEBO_DEPRECATED(8.0);
109 
112  public: double P2() const;
113 
117  public: math::Vector2d GetCenter() const GAZEBO_DEPRECATED(8.0);
118 
121  public: ignition::math::Vector2d Center() const;
122 
134  public: static math::Vector2d Distort(const math::Vector2d &_in,
135  const math::Vector2d &_center, double _k1, double _k2, double _k3,
136  double _p1, double _p2) GAZEBO_DEPRECATED(8.0);
137 
147  public: static ignition::math::Vector2d Distort(
148  const ignition::math::Vector2d &_in,
149  const ignition::math::Vector2d &_center,
150  double _k1, double _k2, double _k3,
151  double _p1, double _p2);
152 
155  private: std::unique_ptr<DistortionPrivate> dataPtr;
156  };
158  }
159 }
160 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
Generic double x, y vector.
Definition: Vector2d.hh:36
Camera distortion based on Brown&#39;s model.
Definition: Distortion.hh:41
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:89