Gazebo Sensors

API Reference

6.9.0
gz/sensors/AltimeterSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 GZ_SENSORS_ALTIMETERSENSOR_HH_
18 #define GZ_SENSORS_ALTIMETERSENSOR_HH_
19 
20 #include <memory>
21 
22 #include <sdf/sdf.hh>
23 
24 #include <gz/common/SuppressWarning.hh>
25 
26 #include <gz/sensors/config.hh>
27 #include <gz/sensors/altimeter/Export.hh>
28 
29 #include "gz/sensors/Sensor.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 AltimeterSensorPrivate;
40 
45  class IGNITION_SENSORS_ALTIMETER_VISIBLE AltimeterSensor : public Sensor
46  {
48  public: AltimeterSensor();
49 
51  public: virtual ~AltimeterSensor();
52 
56  public: virtual bool Load(const sdf::Sensor &_sdf) override;
57 
61  public: virtual bool Load(sdf::ElementPtr _sdf) override;
62 
65  public: virtual bool Init() override;
66 
70  public: virtual bool Update(
71  const std::chrono::steady_clock::duration &_now) override;
72 
75  public: void SetVerticalReference(double _reference);
76 
79  public: double VerticalReference() const;
80 
83  public: void SetPosition(double _pos);
84 
88  public: double VerticalPosition() const;
89 
92  public: void SetVerticalVelocity(double _vel);
93 
96  public: double VerticalVelocity() const;
97 
101  public: bool HasConnections() const;
102 
103  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
107  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
108  };
109  }
110  }
111 }
112 
113 #endif
Altimeter Sensor Class.
Definition: gz/sensors/AltimeterSensor.hh:46
virtual ~AltimeterSensor()
destructor
virtual bool Load(sdf::ElementPtr _sdf) override
Load the sensor with SDF parameters.
void SetPosition(double _pos)
Set the current z position of the altimeter.
virtual bool Load(const sdf::Sensor &_sdf) override
Load the sensor based on data from an sdf::Sensor object.
virtual bool Update(const std::chrono::steady_clock::duration &_now) override
Update the sensor and generate data.
double VerticalPosition() const
Get the vertical position of the altimeter relative to the reference position.
void SetVerticalVelocity(double _vel)
Set the vertical velocity of the altimeter.
void SetVerticalReference(double _reference)
Set the vertical reference position of the altimeter.
double VerticalVelocity() const
Get the vertical velocity of the altimeter.
double VerticalReference() const
Get the vertical reference position of the altimeter.
virtual bool Init() override
Initialize values in the sensor.
bool HasConnections() const
Check if there are any subscribers.
a base sensor class
Definition: gz/sensors/Sensor.hh:60
Definition: gz/sensors/AirPressureSensor.hh:32