Loading...
Searching...
No Matches
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
26namespace 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
Imu contains information about an imu sensor.
Definition Imu.hh:36
const Noise & AngularVelocityXNoise() const
Get the noise values related to the body-frame angular velocity on the X-axis.
void SetAngularVelocityYNoise(const Noise &_noise)
Set the noise values related to the body-frame angular velocity around the Y-axis.
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 ...
void SetAngularVelocityXNoise(const Noise &_noise)
Set the noise values related to the body-frame angular velocity around the X-axis.
const Noise & LinearAccelerationZNoise() const
Get the noise values related to the body-frame linear acceleration on the Z-axis.
bool operator==(const Imu &_imu) const
Return true if both Imu objects contain the same values.
void SetLinearAccelerationXNoise(const Noise &_noise)
Set the noise values related to the body-frame linear acceleration on the X-axis.
void SetLocalization(const std::string &_localization)
See Localization(const std::string &).
void SetGravityDirXParentFrame(const std::string &_frame) const
Set the name of parent frame which the GravityDirX vector is defined relative to.
const Noise & AngularVelocityYNoise() const
Get the noise values related to the body-frame angular velocity around the Y-axis.
Imu & operator=(Imu &&_imu) noexcept
Move assignment operator.
const Noise & AngularVelocityZNoise() const
Get the noise values related to the body-frame angular velocity around the Z-axis.
void SetCustomRpyParentFrame(const std::string &_frame) const
Set the name of parent frame which the custom_rpy transform is defined relative to.
~Imu()
Destructor.
Imu()
Default constructor.
void SetCustomRpy(const ignition::math::Vector3d &_rpy) const
See CustomRpy() const.
const ignition::math::Vector3d & CustomRpy() const
This field and CustomRpyParentFrame are used when Localization is set to CUSTOM.
bool operator!=(const Imu &_imu) const
Return true this Imu object does not contain the same values as the passed in parameter.
const std::string & GravityDirXParentFrame() const
Get the name of parent frame which the GravityDirX vector is defined relative to.
const std::string & CustomRpyParentFrame() const
Get the name of parent frame which the custom_rpy transform is defined relative to.
Imu & operator=(const Imu &_imu)
Assignment operator.
const std::string & Localization() const
This string represents special hardcoded use cases that are commonly seen with typical robot IMU's:
Errors Load(ElementPtr _sdf)
Load the IMU based on an element pointer.
const Noise & LinearAccelerationYNoise() const
Get the noise values related to the body-frame linear acceleration on the Y-axis.
Imu(Imu &&_imu) noexcept
Move constructor.
void SetAngularVelocityZNoise(const Noise &_noise)
Set the noise values related to the body-frame angular velocity around the Z-axis.
Imu(const Imu &_imu)
Copy constructor.
void SetLinearAccelerationZNoise(const Noise &_noise)
Set the noise values related to the body-frame linear acceleration on the Z-axis.
void SetLinearAccelerationYNoise(const Noise &_noise)
Set the noise values related to the body-frame linear acceleration on the Y-axis.
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 ...
const Noise & LinearAccelerationXNoise() const
Get the noise values related to the body-frame linear acceleration on the X-axis.
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
The Noise class contains information about a noise model, such as a Gaussian distribution.
Definition Noise.hh:50
std::vector< Error > Errors
A vector of Error.
Definition Types.hh:89
std::shared_ptr< Element > ElementPtr
Definition Element.hh:53
namespace for Simulation Description Format parser
Definition Actor.hh:33
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:48