Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROTORS_GAZEBO_PLUGINS_DEPTH_NOISE_MODEL_H
00017 #define ROTORS_GAZEBO_PLUGINS_DEPTH_NOISE_MODEL_H
00018
00019 #include <Eigen/Eigen>
00020 #include <random>
00021
00022 class DepthNoiseModel {
00023 public:
00024 DepthNoiseModel()
00025 : max_depth(1000.0f), min_depth(0.2f), gen(std::random_device{}()) {}
00026
00027 virtual void ApplyNoise(uint32_t width, uint32_t height, float *data) = 0;
00028
00029 float max_depth;
00030 float min_depth;
00031
00032
00033 protected:
00034 bool InRange(float depth) const;
00035
00036 const float bad_point = std::numeric_limits<float>::quiet_NaN();
00037 std::normal_distribution<float> dist;
00038 std::mt19937 gen;
00039 };
00040
00041 class KinectDepthNoiseModel : public DepthNoiseModel {
00042 public:
00043 KinectDepthNoiseModel() : DepthNoiseModel() {}
00044
00045 void ApplyNoise(uint32_t width, uint32_t height, float *data);
00046 };
00047
00048 class D435DepthNoiseModel : public DepthNoiseModel {
00049 public:
00050 D435DepthNoiseModel()
00051 : h_fov(M_PI_2),
00052 baseline(0.05f),
00053 subpixel_err(0.1f),
00054 max_stdev(3.0f),
00055 DepthNoiseModel() {}
00056
00057 void ApplyNoise(uint32_t width, uint32_t height, float *data);
00058
00059
00060 float h_fov;
00061 float baseline;
00062 float subpixel_err;
00063 float max_stdev;
00064
00065
00066 };
00067
00068 #endif // ROTORS_GAZEBO_PLUGINS_DEPTH_NOISE_MODEL_H
rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Thu Apr 18 2019 02:43:43