MagnetometerSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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 _GAZEBO_SENSORS_MAGNETOMETER_SENSOR_HH_
18 #define _GAZEBO_SENSORS_MAGNETOMETER_SENSOR_HH_
19 
20 #include <string>
21 
22 #include <sdf/sdf.hh>
23 #include <ignition/math/Vector3.hh>
24 
25 #include "gazebo/sensors/Sensor.hh"
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace sensors
32  {
33  // Forward declare private data
34  class MagnetometerSensorPrivate;
35 
38 
41  {
43  public: MagnetometerSensor();
44 
46  public: virtual ~MagnetometerSensor();
47 
48  // Documentation inherited
49  public: virtual void Load(const std::string & _worldName,
50  sdf::ElementPtr _sdf);
51 
52  // Documentation inherited
53  public: virtual void Load(const std::string & _worldName);
54 
55  // Documentation inherited
56  public: virtual void Init();
57 
58  // Documentation inherited
59  public: virtual std::string GetTopic() const;
60 
61  // Documentation inherited
62  protected: virtual bool UpdateImpl(const bool _force);
63 
64  // Documentation inherited
65  public: virtual void Fini();
66 
69  public: ignition::math::Vector3d MagneticField() const;
70 
72  private: std::unique_ptr<MagnetometerSensorPrivate> dataPtr;
73  };
75  }
76 }
77 #endif
MagnetometerSensor to provide magnetic field measurement.
Definition: MagnetometerSensor.hh:40
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Forward declarations and typedefs for sensors.
Base class for sensors.
Definition: Sensor.hh:51
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:58