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
27#include "gazebo/util/system.hh"
28
29namespace gazebo
30{
31 namespace sensors
32 {
33 // Forward declare private data
34 class MagnetometerSensorPrivate;
35
38
40 class GZ_SENSORS_VISIBLE MagnetometerSensor: public Sensor
41 {
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
sensors
Definition SensorManager.hh:35
Forward declarations and typedefs for sensors.
MagnetometerSensor to provide magnetic field measurement.
Definition MagnetometerSensor.hh:41
virtual void Fini()
Finalize the sensor.
virtual void Init()
Initialize the sensor.
virtual std::string GetTopic() const
virtual void Load(const std::string &_worldName, sdf::ElementPtr _sdf)
Load the sensor with SDF parameters.
virtual void Load(const std::string &_worldName)
Load the sensor with default parameters.
ignition::math::Vector3d MagneticField() const
Accessor for current magnetic field in Tesla.
virtual bool UpdateImpl(const bool _force)
This gets overwritten by derived sensor types.
virtual ~MagnetometerSensor()
Destructor.
Base class for sensors.
Definition Sensor.hh:53
Forward declarations for the common classes.
Definition Animation.hh:27