Add methods to set dynamically Gaussian noise parameters

#2931 Merged at 5294062
Repository
ocrave
Branch
set_gaussian_noise_params
Repository
osrf
Branch
default
Author
  1. Olivier Crave
Reviewers
Description

With this commit, a camera sensor plugin can modify the mean and standard deviation of its noise distribution at runtime. For instance:

  sensors::NoisePtr noise = this->sensor->GetNoise(sensors::CAMERA_NOISE);
  if (noise)
  {
    sensors::ImageGaussianNoiseModelPtr imageGaussianNoiseModel =
      boost::dynamic_pointer_cast<sensors::ImageGaussianNoiseModel>(
          noise);

    imageGaussianNoiseModel->SetMean(0.2);
  }

Comments (4)