Ignition Sensors

API Reference

3.1.0
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/rendering/GpuRays.hh>
26 
27 #include "ignition/sensors/gpu_lidar/Export.hh"
30 
31 namespace ignition
32 {
33  namespace sensors
34  {
35  // Inline bracket to help doxygen filtering.
36  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
37  //
39  class GpuLidarSensorPrivate;
40 
50  class IGNITION_SENSORS_GPU_LIDAR_VISIBLE GpuLidarSensor : public Lidar
51  {
53  public: GpuLidarSensor();
54 
56  public: virtual ~GpuLidarSensor();
57 
61  public: virtual bool Update(const common::Time &_now) override;
62 
65  public: virtual bool Init() override;
66 
70  public: virtual bool Load(const sdf::Sensor &_sdf) override;
71 
75  public: virtual bool Load(sdf::ElementPtr _sdf) override;
76 
78  public: virtual bool CreateLidar() override;
79 
82  public: bool IsHorizontal() const;
83 
86  public: void SetScene(ignition::rendering::ScenePtr _scene) override;
87 
90  public: void RemoveGpuRays(ignition::rendering::ScenePtr _scene);
91 
94  public: ignition::rendering::GpuRaysPtr GpuRays() const;
95 
102  public: double RayCountRatio() const;
103 
106  public: ignition::math::Angle HFOV() const;
107 
110  public: ignition::math::Angle VFOV() const;
111 
114  public: virtual ignition::common::ConnectionPtr ConnectNewLidarFrame(
115  std::function<void(const float *_scan, unsigned int _width,
116  unsigned int _heighti, unsigned int _channels,
117  const std::string &/*_format*/)> _subscriber) override;
118 
122  };
123  }
124  }
125 }
126 
127 #endif
Lidar Sensor Class.
Definition: Lidar.hh:48
STL class.
GpuLidar Sensor Class.
Definition: GpuLidarSensor.hh:50
Definition: AirPressureSensor.hh:31