Fixed use of # in ```python block
If not indented, gets treated as a header by nbconvert.
This commit is contained in:
parent
e7954be704
commit
091f372b85
File diff suppressed because one or more lines are too long
@ -859,14 +859,14 @@
|
||||
"Most of this code is devoted to initialization and plotting. The entirety of the particle filter processing consists of these lines:\n",
|
||||
"\n",
|
||||
"```python\n",
|
||||
"# distance from robot to each landmark\n",
|
||||
"zs = norm(landmarks - pos, axis=1) + randn(NL)*sensor_std_err\n",
|
||||
" # distance from robot to each landmark\n",
|
||||
" zs = norm(landmarks - pos, axis=1) + randn(NL)*sensor_std_err\n",
|
||||
"\n",
|
||||
"# move diagonally forward to (x+1, x+1)\n",
|
||||
"pf.predict(u=(0.00, 1.414), std=(.2, .05))\n",
|
||||
"pf.update(z=zs)\n",
|
||||
"if pf.neff() < N/2:\n",
|
||||
" pf.resample()```\n",
|
||||
" # move diagonally forward to (x+1, x+1)\n",
|
||||
" pf.predict(u=(0.00, 1.414), std=(.2, .05))\n",
|
||||
" pf.update(z=zs)\n",
|
||||
" if pf.neff() < N/2:\n",
|
||||
" pf.resample()```\n",
|
||||
"\n",
|
||||
"The first line takes advantage of `numpy.linalg.norm`, which computes the Euclidian distance of a vector. In other words, we compute the distance of the robot to each landmark, and add in sensor noise so that this is a realistic simulation. Uou wouldn't add noise if this was real sensor data, of course!\n",
|
||||
"\n",
|
||||
|
Loading…
Reference in New Issue
Block a user