Gazebo Sensors

API Reference

9.0.0
MagnetometerSensor.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_MAGNETOMETERSENSOR_HH_
18#define GZ_SENSORS_MAGNETOMETERSENSOR_HH_
19
20#include <memory>
21
22#include <sdf/sdf.hh>
23
24#include <gz/utils/SuppressWarning.hh>
25#include <gz/math/Pose3.hh>
26
27#include <gz/sensors/config.hh>
28#include <gz/sensors/magnetometer/Export.hh>
29
30#include "gz/sensors/Sensor.hh"
31
32namespace gz
33{
34 namespace sensors
35 {
36 // Inline bracket to help doxygen filtering.
37 inline namespace GZ_SENSORS_VERSION_NAMESPACE {
38 //
40 class MagnetometerSensorPrivate;
41
45 class GZ_SENSORS_MAGNETOMETER_VISIBLE MagnetometerSensor
46 : public Sensor
47 {
50
52 public: virtual ~MagnetometerSensor();
53
57 public: virtual bool Load(const sdf::Sensor &_sdf) override;
58
62 public: virtual bool Load(sdf::ElementPtr _sdf) override;
63
66 public: virtual bool Init() override;
67
68 using Sensor::Update;
69
73 public: virtual bool Update(
74 const std::chrono::steady_clock::duration &_now) override;
75
78 public: void SetWorldPose(const math::Pose3d _pose);
79
82 public: math::Pose3d WorldPose() const;
83
86 public: void SetWorldMagneticField(const math::Vector3d &_field);
87
90 public: math::Vector3d WorldMagneticField() const;
91
94 public: math::Vector3d MagneticField() const;
95
98 public: virtual bool HasConnections() const override;
99
100 GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
104 GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
105 };
106 }
107 }
108}
109
110#endif