Gazebo Sensors

API Reference

3.6.0
gz/sensors/GpuLidarSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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 GZ_SENSORS_GPULIDARSENSOR_HH_
18 #define GZ_SENSORS_GPULIDARSENSOR_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include <sdf/sdf.hh>
24 
25 #include <gz/common/SuppressWarning.hh>
26 
27 // TODO(louise) Remove these pragmas once ign-rendering is disabling the
28 // warnings
29 #ifdef _WIN32
30 #pragma warning(push)
31 #pragma warning(disable: 4251)
32 #endif
33 #include <gz/rendering/GpuRays.hh>
34 #ifdef _WIN32
35 #pragma warning(pop)
36 #endif
37 
38 #include "gz/sensors/gpu_lidar/Export.hh"
40 #include "gz/sensors/Lidar.hh"
41 
42 namespace ignition
43 {
44  namespace sensors
45  {
46  // Inline bracket to help doxygen filtering.
47  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
48  //
50  class GpuLidarSensorPrivate;
51 
61  class IGNITION_SENSORS_GPU_LIDAR_VISIBLE GpuLidarSensor : public Lidar
62  {
64  public: GpuLidarSensor();
65 
67  public: virtual ~GpuLidarSensor();
68 
72  public: virtual bool Update(const common::Time &_now) override;
73 
76  public: virtual bool Init() override;
77 
81  public: virtual bool Load(const sdf::Sensor &_sdf) override;
82 
86  public: virtual bool Load(sdf::ElementPtr _sdf) override;
87 
89  public: virtual bool CreateLidar() override;
90 
93  public: bool IsHorizontal() const;
94 
97  public: void SetScene(gz::rendering::ScenePtr _scene) override;
98 
101  public: void RemoveGpuRays(gz::rendering::ScenePtr _scene);
102 
105  public: gz::rendering::GpuRaysPtr GpuRays() const;
106 
113  public: double RayCountRatio() const;
114 
117  public: gz::math::Angle HFOV() const;
118 
121  public: gz::math::Angle VFOV() const;
122 
125  public: virtual gz::common::ConnectionPtr ConnectNewLidarFrame(
126  std::function<void(const float *_scan, unsigned int _width,
127  unsigned int _heighti, unsigned int _channels,
128  const std::string &/*_format*/)> _subscriber) override;
129 
130  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
134  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
135  };
136  }
137  }
138 }
139 
140 #endif
Definition: gz/sensors/AirPressureSensor.hh:32
STL class.
GpuLidar Sensor Class.
Definition: gz/sensors/GpuLidarSensor.hh:61
Lidar Sensor Class.
Definition: gz/sensors/Lidar.hh:49