jdelacroix / simiam

A MATLAB-based educational bridge between theory and practice in robotics.
http://gritslab.gatech.edu/projects/robot-simulator
Other
104 stars 52 forks source link

I think the rand() generate uniformly, but not normally distributed pseudonym numbers #3

Closed BlueBirdHouse closed 10 years ago

BlueBirdHouse commented 10 years ago

Our teachers around me here are researching on filters. According to their logic, a signal with some normally distributed noise is just good, ha-ha! Is it really that the IR proximity sensor’s noise is uniformly distributed but not normally distributed? If step by step, the noise is not relevant, the discrete Kalman filter works fine! But, the conclusion may seem different with some normally distributed noise.

In your: classdef ProximitySensor < simiam.ui.Drawable ….. function update_range(obj, distance) …. variance = 0.005; noise = -variance+2_variance_rand();

I think randn() generate normally distributed pseudonym numbers. Some students study on filters love play with different noise! I think if give them an interface in your Simulink blocks may let them feel better.

jdelacroix commented 10 years ago

Good point! I don't have an accurate noise model for the sensor; however, I agree that a normal distribution would better than the uniform distribution.

A fix would be:

variance = 0.005; noise = sqrt(variance)*randn();

I will make this enhancement.

Also, perhaps there is even a more general way that noise models could be applied to any sensor. This way anybody can either either use the default noise model, or add their own.

Thanks!

jdelacroix commented 10 years ago

Fixed by adding simiam.robot.sensor.noise package. See, for example, how GaussianNoise is used in Khepera3 and ProximitySensor.