Ignition Sensors

API Reference

6.0.1
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  {
36  // Inline bracket to help doxygen filtering.
37  inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
38  //
40  class ImuSensorPrivate;
41 
46  class IGNITION_SENSORS_IMU_VISIBLE ImuSensor : public Sensor
47  {
49  public: ImuSensor();
50 
52  public: virtual ~ImuSensor();
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 
71  public: virtual bool Update(
72  const std::chrono::steady_clock::duration &_now) override;
73 
77  public: void SetAngularVelocity(const math::Vector3d &_angularVel);
78 
82  public: math::Vector3d AngularVelocity() const;
83 
87  public: void SetLinearAcceleration(const math::Vector3d &_linearAcc);
88 
92  public: math::Vector3d LinearAcceleration() const;
93 
96  public: void SetWorldPose(const math::Pose3d _pose);
97 
100  public: math::Pose3d WorldPose() const;
101 
106  public: void SetOrientationReference(
107  const math::Quaterniond &_orient);
108 
111  public: math::Quaterniond OrientationReference() const;
112 
118  public: math::Quaterniond Orientation() const;
119 
122  public: void SetGravity(const math::Vector3d &_gravity);
123 
129  public: void SetOrientationEnabled(bool _enabled);
130 
133  public: bool OrientationEnabled() const;
134 
137  public: math::Vector3d Gravity() const;
138 
139  IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
142  private: std::unique_ptr<ImuSensorPrivate> dataPtr;
143  IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
144  };
145  }
146  }
147 }
148 
149 #endif
a base sensor class
Definition: Sensor.hh:59
Definition: AirPressureSensor.hh:31
Imu Sensor Class.
Definition: ImuSensor.hh:46