RaySensor.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 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
27#include "gazebo/util/system.hh"
28
29namespace 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
51 class GZ_SENSORS_VISIBLE RaySensor: public Sensor
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
84 public: double AngleResolution() const;
85
88 public: double RangeMin() const;
89
92 public: double RangeMax() const;
93
96 public: double RangeResolution() const;
97
100 public: int RayCount() const;
101
104 public: int RangeCount() const;
105
108 public: int VerticalRayCount() const;
109
112 public: int VerticalRangeCount() const;
113
116 public: ignition::math::Angle VerticalAngleMin() const;
117
120 public: ignition::math::Angle VerticalAngleMax() const;
121
124 public: double VerticalAngleResolution() const;
125
135 public: double Range(const unsigned int _index) const;
136
139 public: void Ranges(std::vector<double> &_ranges) const;
140
150 public: double Retro(const unsigned int _index) const;
151
161 public: int Fiducial(const unsigned int _index) const;
162
166
167 // Documentation inherited
168 public: virtual bool IsActive() const;
169
172 private: std::unique_ptr<RaySensorPrivate> dataPtr;
173 };
175 }
176}
177
178#endif
sensors
Definition SensorManager.hh:35
Sensor with one or more rays.
Definition RaySensor.hh:52
double RangeMax() const
Get the maximum range.
double VerticalAngleResolution() const
Get the vertical angle in radians between each range.
virtual ~RaySensor()
Destructor.
int RayCount() const
Get the ray count.
virtual void Fini()
Finalize the sensor.
ignition::math::Angle AngleMin() const
Get the minimum angle.
virtual void Init()
Initialize the sensor.
int VerticalRangeCount() const
Get the vertical scan line count.
double RangeMin() const
Get the minimum range.
virtual void Load(const std::string &_worldName)
Load the sensor with default parameters.
double RangeResolution() const
Get the range resolution.
int VerticalRayCount() const
Get the vertical scan line count.
physics::MultiRayShapePtr LaserShape() const
Returns a pointer to the internal physics::MultiRayShape.
void Ranges(std::vector< double > &_ranges) const
Get all the ranges.
virtual bool IsActive() const
Returns true if sensor generation is active.
virtual std::string Topic() const
Returns the topic name as set in SDF.
double Range(const unsigned int _index) const
Get detected range for a ray.
double AngleResolution() const
Get the angle in radians between each range.
ignition::math::Angle VerticalAngleMin() const
Get the vertical scan bottom angle.
virtual bool UpdateImpl(const bool _force)
This gets overwritten by derived sensor types.
ignition::math::Angle AngleMax() const
Get the maximum angle.
int Fiducial(const unsigned int _index) const
Get detected fiducial value for a ray.
int RangeCount() const
Get the range count.
double Retro(const unsigned int _index) const
Get detected retro (intensity) value for a ray.
ignition::math::Angle VerticalAngleMax() const
Get the vertical scan line top angle.
Base class for sensors.
Definition Sensor.hh:53
boost::shared_ptr< MultiRayShape > MultiRayShapePtr
Definition PhysicsTypes.hh:153
Forward declarations for the common classes.
Definition Animation.hh:27