Ignition Sensors

API Reference

6.0.1
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 IGNITION_SENSORS_GPULIDARSENSOR_HH_
18 #define IGNITION_SENSORS_GPULIDARSENSOR_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include <sdf/sdf.hh>
24 
25 #include <ignition/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 <ignition/rendering/GpuRays.hh>
34 #ifdef _WIN32
35 #pragma warning(pop)
36 #endif
37 
38 #include "ignition/sensors/gpu_lidar/Export.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(
73  const std::chrono::steady_clock::duration &_now) override;
74 
77  public: virtual bool Init() override;
78 
82  public: virtual bool Load(const sdf::Sensor &_sdf) override;
83 
87  public: virtual bool Load(sdf::ElementPtr _sdf) override;
88 
90  public: virtual bool CreateLidar() override;
91 
94  public: bool IsHorizontal() const;
95 
98  public: void SetScene(ignition::rendering::ScenePtr _scene) override;
99 
102  public: void RemoveGpuRays(ignition::rendering::ScenePtr _scene);
103 
106  public: ignition::rendering::GpuRaysPtr GpuRays() const;
107 
114  public: double RayCountRatio() const;
115 
118  public: ignition::math::Angle HFOV() const;
119 
122  public: ignition::math::Angle VFOV() const;
123 
126  public: virtual ignition::common::ConnectionPtr ConnectNewLidarFrame(
127  std::function<void(const float *_scan, unsigned int _width,
128  unsigned int _heighti, unsigned int _channels,
129  const std::string &/*_format*/)> _subscriber) override;
130 
131  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
135  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
136  };
137  }
138  }
139 }
140 
141 #endif
Lidar Sensor Class.
Definition: Lidar.hh:49
STL class.
GpuLidar Sensor Class.
Definition: GpuLidarSensor.hh:61
Definition: AirPressureSensor.hh:31