GpuRaySensor.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_GPURAYSENSOR_HH_
18 #define _GAZEBO_SENSORS_GPURAYSENSOR_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include <ignition/math/Angle.hh>
25 #include <ignition/math/Pose3.hh>
26 
27 #include "gazebo/math/Angle.hh"
28 #include "gazebo/math/Pose.hh"
30 #include "gazebo/sensors/Sensor.hh"
32 #include "gazebo/util/system.hh"
33 
34 namespace gazebo
35 {
38  namespace sensors
39  {
40  // Forward declare private data pointer.
41  class GpuRaySensorPrivate;
42 
46 
53  {
55  public: GpuRaySensor();
56 
58  public: virtual ~GpuRaySensor();
59 
63  public: virtual void Load(const std::string &_worldName,
64  sdf::ElementPtr _sdf);
65 
68  public: virtual void Load(const std::string &_worldName);
69 
71  public: virtual void Init();
72 
73  // Documentation inherited
74  protected: virtual bool UpdateImpl(const bool _force);
75 
77  protected: virtual void Fini();
78 
79  // Documentation inherited
80  public: virtual std::string Topic() const;
81 
85  public: rendering::GpuLaserPtr GetLaserCamera() const
86  GAZEBO_DEPRECATED(7.0);
87 
90  public: rendering::GpuLaserPtr LaserCamera() const;
91 
94  public: ignition::math::Angle AngleMin() const;
95 
98  public: void SetAngleMin(const double _angle);
99 
102  public: ignition::math::Angle AngleMax() const;
103 
106  public: void SetAngleMax(const double _angle);
107 
111  public: double GetAngleResolution() const GAZEBO_DEPRECATED(7.0);
112 
115  public: double AngleResolution() const;
116 
120  public: double GetRangeMin() const GAZEBO_DEPRECATED(7.0);
121 
124  public: double RangeMin() const;
125 
129  public: double GetRangeMax() const GAZEBO_DEPRECATED(7.0);
130 
133  public: double RangeMax() const;
134 
143  public: double GetRangeResolution() const GAZEBO_DEPRECATED(7.0);
144 
152  public: double RangeResolution() const;
153 
157  public: int GetRayCount() const GAZEBO_DEPRECATED(7.0);
158 
161  public: int RayCount() const;
162 
166  public: int GetRangeCount() const GAZEBO_DEPRECATED(7.0);
167 
170  public: int RangeCount() const;
171 
175  public: int GetVerticalRayCount() const GAZEBO_DEPRECATED(7.0);
176 
179  public: int VerticalRayCount() const;
180 
184  public: int GetVerticalRangeCount() const GAZEBO_DEPRECATED(7.0);
185 
188  public: int VerticalRangeCount() const;
189 
192  public: ignition::math::Angle VerticalAngleMin() const;
193 
196  public: void SetVerticalAngleMin(const double _angle);
197 
200  public: ignition::math::Angle VerticalAngleMax() const;
201 
204  public: void SetVerticalAngleMax(const double _angle);
205 
209  public: double GetVerticalAngleResolution() const GAZEBO_DEPRECATED(7.0);
210 
213  public: double VerticalAngleResolution() const;
214 
225  public: double GetRange(int _index) GAZEBO_DEPRECATED(7.0);
226 
236  public: double Range(const int _index) const;
237 
241  public: void GetRanges(std::vector<double> &_ranges)
242  GAZEBO_DEPRECATED(7.0);
243 
246  public: void Ranges(std::vector<double> &_ranges) const;
247 
258  public: double GetRetro(int _index) const GAZEBO_DEPRECATED(7.0);
259 
269  public: double Retro(const int _index) const;
270 
281  public: int GetFiducial(int _index) const GAZEBO_DEPRECATED(7.0);
282 
292  public: int Fiducial(const unsigned int _index) const;
293 
297  public: unsigned int GetCameraCount() const GAZEBO_DEPRECATED(7.0);
298 
301  public: unsigned int CameraCount() const;
302 
305  public: bool IsHorizontal() const;
306 
314  public: double GetRayCountRatio() const GAZEBO_DEPRECATED(7.0);
315 
322  public: double RayCountRatio() const;
323 
331  public: double GetRangeCountRatio() const GAZEBO_DEPRECATED(7.0);
332 
339  public: double RangeCountRatio() const;
340 
344  public: double GetHorzFOV() const GAZEBO_DEPRECATED(7.0);
345 
348  public: double HorzFOV() const;
349 
353  public: double GetCosHorzFOV() const GAZEBO_DEPRECATED(7.0);
354 
357  public: double CosHorzFOV() const;
358 
361  public: double GetVertFOV() const GAZEBO_DEPRECATED(7.0);
362 
365  public: double VertFOV() const;
366 
370  public: double GetCosVertFOV() const GAZEBO_DEPRECATED(7.0);
371 
374  public: double CosVertFOV() const;
375 
379  public: double GetHorzHalfAngle() const GAZEBO_DEPRECATED(7.0);
380 
383  public: double HorzHalfAngle() const;
384 
388  public: double GetVertHalfAngle() const GAZEBO_DEPRECATED(7.0);
389 
392  public: double VertHalfAngle() const;
393 
397  public: event::ConnectionPtr ConnectNewLaserFrame(
398  std::function<void(const float *, unsigned int, unsigned int,
399  unsigned int, const std::string &)> _subscriber);
400 
403  public: void DisconnectNewLaserFrame(event::ConnectionPtr &_conn);
404 
405  // Documentation inherited
406  public: virtual bool IsActive() const;
407 
409  private: void Render();
410 
413  private: std::unique_ptr<GpuRaySensorPrivate> dataPtr;
414  };
416  }
417 }
418 #endif
GPU based laser sensor.
Definition: GpuRaySensor.hh:52
Forward declarations for the common classes.
Definition: Animation.hh:33
boost::shared_ptr< GpuLaser > GpuLaserPtr
Definition: RenderTypes.hh:104
Forward declarations for transport.
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
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