Ignition Sensors

API Reference

6.3.0
ImuSensor.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 IGNITION_SENSORS_IMUSENSOR_HH_
18 #define IGNITION_SENSORS_IMUSENSOR_HH_
19 
20 #include <memory>
21 
22 #include <sdf/sdf.hh>
23 
24 #include <ignition/common/SuppressWarning.hh>
25 #include <ignition/math/Pose3.hh>
26 
27 #include <ignition/sensors/config.hh>
28 #include <ignition/sensors/imu/Export.hh>
29 
31 
32 namespace ignition
33 {
34  namespace sensors
35  {
37  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
38 
40  enum class IGNITION_SENSORS_VISIBLE WorldFrameEnumType
41  {
44  NONE = 0,
45 
47  ENU = 1,
48 
50  NED = 2,
51 
53  NWU = 3,
54 
56  CUSTOM = 4
57  };
58 
61  class ImuSensorPrivate;
62 
67  class IGNITION_SENSORS_IMU_VISIBLE ImuSensor : public Sensor
68  {
70  public: ImuSensor();
71 
73  public: virtual ~ImuSensor();
74 
78  public: virtual bool Load(const sdf::Sensor &_sdf) override;
79 
83  public: virtual bool Load(sdf::ElementPtr _sdf) override;
84 
87  public: virtual bool Init() override;
88 
92  public: virtual bool Update(
93  const std::chrono::steady_clock::duration &_now) override;
94 
98  public: void SetAngularVelocity(const math::Vector3d &_angularVel);
99 
103  public: math::Vector3d AngularVelocity() const;
104 
108  public: void SetLinearAcceleration(const math::Vector3d &_linearAcc);
109 
113  public: math::Vector3d LinearAcceleration() const;
114 
117  public: void SetWorldPose(const math::Pose3d _pose);
118 
121  public: math::Pose3d WorldPose() const;
122 
127  public: void SetOrientationReference(
128  const math::Quaterniond &_orient);
129 
132  public: math::Quaterniond OrientationReference() const;
133 
139  public: math::Quaterniond Orientation() const;
140 
143  public: void SetGravity(const math::Vector3d &_gravity);
144 
150  public: void SetOrientationEnabled(bool _enabled);
151 
154  public: bool OrientationEnabled() const;
155 
158  public: math::Vector3d Gravity() const;
159 
164  public: void SetWorldFrameOrientation(
165  const math::Quaterniond &_rot, WorldFrameEnumType _relativeTo);
166 
167  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
170  private: std::unique_ptr<ImuSensorPrivate> dataPtr;
171  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
172  };
173  }
174  }
175 }
176 
177 #endif
WorldFrameEnumType
Inline bracket to help doxygen filtering.
Definition: ImuSensor.hh:40
a base sensor class
Definition: Sensor.hh:59
NED (North-East-Down): x - North, y - East, z - Down.
ENU (East-North-Up): x - East, y - North, z - Up.
Definition: AirPressureSensor.hh:31
NWU (North-West-Up): x - North, y - West, z - Up.
Imu Sensor Class.
Definition: ImuSensor.hh:67