Fixed use of # in ```python block

If not indented, gets treated as a header by nbconvert.
This commit is contained in:
Roger Labbe 2015-07-22 12:02:21 -07:00
parent e7954be704
commit 091f372b85
2 changed files with 51 additions and 51 deletions

File diff suppressed because one or more lines are too long

View File

@ -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",