Imu.hh
Go to the documentation of this file.
1 /*
2  * Copyright 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 SDF_IMU_HH_
18 #define SDF_IMU_HH_
19 
20 #include <string>
21 #include <sdf/Error.hh>
22 #include <sdf/Element.hh>
23 #include <sdf/Noise.hh>
24 #include <sdf/sdf_config.h>
25 
26 namespace sdf
27 {
28  // Inline bracket to help doxygen filtering.
29  inline namespace SDF_VERSION_NAMESPACE {
30  //
31  class ImuPrivate;
32 
36  {
38  public: Imu();
39 
42  public: Imu(const Imu &_imu);
43 
46  public: Imu(Imu &&_imu) noexcept;
47 
49  public: ~Imu();
50 
54  public: Imu &operator=(const Imu &_imu);
55 
59  public: Imu &operator=(Imu &&_imu) noexcept;
60 
67  public: Errors Load(ElementPtr _sdf);
68 
73  public: sdf::ElementPtr Element() const;
74 
78  public: const Noise &LinearAccelerationXNoise() const;
79 
83  public: void SetLinearAccelerationXNoise(const Noise &_noise);
84 
88  public: const Noise &LinearAccelerationYNoise() const;
89 
93  public: void SetLinearAccelerationYNoise(const Noise &_noise);
94 
98  public: const Noise &LinearAccelerationZNoise() const;
99 
103  public: void SetLinearAccelerationZNoise(const Noise &_noise);
104 
108  public: const Noise &AngularVelocityXNoise() const;
109 
113  public: void SetAngularVelocityXNoise(const Noise &_noise);
114 
118  public: const Noise &AngularVelocityYNoise() const;
119 
123  public: void SetAngularVelocityYNoise(const Noise &_noise);
124 
128  public: const Noise &AngularVelocityZNoise() const;
129 
133  public: void SetAngularVelocityZNoise(const Noise &_noise);
134 
141  public: ignition::math::Vector3d &GravityDirX() const;
142 
149  public: void SetGravityDirX(const ignition::math::Vector3d &_grav) const;
150 
156  public: const std::string &GravityDirXParentFrame() const;
157 
163  public: void SetGravityDirXParentFrame(const std::string &_frame) const;
164 
197  public: const std::string &Localization() const;
198 
201  public: void SetLocalization(const std::string &_localization);
202 
238  public: const ignition::math::Vector3d &CustomRpy() const;
239 
242  public: void SetCustomRpy(const ignition::math::Vector3d &_rpy) const;
243 
249  public: const std::string &CustomRpyParentFrame() const;
250 
256  public: void SetCustomRpyParentFrame(const std::string &_frame) const;
257 
261  public: bool operator==(const Imu &_imu) const;
262 
267  public: bool operator!=(const Imu &_imu) const;
268 
270  private: ImuPrivate *dataPtr;
271  };
272  }
273 }
274 #endif
sdf::v9::Imu::GravityDirXParentFrame
const std::string & GravityDirXParentFrame() const
Get the name of parent frame which the GravityDirX vector is defined relative to.
Error.hh
Noise.hh
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:33
sdf::v9::Imu::SetLocalization
void SetLocalization(const std::string &_localization)
See Localization(const std::string &).
sdf::v9::Imu::SetCustomRpy
void SetCustomRpy(const ignition::math::Vector3d &_rpy) const
See CustomRpy() const.
sdf::v9::Imu::Localization
const std::string & Localization() const
This string represents special hardcoded use cases that are commonly seen with typical robot IMU's:
sdf::v9::Imu::operator=
Imu & operator=(const Imu &_imu)
Assignment operator.
sdf::v9::Imu
Imu contains information about an imu sensor.
Definition: Imu.hh:36
sdf::v9::Imu::SetCustomRpyParentFrame
void SetCustomRpyParentFrame(const std::string &_frame) const
Set the name of parent frame which the custom_rpy transform is defined relative to.
sdf::v9::Imu::AngularVelocityYNoise
const Noise & AngularVelocityYNoise() const
Get the noise values related to the body-frame angular velocity around the Y-axis.
sdf::v9::Imu::SetGravityDirX
void SetGravityDirX(const ignition::math::Vector3d &_grav) const
Used when localization is set to GRAV_UP or GRAV_DOWN, a projection of this vector into a plane that ...
sdf::v9::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:89
sdf::v9::Imu::Imu
Imu(const Imu &_imu)
Copy constructor.
sdf::v9::Imu::Imu
Imu(Imu &&_imu) noexcept
Move constructor.
sdf::v9::Imu::SetGravityDirXParentFrame
void SetGravityDirXParentFrame(const std::string &_frame) const
Set the name of parent frame which the GravityDirX vector is defined relative to.
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48
sdf::v9::Imu::SetAngularVelocityZNoise
void SetAngularVelocityZNoise(const Noise &_noise)
Set the noise values related to the body-frame angular velocity around the Z-axis.
sdf::v9::Noise
The Noise class contains information about a noise model, such as a Gaussian distribution.
Definition: Noise.hh:50
sdf::v9::Imu::SetLinearAccelerationYNoise
void SetLinearAccelerationYNoise(const Noise &_noise)
Set the noise values related to the body-frame linear acceleration on the Y-axis.
sdf::v9::Imu::SetLinearAccelerationZNoise
void SetLinearAccelerationZNoise(const Noise &_noise)
Set the noise values related to the body-frame linear acceleration on the Z-axis.
sdf::v9::Imu::AngularVelocityZNoise
const Noise & AngularVelocityZNoise() const
Get the noise values related to the body-frame angular velocity around the Z-axis.
sdf::v9::Imu::LinearAccelerationXNoise
const Noise & LinearAccelerationXNoise() const
Get the noise values related to the body-frame linear acceleration on the X-axis.
sdf::v9::Imu::operator==
bool operator==(const Imu &_imu) const
Return true if both Imu objects contain the same values.
sdf::v9::Imu::SetAngularVelocityXNoise
void SetAngularVelocityXNoise(const Noise &_noise)
Set the noise values related to the body-frame angular velocity around the X-axis.
sdf::v9::Imu::Load
Errors Load(ElementPtr _sdf)
Load the IMU based on an element pointer.
sdf::v9::Imu::operator=
Imu & operator=(Imu &&_imu) noexcept
Move assignment operator.
sdf::v9::Imu::Imu
Imu()
Default constructor.
sdf::v9::Imu::operator!=
bool operator!=(const Imu &_imu) const
Return true this Imu object does not contain the same values as the passed in parameter.
sdf::v9::Imu::SetAngularVelocityYNoise
void SetAngularVelocityYNoise(const Noise &_noise)
Set the noise values related to the body-frame angular velocity around the Y-axis.
sdf::v9::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
sdf::v9::Imu::CustomRpy
const ignition::math::Vector3d & CustomRpy() const
This field and CustomRpyParentFrame are used when Localization is set to CUSTOM.
sdf::v9::Imu::LinearAccelerationYNoise
const Noise & LinearAccelerationYNoise() const
Get the noise values related to the body-frame linear acceleration on the Y-axis.
sdf::v9::Imu::~Imu
~Imu()
Destructor.
sdf::v9::Imu::Element
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
sdf::v9::Imu::GravityDirX
ignition::math::Vector3d & GravityDirX() const
Used when localization is set to GRAV_UP or GRAV_DOWN, a projection of this vector into a plane that ...
sdf::v9::Imu::LinearAccelerationZNoise
const Noise & LinearAccelerationZNoise() const
Get the noise values related to the body-frame linear acceleration on the Z-axis.
sdf::v9::Imu::CustomRpyParentFrame
const std::string & CustomRpyParentFrame() const
Get the name of parent frame which the custom_rpy transform is defined relative to.
sdf::v9::Imu::SetLinearAccelerationXNoise
void SetLinearAccelerationXNoise(const Noise &_noise)
Set the noise values related to the body-frame linear acceleration on the X-axis.
Element.hh
sdf::v9::Imu::AngularVelocityXNoise
const Noise & AngularVelocityXNoise() const
Get the noise values related to the body-frame angular velocity on the X-axis.