Skip to content

Commit 8b2344d

Browse files
Fix spelling and grammatical errors in documentation
Co-authored-by: liammcalpineduckietown <[email protected]>
1 parent 7ee5875 commit 8b2344d

File tree

3 files changed

+10
-58
lines changed

3 files changed

+10
-58
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Find the most up-to-date instructions on [how to run LXs on the Duckietown manual](https://docs.duckietown.com/ente/duckietown-manual/60-learning-experiences/lx-general-procedure.html).
1010

11-
In this learning experience, you will learn [Braitenberg vehicles](https://en.wikipedia.org/wiki/Braitenberg_vehicle), one of the simplest possible
11+
In this learning experience, you will learn [Braitenberg vehicles](https://en.wikipedia.org/wiki/Braitenberg_vehicle), one of the simplest possible
1212
ways we could conceive of doing sensorimotor control.
1313

1414
**NOTE:** All commands below are intended to be executed from the root directory of this exercise (i.e., the directory containing this README).
@@ -135,7 +135,7 @@ dts code build -R ROBOTNAME
135135

136136
where ROBOTNAME can be either a real or virtual robot.
137137

138-
### Testing the code
138+
### Testing the code
139139

140140
Then you may run your code with
141141

notebooks/02-Image-Filtering/braitenberg02.ipynb

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,7 @@
9898
"id": "2531e7ea",
9999
"metadata": {},
100100
"source": [
101-
"In OpenCV, the convention is the following:\n",
102-
"\n",
103-
"* Hue is usually measured in degrees, 0 to 360, as shown in [this scale](../../assets/HUE.png). However OpenCV uses a scale 0 to 179 - multiply by 2 to get the actual Hue in degree. (so to get a hue of 180 you have to tell 90 to OpenCV.\n",
104-
"* S and V are from 0 to 255."
101+
"In OpenCV, the convention is the following:\n\n* Hue is usually measured in degrees, from 0 to 360, as shown in [this scale](../../assets/HUE.png). However OpenCV uses a scale 0 to 179 - multiply by 2 to get the actual Hue in degree. (so to get a hue of 180 you have to tell 90 to OpenCV).\n* S and V are from 0 to 255."
105102
]
106103
},
107104
{
@@ -182,39 +179,7 @@
182179
"id": "88f03111",
183180
"metadata": {},
184181
"source": [
185-
"## Activity\n",
186-
"\n",
187-
"Your task now is to change those numbers above so that we highlight the duckies.\n",
188-
"\n",
189-
"\n",
190-
"We've created a tool for you to make this easier and suggest you use the following steps:\n",
191-
"\n",
192-
"1. Use [this online color picker](https://pinetools.com/image-color-picker) to click around on the sample images in the `/assets/samples` directory and get familiar with what color corresponds to which HSV values. (You can use any other tool, the link is just for reference). This will set you up to narrow in on the duckie yellow more quickly. **Regardless of the color picker you use, always double-check whether it uses a different convention for HSV ranges. If it does, make sure to convert the result to the OpenCV's convention**.\n",
193-
"\n",
194-
"2. Use the tool [shown in this video](https://vimeo.com/534995276) to find the values interactively. It runs the code in [HSV-bound.py](../../packages/examples/HSV_bound.py) to filter a test image based on the values you choose.\n",
195-
"\n",
196-
" To get this interactive method running, open a terminal on your computer, **navigate to the exercise folder** (where you cloned the `duckietown/lx-braitenberg/` repo) and type:\n",
197-
"\n",
198-
" `dts code build -R ![ROBOTNAME]`\n",
199-
"\n",
200-
" to build your updated exercise on your robot called `![ROBOTNAME]` (note that it can be virtual or physical as described in the [README](../../README.md)). Then use\n",
201-
"\n",
202-
" `dts code workbench -R ![ROBOTNAME] [-m] -L HSV`\n",
203-
"\n",
204-
" where the `-m` option is used if you have already started the duckiematrix and are using a virtual robot. Then finally start up the VNC desktop with \n",
205-
"\n",
206-
" `dts code vnc -R ![ROBOTNAME]`\n",
207-
" \n",
208-
" to run the HSV tool. In the terminal output you will see lines like the following (you may have to scroll up in the terminal)\n",
209-
"\n",
210-
" ```\n",
211-
" VNC running at http://127.0.0.1:32770\n",
212-
" --------------------------------------------------------\n",
213-
" ```\n",
214-
"\n",
215-
" Following the link will bring up the VNC desktop, where you can click on the HSV activity icon and run the tool.\n",
216-
"\n",
217-
"3. After you have a satisfactory result in the VNC tool, open the file [preprocessing.py](../../packages/solution/preprocessing.py), and change the values of `lower_hsv` and `upper_hsv` to the ones that you found to highlight the duckie. This will be used by your Braitenberg agent in the next notebook."
182+
"## Activity\n\nYour task now is to change those numbers above so that we highlight the duckies.\n\n\nWe've created a tool for you to make this easier and suggest you use the following steps:\n\n1. Use [this online color picker](https://pinetools.com/image-color-picker) to click around on the sample images in the `/assets/samples` directory and get familiar with what color corresponds to which HSV values. (You can use any other tool, the link is just for reference). This will set you up to narrow in on the duckie yellow more quickly. **Regardless of the color picker you use, always double-check whether it uses a different convention for HSV ranges. If it does, make sure to convert the result to the OpenCV's convention**.\n\n2. Use the tool [shown in this video](https://vimeo.com/534995276) to find the values interactively. It runs the code in [HSV-bound.py](../../packages/examples/HSV_bound.py) to filter a test image based on the values you choose.\n\n To get this interactive method running, open a terminal on your computer, **navigate to the exercise folder** (where you cloned the `duckietown/lx-braitenberg/` repo) and type:\n\n `dts code build -R ROBOTNAME`\n\n to build your updated exercise on your robot called `ROBOTNAME` (note that it can be virtual or physical as described in the [README](../../README.md)). Then use\n\n `dts code workbench -R ROBOTNAME [-m] -L HSV`\n\n where the `-m` option is used if you have already started the duckiematrix and are using a virtual robot. Then finally start up the VNC desktop with \n\n `dts code vnc -R ROBOTNAME`\n \n to run the HSV tool. In the terminal output you will see lines like the following (you may have to scroll up in the terminal)\n\n ```\n VNC running at http://127.0.0.1:32770\n --------------------------------------------------------\n ```\n\n Following the link will bring up the VNC desktop, where you can click on the HSV activity icon and run the tool.\n\n3. After you have a satisfactory result in the VNC tool, open the file [preprocessing.py](../../packages/solution/preprocessing.py), and change the values of `lower_hsv` and `upper_hsv` to the ones that you found to highlight the duckie. This will be used by your Braitenberg agent in the next notebook."
218183
]
219184
},
220185
{
@@ -274,4 +239,4 @@
274239
},
275240
"nbformat": 4,
276241
"nbformat_minor": 5
277-
}
242+
}

