Permalink
Browse files

done

  • Loading branch information...
AndreaCensi committed Jun 22, 2018
0 parents commit 08e78a8d90f0329b6558cb1df4318ba98694f9fa
Showing with 2,052 additions and 0 deletions.
  1. +21 −0 .circleci/config.yml
  2. +25 −0 .gitattributes
  3. +5 −0 .gitignore
  4. +3 −0 .gitmodules
  5. +8 −0 Makefile
  6. +21 −0 README.md
  7. +15 −0 book/doc-template/index.md
  8. +5 −0 book/duckietown_high_school/00_book_dhs.md
  9. +46 −0 book/duckietown_high_school/35_project_high_school.md
  10. +1 −0 book/exercises/.gitignore
  11. +7 −0 book/exercises/00_part_exercise.md
  12. +3 −0 book/exercises/10-ROS-tutorial/160219 - Lab 03 - ROS tutorial.docx
  13. +67 −0 book/exercises/10_exercise_image_ops.md
  14. +123 −0 book/exercises/11_exercise_image_ops_adult.md
  15. +3 −0 book/exercises/20-data-processing/Module M02_RCDP - due Sunday Feb 28.docx
  16. +93 −0 book/exercises/25_exercise_ros_logs.md
  17. +54 −0 book/exercises/26_exercise_bag_decimate.md
  18. +58 −0 book/exercises/26_exercise_bag_thumbnails.md
  19. +74 −0 book/exercises/28_exercise_img_instagram.md
  20. +49 −0 book/exercises/29_exercise_bag_instagram.md
  21. +3 −0 book/exercises/30-git-and-conventions/160226 - Lab 04 - git and conventions.docx
  22. +3 −0 book/exercises/30-git-and-conventions/test_images/01_horz.png
  23. +3 −0 book/exercises/30-git-and-conventions/test_images/01_orig.png
  24. +3 −0 book/exercises/30-git-and-conventions/test_images/01_vert.png
  25. +3 −0 book/exercises/30-git-and-conventions/test_images/02_horz.png
  26. +3 −0 book/exercises/30-git-and-conventions/test_images/02_orig.png
  27. +3 −0 book/exercises/30-git-and-conventions/test_images/02_vert.png
  28. +3 −0 book/exercises/30-git-and-conventions/test_images/03_horz.png
  29. +3 −0 book/exercises/30-git-and-conventions/test_images/03_orig.png
  30. +3 −0 book/exercises/30-git-and-conventions/test_images/03_vert.png
  31. +3 −0 book/exercises/30-git-and-conventions/test_images/04_horz.png
  32. +3 −0 book/exercises/30-git-and-conventions/test_images/04_orig.png
  33. +3 −0 book/exercises/30-git-and-conventions/test_images/04_vert.png
  34. +45 −0 book/exercises/30_exercise_live_instagram.md
  35. +410 −0 book/exercises/40_exercise_image_pipeline.md
  36. +250 −0 book/exercises/40_exercise_image_pipeline_adult.md.old
  37. +40 −0 book/exercises/45_exercise_filtering_pf.md
  38. +39 −0 book/exercises/46_exercise_filtering_ekf.md
  39. +267 −0 book/exercises/90_exercise_sequence.md
  40. +47 −0 book/exercises/99_exercise_image_who_watches_the_watchmen.md
  41. +50 −0 book/exercises/ac-notes.txt
  42. +55 −0 book/exercises/generate_lane.py
  43. +3 −0 book/exercises/image-ops/image-ops-flip.jpg
  44. +3 −0 book/exercises/image-ops/image-ops-original.jpg
  45. +3 −0 book/exercises/image-ops/image-ops-side.jpg
  46. +5 −0 book/guide_for_instructors/00_guide_instructors.md
  47. +9 −0 book/guide_for_instructors/01_overview/00_part_overview.md
  48. +15 −0 book/guide_for_instructors/01_overview/05_how_to_use_this_guide.md
  49. +3 −0 book/guide_for_instructors/01_overview/10_previous_versions
  50. +21 −0 book/guide_for_instructors/05_sample_curricula/01_serial_parallel.md
  51. +60 −0 book/guide_for_instructors/10_pedagogical_resources/10_pedagogical_resources.md
  52. +4 −0 book/guide_for_instructors/10_pedagogical_resources/15_contributing.md
  53. +3 −0 book/guide_for_instructors/serial-parallel.png
