Lidar.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2019 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 SDF_LIDAR_HH_
18 #define SDF_LIDAR_HH_
19 
20 #include <sdf/Error.hh>
21 #include <sdf/Element.hh>
22 #include <sdf/Noise.hh>
23 #include <sdf/sdf_config.h>
24 
25 #include <ignition/math/Angle.hh>
26 
27 namespace sdf
28 {
29  // Inline bracket to help doxygen filtering.
30  inline namespace SDF_VERSION_NAMESPACE {
31  //
32  class LidarPrivate;
33 
105  {
107  public: Lidar();
108 
111  public: Lidar(const Lidar &_lidar);
112 
115  public: Lidar(Lidar &&_lidar) noexcept;
116 
118  public: ~Lidar();
119 
123  public: Lidar &operator=(const Lidar &_lidar);
124 
128  public: Lidar &operator=(Lidar &&_lidar) noexcept;
129 
136  public: Errors Load(ElementPtr _sdf);
137 
142  public: sdf::ElementPtr Element() const;
143 
147  public: unsigned int HorizontalScanSamples() const;
148 
152  public: void SetHorizontalScanSamples(unsigned int _samples);
153 
156  public: double HorizontalScanResolution() const;
157 
160  public: void SetHorizontalScanResolution(double _res);
161 
164  public: ignition::math::Angle HorizontalScanMinAngle() const;
165 
168  public: void SetHorizontalScanMinAngle(const ignition::math::Angle &_min);
169 
172  public: ignition::math::Angle HorizontalScanMaxAngle() const;
173 
176  public: void SetHorizontalScanMaxAngle(const ignition::math::Angle &_max);
177 
181  public: unsigned int VerticalScanSamples() const;
182 
186  public: void SetVerticalScanSamples(unsigned int _samples);
187 
190  public: double VerticalScanResolution() const;
191 
194  public: void SetVerticalScanResolution(double _res);
195 
198  public: ignition::math::Angle VerticalScanMinAngle() const;
199 
202  public: void SetVerticalScanMinAngle(const ignition::math::Angle &_min);
203 
206  public: ignition::math::Angle VerticalScanMaxAngle() const;
207 
210  public: void SetVerticalScanMaxAngle(const ignition::math::Angle &_max);
211 
214  public: double RangeMin() const;
215 
218  public: void SetRangeMin(double _min);
219 
222  public: double RangeMax() const;
223 
226  public: void SetRangeMax(double _max);
227 
230  public: double RangeResolution() const;
231 
234  public: void SetRangeResolution(double _range);
235 
238  public: const Noise &LidarNoise() const;
239 
242  public: void SetLidarNoise(const Noise &_noise);
243 
247  public: bool operator==(const Lidar &_lidar) const;
248 
253  public: bool operator!=(const Lidar &_lidar) const;
254 
256  private: LidarPrivate *dataPtr;
257  };
258  }
259 }
260 #endif
sdf::v9::Lidar::SetVerticalScanMinAngle
void SetVerticalScanMinAngle(const ignition::math::Angle &_min)
Set the minimum angle for vertical scan.
sdf::v9::Lidar::HorizontalScanMaxAngle
ignition::math::Angle HorizontalScanMaxAngle() const
Get the maximum angle for horizontal scan.
sdf::v9::Lidar::VerticalScanMaxAngle
ignition::math::Angle VerticalScanMaxAngle() const
Get the maximum angle for vertical scan.
Error.hh
Noise.hh
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:33
sdf::v9::Lidar::SetRangeMin
void SetRangeMin(double _min)
Set minimum distance for each lidar ray.
sdf::v9::Lidar::SetLidarNoise
void SetLidarNoise(const Noise &_noise)
\biref Set the noise values for the lidar sensor.
sdf::v9::Lidar::Lidar
Lidar()
Default constructor.
sdf::v9::Lidar::Lidar
Lidar(const Lidar &_lidar)
Copy constructor.
sdf::v9::Lidar::VerticalScanSamples
unsigned int VerticalScanSamples() const
Get the number of lidar rays vertically to generate per laser sweep.
sdf::v9::Lidar::Lidar
Lidar(Lidar &&_lidar) noexcept
Move constructor.
sdf::v9::Lidar::Load
Errors Load(ElementPtr _sdf)
Load the lidar based on an element pointer.
sdf::v9::Lidar::RangeResolution
double RangeResolution() const
Get linear resolution of each lidar ray.
sdf::v9::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:89
sdf::v9::Lidar::Element
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
sdf::v9::Lidar::LidarNoise
const Noise & LidarNoise() const
Get the noise values for the lidar sensor.
sdf::v9::Lidar::SetRangeResolution
void SetRangeResolution(double _range)
Set linear resolution of each lidar ray.
sdf::v9::Lidar::VerticalScanResolution
double VerticalScanResolution() const
Get the resolution for vertical scan.
sdf::v9::Lidar::VerticalScanMinAngle
ignition::math::Angle VerticalScanMinAngle() const
Get the minimum angle for vertical scan.
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48
sdf::v9::Lidar::operator=
Lidar & operator=(Lidar &&_lidar) noexcept
Move assignment operator.
sdf::v9::Noise
The Noise class contains information about a noise model, such as a Gaussian distribution.
Definition: Noise.hh:50
sdf::v9::Lidar::HorizontalScanResolution
double HorizontalScanResolution() const
Get the resolution for horizontal scan.
sdf::v9::Lidar::SetHorizontalScanMaxAngle
void SetHorizontalScanMaxAngle(const ignition::math::Angle &_max)
Set the maximum angle for horizontal scan.
sdf::v9::Lidar::operator!=
bool operator!=(const Lidar &_lidar) const
Return true this Lidar object does not contain the same values as the passed in parameter.
sdf::v9::Lidar::SetHorizontalScanResolution
void SetHorizontalScanResolution(double _res)
Set the resolution for horizontal scan.
sdf::v9::Lidar::SetRangeMax
void SetRangeMax(double _max)
Set maximum distance for each lidar ray.
sdf::v9::Lidar::SetVerticalScanSamples
void SetVerticalScanSamples(unsigned int _samples)
Set the number of lidar rays vertically to generate per laser sweep.
sdf::v9::Lidar::HorizontalScanSamples
unsigned int HorizontalScanSamples() const
Get the number of lidar rays horizontally to generate per laser sweep.
sdf::v9::Lidar::operator==
bool operator==(const Lidar &_lidar) const
Return true if both Lidar objects contain the same values.
sdf::v9::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
sdf::v9::Lidar::SetVerticalScanMaxAngle
void SetVerticalScanMaxAngle(const ignition::math::Angle &_max)
Set the maximum angle for vertical scan.
sdf::v9::Lidar
Lidar contains information about a Lidar sensor.
Definition: Lidar.hh:105
sdf::v9::Lidar::RangeMin
double RangeMin() const
Get minimum distance for each lidar ray.
sdf::v9::Lidar::~Lidar
~Lidar()
Destructor.
sdf::v9::Lidar::SetVerticalScanResolution
void SetVerticalScanResolution(double _res)
Set the resolution for vertical scan.
sdf::v9::Lidar::SetHorizontalScanSamples
void SetHorizontalScanSamples(unsigned int _samples)
Set the number of lidar rays horizontally to generate per laser sweep.
sdf::v9::Lidar::RangeMax
double RangeMax() const
Get maximum distance for each lidar ray.
sdf::v9::Lidar::operator=
Lidar & operator=(const Lidar &_lidar)
Assignment operator.
sdf::v9::Lidar::SetHorizontalScanMinAngle
void SetHorizontalScanMinAngle(const ignition::math::Angle &_min)
Set the minimum angle for horizontal scan.
sdf::v9::Lidar::HorizontalScanMinAngle
ignition::math::Angle HorizontalScanMinAngle() const
Get the minimum angle for horizontal scan.
Element.hh