##

Noise.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_NOISE_HH_
#define _GAZEBO_NOISE_HH_
#include <vector>
#include <string>
#include <boost/function.hpp>
#include <sdf/sdf.hh>
#include "gazebo/rendering/RenderTypes.hh"
#include "gazebo/sensors/SensorTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace sensors
{
class GZ_SENSORS_VISIBLE NoiseFactory
{
public: static NoisePtr NewNoiseModel(sdf::ElementPtr _sdf,
const std::string &_sensorType = "");
};
class GZ_SENSORS_VISIBLE Noise
{
public: enum NoiseType
{
NONE,
CUSTOM,
GAUSSIAN
};
public: explicit Noise(NoiseType _type);
public: virtual ~Noise();
public: virtual void Load(sdf::ElementPtr _sdf);
public: double Apply(double _in);
public: virtual double ApplyImpl(double _in);
public: virtual void Fini();
public: NoiseType GetNoiseType() const;
public: virtual void SetCustomNoiseCallback(
boost::function<double (double)> _cb);
public: virtual void SetCamera(rendering::CameraPtr _camera);
public: virtual void Print(std::ostream &_out) const;
private: NoiseType type;
private: sdf::ElementPtr sdf;
private: std::function<double (double)> customNoiseCallback;
};
}
}
#endif
gazebo::sensors::Noise::NoiseType
NoiseType
Which noise types we support.
Definition: Noise.hh:58
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::sensors::Noise::GetNoiseType
NoiseType GetNoiseType() const
Accessor for NoiseType.
gazebo::sensors::Noise::Print
virtual void Print(std::ostream &_out) const
Output information about the noise model.
gazebo::sensors::Noise::Load
virtual void Load(sdf::ElementPtr _sdf)
Load noise parameters from sdf.
sensors
sensors
Definition: SensorManager.hh:35
SensorTypes.hh
Forward declarations and typedefs for sensors.
gazebo::sensors::Noise
Noise models for sensor output signals.
Definition: Noise.hh:55
system.hh
gazebo::sensors::Noise::SetCamera
virtual void SetCamera(rendering::CameraPtr _camera)
Set camera needed to create image noise.
gazebo::sensors::NoiseFactory
Use this noise manager for creating and loading noise models.
Definition: Noise.hh:40
RenderTypes.hh
gazebo::sensors::Noise::~Noise
virtual ~Noise()
Destructor.
gazebo::sensors::Noise::CUSTOM
Definition: Noise.hh:61
gazebo::sensors::Noise::Apply
double Apply(double _in)
Apply noise to input data value.
gazebo::sensors::Noise::GAUSSIAN
Definition: Noise.hh:62
gazebo::sensors::Noise::SetCustomNoiseCallback
virtual void SetCustomNoiseCallback(boost::function< double(double)> _cb)
Register a custom noise callback.
gazebo::sensors::Noise::NONE
Definition: Noise.hh:60
gazebo::sensors::Noise::ApplyImpl
virtual double ApplyImpl(double _in)
Apply noise to input data value.
gazebo::sensors::Noise::Fini
virtual void Fini()
Finalize the noise model.
gazebo::rendering::CameraPtr
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:90
gazebo::sensors::NoisePtr
std::shared_ptr< Noise > NoisePtr
Definition: SensorTypes.hh:124
gazebo::sensors::NoiseFactory::NewNoiseModel
static NoisePtr NewNoiseModel(sdf::ElementPtr _sdf, const std::string &_sensorType="")
Load a noise model based on the input sdf parameters and sensor type.
gazebo::sensors::Noise::Noise
Noise(NoiseType _type)
Constructor.