notebooks/03-Braitenberg/braitenberg03.ipynb

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,7 @@
3131
"cell_type": "markdown",
3232
"metadata": {},
3333
"source": [
34-
"# Implementation of Braitenberg agent\n",
35-
"\n",
36-
"Now we know enough about image filtering to implement our Braitenberg agent such that it will avoid duckies. You already updated the image preprocessing in the last activity to highlight duckies - now it's time to handle the sensorimotor connections in order to control our agent.\n",
37-
"\n",
38-
"### Setup\n",
39-
"\n",
40-
"We will implement an agent of the form\n",
41-
"\n",
42-
"```python\n",
43-
"left_motor = const + gain * np.sum( LEFT * preprocess(image) )\n",
44-
"right_motor = const + gain * np.sum( RIGHT * preprocess(image) )\n",
45-
"```\n",
46-
"\n",
47-
"where `LEFT` and `RIGHT` are the weight matrices, while `const` and `gain` are two extra parameters for fine tuning."
34+
"# Implementation of Braitenberg agent\n\nNow we know enough about image filtering to implement our Braitenberg agent such that it will avoid duckies. You already updated the image preprocessing in the last activity to highlight duckies - now it's time to handle the sensorimotor connections in order to control our agent.\n\n### Setup\n\nWe will implement an agent of the form\n\n```python\nleft_motor = const + gain * np.sum( LEFT * preprocess(image) )\nright_motor = const + gain * np.sum( RIGHT * preprocess(image) )\n```\n\nwhere `LEFT` and `RIGHT` are the weight matrices, while `const` and `gain` are two extra parameters for fine tuning."
4835
]
4936
},
5037
{
@@ -196,10 +183,10 @@
196183
" plt.title(\"Preprocessed\")\n",
197184
" f.add_subplot(1, 4, 3)\n",
198185
" plt.imshow(posneg(Lim))\n",
199-
" plt.title('left wheel ' + ('' if Lsign > 0 else ''))\n",
186+
" plt.title('left wheel ' + ('\u2191' if Lsign > 0 else '\u2193'))\n",
200187
" f.add_subplot(1, 4, 4)\n",
201188
" plt.imshow(posneg(Rim), cmap='bwr')\n",
202-
" plt.title('right wheel ' + ('' if Rsign > 0 else ''))\n"
189+
" plt.title('right wheel ' + ('\u2191' if Rsign > 0 else '\u2193'))\n"
203190
]
204191
},
205192
{
@@ -214,7 +201,7 @@
214201
"cell_type": "markdown",
215202
"metadata": {},
216203
"source": [
217-
"Consider the agent that we gave you as a starting point - feel free to explore with using different code in [agent.py](../../packages/braitenberg_agent/agent.py). You may need to tune the `gain` and `const` values in the `BraitenbergAgentConfig` class to fit your agent and Duckiebot. Pay attention to use a combination of `gain` and `const` values in such a way that the motor inputs fall within the range of -1 to 1, otherwise you may encounter a `ValueError`."
204+
"Consider the agent that we gave you as a starting point - feel free to explore with using different code in [agent.py](../../packages/braitenberg_agent/agent.py). You may need to tune the `gain` and `const` values in the `BraitenbergAgentConfig` class to fit your agent and Duckiebot. Pay attention to use a combination of `gain` and `const` values in such a way that the motor inputs fall within the range of -1 to 1, otherwise you may encounter a `ValueError`."
218205
]
219206
}
220207
],
@@ -245,4 +232,4 @@
245232
},
246233
"nbformat": 4,
247234
"nbformat_minor": 4
248-
}
235+
}

0 commit comments

Comments
 (0)