RaySensor.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_RAYSENSOR_HH_
18 #define _GAZEBO_SENSORS_RAYSENSOR_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include <ignition/math/Angle.hh>
25 
26 #include "gazebo/sensors/Sensor.hh"
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  class OgreDynamicLines;
32  class Collision;
33  class MultiRayShape;
34 
37  namespace sensors
38  {
39  // Forward declare private data class.
40  class RaySensorPrivate;
41 
44 
52  {
54  public: RaySensor();
55 
57  public: virtual ~RaySensor();
58 
59  // Documentation inherited
60  public: virtual void Load(const std::string &_worldName);
61 
62  // Documentation inherited
63  public: virtual void Init();
64 
65  // Documentation inherited
66  protected: virtual bool UpdateImpl(const bool _force);
67 
68  // Documentation inherited
69  protected: virtual void Fini();
70 
71  // Documentation inherited
72  public: virtual std::string Topic() const;
73 
76  public: ignition::math::Angle AngleMin() const;
77 
80  public: ignition::math::Angle AngleMax() const;
81 
85  public: double GetAngleResolution() const GAZEBO_DEPRECATED(7.0);
86 
89  public: double AngleResolution() const;
90 
94  public: double GetRangeMin() const GAZEBO_DEPRECATED(7.0);
95 
98  public: double RangeMin() const;
99 
103  public: double GetRangeMax() const GAZEBO_DEPRECATED(7.0);
104 
107  public: double RangeMax() const;
108 
112  public: double GetRangeResolution() const GAZEBO_DEPRECATED(7.0);
113 
116  public: double RangeResolution() const;
117 
121  public: int GetRayCount() const GAZEBO_DEPRECATED(7.0);
122 
125  public: int RayCount() const;
126 
130  public: int GetRangeCount() const GAZEBO_DEPRECATED(7.0);
131 
134  public: int RangeCount() const;
135 
139  public: int GetVerticalRayCount() const GAZEBO_DEPRECATED(7.0);
140 
143  public: int VerticalRayCount() const;
144 
148  public: int GetVerticalRangeCount() const GAZEBO_DEPRECATED(7.0);
149 
152  public: int VerticalRangeCount() const;
153 
156  public: ignition::math::Angle VerticalAngleMin() const;
157 
160  public: ignition::math::Angle VerticalAngleMax() const;
161 
165  public: double GetVerticalAngleResolution() const GAZEBO_DEPRECATED(7.0);
166 
169  public: double VerticalAngleResolution() const;
170 
181  public: double GetRange(unsigned int _index) GAZEBO_DEPRECATED(7.0);
182 
192  public: double Range(const unsigned int _index) const;
193 
197  public: void GetRanges(std::vector<double> &_ranges)
198  GAZEBO_DEPRECATED(7.0);
199 
202  public: void Ranges(std::vector<double> &_ranges) const;
203 
214  public: double GetRetro(unsigned int _index) GAZEBO_DEPRECATED(7.0);
215 
225  public: double Retro(const unsigned int _index) const;
226 
237  public: int GetFiducial(unsigned int _index) GAZEBO_DEPRECATED(7.0);
238 
248  public: int Fiducial(const unsigned int _index) const;
249 
253  public: physics::MultiRayShapePtr GetLaserShape()
254  const GAZEBO_DEPRECATED(7.0);
255 
258  public: physics::MultiRayShapePtr LaserShape() const;
259 
260  // Documentation inherited
261  public: virtual bool IsActive() const;
262 
265  private: std::unique_ptr<RaySensorPrivate> dataPtr;
266  };
268  }
269 }
270 
271 #endif
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
boost::shared_ptr< MultiRayShape > MultiRayShapePtr
Definition: PhysicsTypes.hh:153
Sensor with one or more rays.
Definition: RaySensor.hh:51
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Base class for sensors.
Definition: Sensor.hh:50
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59