Ignition Sensors

API Reference

5.0.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/common/Time.hh>
26 #include <ignition/math/Pose3.hh>
27 
28 #include <ignition/sensors/config.hh>
29 #include <ignition/sensors/imu/Export.hh>
30 
32 
33 namespace ignition
34 {
35  namespace sensors
36  {
37  // Inline bracket to help doxygen filtering.
38  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
39  //
41  class ImuSensorPrivate;
42 
47  class IGNITION_SENSORS_IMU_VISIBLE ImuSensor : public Sensor
48  {
50  public: ImuSensor();
51 
53  public: virtual ~ImuSensor();
54 
58  public: virtual bool Load(const sdf::Sensor &_sdf) override;
59 
63  public: virtual bool Load(sdf::ElementPtr _sdf) override;
64 
67  public: virtual bool Init() override;
68 
72  public: virtual bool IGN_DEPRECATED(4) Update(
73  const ignition::common::Time &_now) override;
74 
78  public: virtual bool Update(
79  const std::chrono::steady_clock::duration &_now) override;
80 
84  public: void SetAngularVelocity(const math::Vector3d &_angularVel);
85 
89  public: math::Vector3d AngularVelocity() const;
90 
94  public: void SetLinearAcceleration(const math::Vector3d &_linearAcc);
95 
99  public: math::Vector3d LinearAcceleration() const;
100 
103  public: void SetWorldPose(const math::Pose3d _pose);
104 
107  public: math::Pose3d WorldPose() const;
108 
113  public: void SetOrientationReference(
114  const math::Quaterniond &_orient);
115 
118  public: math::Quaterniond OrientationReference() const;
119 
125  public: math::Quaterniond Orientation() const;
126 
129  public: void SetGravity(const math::Vector3d &_gravity);
130 
136  public: void SetOrientationEnabled(bool _enabled);
137 
140  public: bool OrientationEnabled() const;
141 
144  public: math::Vector3d Gravity() const;
145 
146  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
149  private: std::unique_ptr<ImuSensorPrivate> dataPtr;
150  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
151  };
152  }
153  }
154 }
155 
156 #endif
a base sensor class
Definition: Sensor.hh:60
Definition: AirPressureSensor.hh:32
Imu Sensor Class.
Definition: ImuSensor.hh:47