@@ -0,0 +1,21 @@
version: 2
jobs:
build:
docker:
- image: andreacensi/mcdp_books:duckuments
resource_class: large
steps:
- checkout
- run:
name: Download resources
command: |
git submodule sync --recursive
git submodule update --init --recursive
- run:
name: Compile
command: make compile-native-ci
- store_artifacts:
path: duckuments-dist
destination: duckuments-dist
@@ -0,0 +1,25 @@
*.pdf filter=lfs diff=lfs merge=lfs -text
*.PDF filter=lfs diff=lfs merge=lfs -text
*.xlsx filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.JPG filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.PNG filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.JPEG filter=lfs diff=lfs merge=lfs -text
*.docx filter=lfs diff=lfs merge=lfs -text
*.pptx filter=lfs diff=lfs merge=lfs -text
*.key filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.eps filter=lfs diff=lfs merge=lfs -text
*.ipt filter=lfs diff=lfs merge=lfs -text
*.stl filter=lfs diff=lfs merge=lfs -text
*.SLDPRT filter=lfs diff=lfs merge=lfs -text
*.ai filter=lfs diff=lfs merge=lfs -text
*.SLDASM filter=lfs diff=lfs merge=lfs -text
*.SLDDRW filter=lfs diff=lfs merge=lfs -text
*.STL filter=lfs diff=lfs merge=lfs -text
*.world filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,5 @@
out
duckuments-dist
.DS_Store
node_modules
.idea
@@ -0,0 +1,3 @@
[submodule "resources"]
path = resources
url = git@github.com:duckietown/docs-resources.git
@@ -0,0 +1,8 @@
BASE:=book
BOOKNAME:=`ls -1 $(BASE) | head -n 1`
SRC:=book/$(BOOKNAME)
all:
cat README.md
include resources/makefiles/setup.Makefile
@@ -0,0 +1,21 @@
## Running using Docker
First run:
$ git submodule sync --recursive
$ git submodule update --init --recursive
# Installing Docker
Then install Docker:
$ make install-docker-ubuntu16
*Note*: you need to be in group `docker`. The script adds you, but it does not take effect immediately. You need to exit the console and re-enter.
# Compiling
Then compile using:
$ make compile-docker
@@ -0,0 +1,15 @@
# Book title {#book:template}
Logo
# A part {#part:part1}
baz
# A section {#sec1}
foo
# A section {#sec2}
bar
@@ -0,0 +1,5 @@
# Duckietown High School {#book:dhs status=ready}
Maintainer: Mauro
# Overview {#part:dhs-overview status=ready}
@@ -0,0 +1,46 @@
# Duckietown High School {status=beta}
TODO for Mauro D'Angelo: Some of this info might be outdated.
### Introduction
DuckietownHS is inspired by the Duckietown project and targeted for high schools. The goal is to build and program duckiebots capable of moving autonomously on the streets of Duckietown. The technical objectives of DuckietownHS are simplified compared to those of the Duckietown project intended for universities so it is perfectly suited to the technical knowledge of the classes involved. The purpose is to create self-driving DuckiebotHS vehicles which can make choices and move autonomously on the streets of Duckietown, using sensors installed on the vehicles and special road signs positioned within Duckietown.
Once DuckiebotHS have been assembled and programmed to meet the specifications contained in this document and issued by the "customer" Perlatecnica, special missions and games will be offered for DuckiebotHS. The participants can also submit their own missions and games.
Just like the university project, DuckietownHS is an open source project, a role-playing game, a means to raise awareness on the subject and a learning experience for everyone involved. The project is promoted by the non-profit organization [Perlatecnica][perlatecnica] based in Italy.
[perlatecnica]: http://www.perlatecnica.it
### Purpose
The project has two main purposes:
- It is a course where students and teachers take part in a role play and they take the typical professional roles of an engineering company. They must design and implement a Duckietown responding to the specifications of the project, assemble DuckiebotHS (DBHS), and develop the software that will run on them. The deliverables of the project will be tutorials, how-to, source code, documentation, binaries and images and them will be designed and manufactured according to the procedures of the DTE.
- In respect of that mentioned above, special missions and games for DBHS will be introduced by the "customer" Perlatecnica.
### Perlatecnica's role
Perlatecnica assumes the role of the customer and commissions the Duckietown Engineering company to design and construct the Duckietown and DuckiebotHS. It will provide all necessary product requirements and will assume the responsibility to validate the compliancy of all deliverables to the required specifications.
### The details of the project
The project consists in the design and realization of DuckiebotHS and DuckietownHS. They must have the same characteristics as the city of the University project as far as the size and color of the delimiting roadway bands is concerned but with a different type of management of the traffic lights system that regulates the passage of DuckiebotHS at intersections. The DuckietownHS (DTHS) and DuckiebotHS (DBHS) are defined in the documentation and there is little room for the DTE to make its own choices in terms of design. The reason for this is that the DBHS produced by the different DTE’s need to be identical from a hardware point of view so that the software development makes the difference.
### Where to start
The purchase of the necessary materials is the first step to take. For both DTHS and DBHS a list of these materials is provided with links to possible sellers. Even though Amazon is typically indicated as a seller this is nothing more than an indication to facilitate the purchase for those less experienced. It is left to the individual DTE to choose where to buy the required parts. It is allowed to buy and use parts that are not on the list but this is not recommended as they will make the Duckiebot unfit to enter in official competitions. When necessary an assembly tutorial will be provided together with the list of materials. Once the DTHS city and the DBHS robots have been assembled, the next step will be the development of the software for the running of both the city and the DuckiebotHS. The city and the Duckiebot run on a board based on a microcontroller STM32 from STMicroelectronics the Nucleo F401RE that will be programmed via the online development environment mbed. Perlatecnica will not release any of the official codes necessary for the navigation of the DuckiebotHS as these are owned by the DTE who developed them. The full standard document is available on the project official web site.
Each DTE may release the source code under a license Creative Commons CC BY-SA 4.0.
### The first mission of the Duckiebot
Once you have completed the assembly of all the parts that make up the Duckietown and DuckiebotHS you should start programming the microcontroller so that the Duckiebot can move independently.
The basic mission of the DuckiebotHS is to move autonomously on the roads respecting the road signs and traffic lights, choosing a random journey and without crashing into other DuckiebotHS.
For the development of the code, there are no architectural constraints, but we recommend proceeding with order and to focus primarily on its major functions and not on a specific mission.
The main functions are those of perception and movement.
Moving around in DuckietownHS, the DuckiebotHS will have to drive on straight roads, make 90 degree curves while crossing an intersection but also make other unexpected curves. While doing all this the Duckiebot can be supported by a gyroscope that provides guidance to the orientation of the vehicle.
@@ -0,0 +1 @@
*.log
@@ -0,0 +1,7 @@
# Exercises {#book:exercises status=ready nonumber=1}
Maintainer: Liam Paull
# Image operations {#part:image-ops status=ready}
These exercises can guide you from the status of a novice coder to experienced roboticist.
@@ -0,0 +1,67 @@
# Exercise: Basic image operations {#exercise-basic-image status=beta}
Assigned: Andrea Daniele
## Skills learned
- Accessing command line arguments.
- Reading and writing files.
- Working with pixel-based image representations.
- OpenCV and `duckietown_utils` APIs for reading/writing images.
## Instructions
Create an implementation of the program `dt-image-flip0`, specified below.
If this exercise is too easy for you, skip to [](#exercise-specifications).
## Specification of `dt-image-flip0`
The program `dt-image-flip0` takes as an argument a JPG file with extension `.jpg`:
$ dt-image-flip0 ![file].jpg
and creates a file called `![file].flipped.jpg` that is flipped around the horizontal axis.
<div figure-id="fig:example1" figure-class="flow-subfigures">
<img figure-id="subfig:original1" src='image-ops-original.jpg'/>
<img figure-id="subfig:flip1" src='image-ops-flip.jpg'/>
</div>
<figcaption id="fig:example:caption">
Example input-output for the program <code>dt-image-flip</code>.
</figcaption>
<figcaption id="subfig:original1:caption">
The original picture.
</figcaption>
<figcaption id="subfig:flip1:caption">
The flipped output
</figcaption>
## Useful APIs
### Load image from file
The OpenCV library provides a utility function called [`imread`](http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#imread)
that loads an image from a file.
### Flip an image
<!-- The OpenCV library provides a utility function called [`flip`](http://docs.opencv.org/2.4/modules/core/doc/operations_on_arrays.html?highlight=flip#flip)
that flips an image around vertical, horizontal, or both axes. -->
Comment: This is the kind of thing that they need to figure out how to do
with pixels. -AC
### Write an image to a file
The [`duckietown_utils`](http://purl.org/dth/duckietown-utils-library)
package provides the utility function [`write_image_as_jpg()`](#duckietown_utils-write_image_as_jpg)
that writes an image to a JPEG file.
@@ -0,0 +1,123 @@
# Exercise: Basic image operations, adult version {#exercise-specifications status=beta}
Assigned: Andrea Daniele
## Skills learned
- Dealing with exceptions.
- Using exit conditions.
- Verification and unit tests.
## Instructions
Implement the program `dt-image-flip` specified in the following section.
This time, we specify exactly what should happen for various anomalous conditions.
This allows to do automated testing of the program.
## `dt-image-flip` specification {#image-ops-specification}
The program `image-ops` expects exactly two arguments: a filename (a JPG file)
and a directory name.
$ dt-image-flip ![file] ![outdir]
If the file does not exist, the script must exit with error code `2`.
If the file cannot be decoded, the script must exit with error code `3`.
If the file exists, then the script must create:
- `![outdir]/regular.jpg`: a copy of the initial file
- `![outdir]/flip.jpg`: the file, flipped vertically.
- `![outdir]/side-by-side.jpg`: the two files, side by side.
If any other error occurs, the script should exit with error code `99`.
<div figure-id="fig:example-adult" figure-class="flow-subfigures">
<img figure-id="subfig:original" src='image-ops-original.jpg'/>
<img figure-id="subfig:flip" src='image-ops-flip.jpg'/>
<img figure-id="subfig:side" src='image-ops-side.jpg'/>
</div>
<figcaption id="fig:example-adult:caption">
Example input-output for the program <code>image-ops</code>.
</figcaption>
<figcaption id="subfig:original:caption">
The original picture.
</figcaption>
<figcaption id="subfig:flip:caption">
The output <code>flip.jpg</code>
</figcaption>
<figcaption id="subfig:side:caption">
The output <code>side-by-side.jpg</code>
</figcaption>
<style>
#fig\:example img {
height: 5em;
margin-left: 2em;
margin-right: 2em;
}
</style>
## Useful APIs
### Images side-by-side
Comment: Good explanation, but shouldn't it go in the previous exercise? -AC
An image loaded using the OpenCV function
[`imread`](http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#imread)
is stored in memory as a
[NumPy array](https://docs.scipy.org/doc/numpy-1.13.0/reference/arrays.html).
For example, the image shown above ([](#subfig:original)) will be represented in
memory as a NumPy array with shape `(96, 96, 3)`. The first dimension indicates
the number of pixels along the `Y-axis`, the second indicates the number of pixels
along the `X-axis` and the third is known as *number of channels* (e.g., **B**lue,
**G**reen, and **R**ed).
NumPy provides a utility function called
[`concatenate`][concatenate]
that joins a sequence of arrays along a given axis.
[concatenate]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.concatenate.html
## Testing it works with `image-ops-tester` {#image-ops-tester-specification}
We provide 4 scripts that can be used to make sure that you wrote a conforming `dt-image-flip`.
The scripts are `image-ops-tester-good`, `image-ops-tester-bad1`, `image-ops-tester-bad2`, and `image-ops-tester-bad3`.
You can find them in the directory
[`/exercises/dt-image-flip/image-ops-tester`](https://github.com/duckietown/duckuments/tree/master/exercises/dt-image-flip/image-ops-tester)
in the [`duckietown/duckuments`](https://github.com/duckietown/duckuments) repository.
The script called `image-ops-tester-good` tests your program in a situation in which we expect it to work properly.
The 3 “bad” test scripts (i.e., `image-ops-tester-bad1` through `image-ops-tester-bad3`) test your code in
situations in which we expect your program to complain in the proper way.
Use them as follows:
$ image-ops-tester-![scenario] ![candidate-program]
Note: The tester scripts must be called from their own location. Make sure to change your working directory to
`/exercises/dt-image-flip/image-ops-tester` before launching the tester scripts.
If the script cannot be found, `image-ops-tester-![scenario]` will return 1.
`image-ops-tester-![scenario]` will return 0 if the program exists and conforms
to the specification ([](#image-ops-specification)).
If it can establish that the program is not good, it will return 11.
## Bottom line {nonumber=1}
Things that are not tested are broken.
Oops, something went wrong.

0 comments on commit 08e78a8

Please sign in to comment.