IMUROSPlugin.hh
Go to the documentation of this file.
1 // Copyright (c) 2016 The UUV Simulator Authors.
2 // All rights reserved.
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 // This source code is derived from rotors_simulator
17 // (https://github.com/ethz-asl/rotors_simulator)
18 // * Copyright 2015 Fadri Furrer, ASL, ETH Zurich, Switzerland,
19 // * Copyright 2015 Michael Burri, ASL, ETH Zurich, Switzerland,
20 // * Copyright 2015 Mina Kamel, ASL, ETH Zurich, Switzerland,
21 // * Copyright 2015 Janosch Nikolic, ASL, ETH Zurich, Switzerland,
22 // * Copyright 2015 Markus Achtelik, ASL, ETH Zurich, Switzerland,
23 // licensed under the Apache-2.0 license,
24 // cf. 3rd-party-licenses.txt file in the root directory of this source tree.
25 //
26 // The original code was modified to:
27 // - be more consistent with other sensor plugins within uuv_simulator,
28 // - adhere to Gazebo's coding standards.
29 
30 #ifndef __UUV_IMU_ROS_PLUGIN_HH__
31 #define __UUV_IMU_ROS_PLUGIN_HH__
32 
33 #include <gazebo/gazebo.hh>
34 #include <ros/ros.h>
36 #include <sensor_msgs/Imu.h>
37 #include "SensorImu.pb.h"
38 
39 // Default values for use with ADIS16448 IMU
40 #define K_DEFAULT_ADIS_GYROSCOPE_NOISE_DENSITY 2.0 * 35.0 / 3600.0 / 180.0 * M_PI
41 #define K_DEFAULT_ADIS_GYROSCOPE_RANDOM_WALK 2.0 * 4.0 / 3600.0 / 180.0 * M_PI
42 #define K_DEFAULT_ADIS_GYROSCOPE_BIAS_CORRELATION_TIME 1.0e+3
43 #define K_DEFAULT_ADIS_GYROSCOPE_TURN_ON_BIAS_SIGMA 0.5 / 180.0 * M_PI
44 #define K_DEFAULT_ADIS_ACCELEROMETER_NOISE_DENSITY 2.0 * 2.0e-3
45 #define K_DEFAULT_ADIS_ACCELEROMETER_RANDOM_WALK 2.0 * 3.0e-3
46 #define K_DEFAULT_ADIS_ACCELEROMETER_BIAS_CORRELATION_TIME 300.0
47 #define K_DEFAULT_ADIS_ACCELEROMETER_TURN_ON_BIAS_SIGMA 20.0e-3 * 9.8
48 #define K_DEFAULT_ORIENTATION_NOISE 0.5
49 
50 namespace gazebo
51 {
55  struct IMUParameters {
58 
61 
64 
67 
70 
73 
76 
79 
82 
85  : gyroscopeNoiseDensity(
87  gyroscopeRandomWalk(
89  gyroscopeBiasCorrelationTime(
91  gyroscopeTurnOnBiasSigma(
93  accelerometerNoiseDensity(
95  accelerometerRandomWalk(
97  accelerometerBiasCorrelationTime(
99  accelerometerTurnOnBiasSigma(
101  orientationNoise(
103  {}
104  };
105 
107  {
109  public: IMUROSPlugin();
110 
112  public: virtual ~IMUROSPlugin();
113 
115  public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
116 
118  protected: virtual bool OnUpdate(const common::UpdateInfo& _info);
119 
121  protected: void AddNoise(ignition::math::Vector3d& _linAcc,
122  ignition::math::Vector3d& _angVel,
123  ignition::math::Quaterniond& _orientation,
124  double _dt);
125 
127  protected: ignition::math::Vector3d measLinearAcc;
128 
130  protected: ignition::math::Vector3d measAngularVel;
131 
133  protected: ignition::math::Quaterniond measOrientation;
134 
136  protected: ignition::math::Vector3d gravityWorld;
137 
139  protected: ignition::math::Vector3d gyroscopeBias;
140 
142  protected: ignition::math::Vector3d accelerometerBias;
143 
145  protected: ignition::math::Vector3d gyroscopeTurnOnBias;
146 
148  protected: ignition::math::Vector3d accelerometerTurnOnBias;
149 
152 
154  protected: sensor_msgs::Imu imuROSMessage;
155  };
156 }
157 
158 #endif // __UUV_IMU_ROS_PLUGIN_HH__
IMUParameters()
Constructor.
Definition: IMUROSPlugin.hh:84
IMUParameters imuParameters
IMU model parameters.
#define K_DEFAULT_ADIS_ACCELEROMETER_RANDOM_WALK
Definition: IMUROSPlugin.hh:45
double orientationNoise
Standard deviation of orientation noise per axis [rad].
Definition: IMUROSPlugin.hh:81
double accelerometerNoiseDensity
Accelerometer noise density (two-sided spectrum) [m/s^2/sqrt(Hz)].
Definition: IMUROSPlugin.hh:69
double gyroscopeBiasCorrelationTime
Gyroscope bias correlation time constant [s].
Definition: IMUROSPlugin.hh:63
ignition::math::Vector3d gravityWorld
Gravity vector wrt. reference frame.
#define K_DEFAULT_ADIS_ACCELEROMETER_NOISE_DENSITY
Definition: IMUROSPlugin.hh:44
double accelerometerTurnOnBiasSigma
Accelerometer turn on bias standard deviation [m/s^2].
Definition: IMUROSPlugin.hh:78
#define K_DEFAULT_ADIS_ACCELEROMETER_TURN_ON_BIAS_SIGMA
Definition: IMUROSPlugin.hh:47
double gyroscopeNoiseDensity
Gyroscope noise density (two-sided spectrum) [rad/s/sqrt(Hz)].
Definition: IMUROSPlugin.hh:57
IMUParameters stores all IMU model parameters. A description of these parameters can be found here: h...
Definition: IMUROSPlugin.hh:55
#define K_DEFAULT_ADIS_GYROSCOPE_NOISE_DENSITY
Definition: IMUROSPlugin.hh:40
#define K_DEFAULT_ADIS_GYROSCOPE_BIAS_CORRELATION_TIME
Definition: IMUROSPlugin.hh:42
#define K_DEFAULT_ADIS_GYROSCOPE_RANDOM_WALK
Definition: IMUROSPlugin.hh:41
ignition::math::Quaterniond measOrientation
(Simulation) time when the last sensor measurement was generated.
double gyroscopeTurnOnBiasSigma
Gyroscope turn on bias standard deviation [rad/s].
Definition: IMUROSPlugin.hh:66
ignition::math::Vector3d gyroscopeBias
Current (drifting) gyroscope bias.
ignition::math::Vector3d measLinearAcc
Last measurement of linear acceleration..
double gyroscopeRandomWalk
Gyroscope bias random walk [rad/s/s/sqrt(Hz)].
Definition: IMUROSPlugin.hh:60
ignition::math::Vector3d measAngularVel
Last measurement of angular velocity.
#define K_DEFAULT_ADIS_ACCELEROMETER_BIAS_CORRELATION_TIME
Definition: IMUROSPlugin.hh:46
ignition::math::Vector3d gyroscopeTurnOnBias
Constant turn-on gyroscope bias.
#define K_DEFAULT_ORIENTATION_NOISE
Definition: IMUROSPlugin.hh:48
#define K_DEFAULT_ADIS_GYROSCOPE_TURN_ON_BIAS_SIGMA
Definition: IMUROSPlugin.hh:43
ignition::math::Vector3d accelerometerTurnOnBias
Constant turn-on accelerometer bias.
double accelerometerRandomWalk
Accelerometer bias random walk. [m/s^2/s/sqrt(Hz)].
Definition: IMUROSPlugin.hh:72
ignition::math::Vector3d accelerometerBias
Current (drifting) accelerometer bias.
sensor_msgs::Imu imuROSMessage
ROS IMU message.
double accelerometerBiasCorrelationTime
Accelerometer bias correlation time constant [s].
Definition: IMUROSPlugin.hh:75


uuv_sensor_ros_plugins
Author(s): Musa Morena Marcusso Manhaes , Sebastian Scherer , Luiz Ricardo Douat
autogenerated on Thu Jun 18 2020 03:28:33