Revision 1797 branches/16299_s10/matlab/sensorModel.m
| sensorModel.m (revision 1797) | ||
|---|---|---|
| 1 | 1 |
%TODO: pass in dt for lag model |
| 2 | 2 |
function [xSensor, ySensor, thetaSensor, phiSensor, state] = sensorModel(xTrue,yTrue,thetaTrue,phiTrue,state) |
| 3 | 3 |
|
| 4 |
noiseVar = 0.5; |
|
| 5 |
noiseMean = 0; |
|
| 6 |
|
|
| 4 | 7 |
%TODO: value in time instead of number of calls |
| 5 | 8 |
sensorLag = 10; |
| 6 | 9 |
|
| ... | ... | |
| 21 | 24 |
|
| 22 | 25 |
% phiSensor is the value from the BOM sensor |
| 23 | 26 |
% round past phi to the nearest pi/8 |
| 24 |
noisePhi = state.phi(1,:)' + randn() - 0.5; |
|
| 27 |
noisePhi = state.phi(1,:)' + randn()*noiseVar + noiseMean; |
|
| 25 | 28 |
phiSensor = round(noisePhi*8/pi)*pi/8; |
| 26 | 29 |
%phiSensor = round(state.phi(1,:)'*8/pi)*pi/8; |
| 27 | 30 |
|
Also available in: Unified diff