mirror of
https://gitlab.waag.org/make/fablab/interns/2025/sam.git
synced 2025-08-03 20:04:56 +00:00
structuring the project and docs about drone code
This commit is contained in:
14
docs/Assignments/bootcamp/basic _linux_commands.md
Normal file
14
docs/Assignments/bootcamp/basic _linux_commands.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Basic linux terminal commands
|
||||
|
||||
## When do I need these?
|
||||
You need to know these commands if you wanna navigate a Unix like system like linux or macOS in the terminal. The terminal is used a lot for git so knowing these commands is a must.
|
||||
|
||||
## Commands
|
||||
| Command | Description |
|
||||
| --------- | ------------------------------------- |
|
||||
| cat | read a file and output it to terminal |
|
||||
| cd | change directory |
|
||||
| ls | view all files in the current folder |
|
||||
| ls -la | same as ls but also view hidden files |
|
||||
| rm <file> | remove a file |
|
||||
|
39
docs/Assignments/bootcamp/final_project.md
Normal file
39
docs/Assignments/bootcamp/final_project.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Idea final project
|
||||
|
||||
## Introduction
|
||||
I wanted to combine 2 random objects that interest me into one project. A drone and a jumbotron. So im gonna make a drone with multiple screens on it that could for example be used for traffic control or entertainment purposes.
|
||||
|
||||
## What does the drone do?
|
||||
The drone needs to be able to fly for atleast 20 minutes. It needs 2 screens on both side so it can display images or video. I wanna program the drone myself so I know how drones work and how they keep themselves upright.
|
||||
|
||||
|
||||
## Drone Requirements
|
||||
### basic requirements
|
||||
* 2 screens
|
||||
* Speakers
|
||||
* 20 min flight time
|
||||
* custom microcontroller pcb that controls the drones and screens
|
||||
* 50 meter range from controller
|
||||
|
||||
### Sensors
|
||||
* GPS
|
||||
* IMU/rotation sensor
|
||||
* Read voltage from battery know battery percentage
|
||||
|
||||
### Requirements when far ahead
|
||||
* Docking station
|
||||
* Automatic docking
|
||||
* Automatic pathing
|
||||
* Design own electronic speed controllers
|
||||
|
||||
|
||||
|
||||
|
||||
## Images
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
[last image credits](https://gareth-morrison.squarespace.com/drg)
|
51
docs/Assignments/bootcamp/git-setup.md
Normal file
51
docs/Assignments/bootcamp/git-setup.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Git setup
|
||||
|
||||
For me setting up git and ssh keys was really straight forward because I am currently studying IT.
|
||||
|
||||
## Generating ssh keys
|
||||
To be able to push and pull from the git server you need to give your public key to the git server. First we need te generate a ssh key. That can be done using this command.
|
||||
```bash
|
||||
ssh-keygen
|
||||
```
|
||||
After you run this command it will prompt you for a passphrase and a location to store it you can leave these blank and press enter on them. It will automaticly store them in `<user>/.ssh`.
|
||||
|
||||
## Reading the ssh keys
|
||||
|
||||
To read the ssh keys from the file you can use the `cat` command. `cat` reads the contents of a file no matter what file type it is and prints it out console.
|
||||
|
||||
The command wil probably look like this.
|
||||
```bash
|
||||
cat .ssh/id_ed25519.pub
|
||||
```
|
||||
Once you run that it outputs a key. That key is your public ssh key. You can share it with everyone and put it on server as a way to authenticate.
|
||||
|
||||
## Registering your key on the gitlab server
|
||||
|
||||
Now you can register the key that got output in the console on the gitlab server. First click your profile picture in gitlab and then go to edit profile. Now you have a menu bar on the left, there you can click the SSH Keys tab and register your ssh key. After you have done that you can push and pull from your gitlab repository.
|
||||
|
||||
## Cloning the repository
|
||||
To clone a git repository you need a link to the repository. When you press code on your project home you will see multiple links pop up. You will need the link that starts with `git@` and copy the entire link
|
||||
|
||||
Now you can go back to your console and type `git clone <link>` and then press enter. It will prompt you to trust the fingerprint of the server. When you've accepted that you have the repository on your local machine!🎉
|
||||
|
||||
## Git commands
|
||||
When you're working on your project you need to make commits and push to the server so your work is also stored over there. There are a few commands you need to use for that.
|
||||
|
||||
| Git command | Description |
|
||||
|-------------------------------- |------------------------------------------------------------ |
|
||||
| git clone <link> | clones a remote repository from the server to your machine |
|
||||
| git add <file> | stages a file to be committed |
|
||||
| git commit -m "commit message" | commits all staged files with the commit message |
|
||||
| git push | sends all the committed files to the remote server |
|
||||
|
||||
Git workflow:
|
||||
```mermaid
|
||||
graph LR
|
||||
|
||||
A[Work on your project] --> B[Stage your project files]
|
||||
B --> C[Commit the files with a message]
|
||||
C --> D[Push]
|
||||
```
|
||||
|
||||
## Extra notes
|
||||
Write clear commit messages because when you wanna return to a older version it's nice to know what changed since that commit.
|
59
docs/Assignments/bootcamp/global_lesson2_notes.md
Normal file
59
docs/Assignments/bootcamp/global_lesson2_notes.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# Lesson notes
|
||||
|
||||
|
||||
## 3D modelling
|
||||
### tips
|
||||
* sketch what you wanna make
|
||||
* When drawing what is your organic shape gonna be (cube, cylinder)
|
||||
* how big
|
||||
* what parts are gonna be in your project
|
||||
|
||||
### good practices
|
||||
* Work with real measurements (real units)
|
||||
* Start with simple shapes
|
||||
* Divide your model into sections (different components)
|
||||
* Use groups and name your parts
|
||||
* ctrl+s
|
||||
* iterate and review
|
||||
* document
|
||||
|
||||
### other things
|
||||
* Try making something simple in 3 different cad programs.
|
||||
* plan the final project in the first weeks
|
||||
|
||||
|
||||
## Electricity
|
||||
###
|
||||

|
||||
* V = Voltage
|
||||
* I = Ampere
|
||||
* R = Resistance
|
||||
|
||||
#### Videos and electronics (also applies to programming)
|
||||
* Work along videos as you're watching them.
|
||||
|
||||
### AI notice for electronics
|
||||
ask chat gpt to explain things as if you're 12 then 18 then as a electrical engineer.
|
||||
tldr: ramp up how complicated the explanation is.
|
||||
|
||||
|
||||
## Final project do's and dont's
|
||||
### Do's
|
||||
* 2D and 3D drawings
|
||||
* Try hiding the electronic parts
|
||||
* Document everything
|
||||
* Inside the video: conception construction and operation.
|
||||
* use purposeful holes.
|
||||
* research design, shape, material and durability
|
||||
* Make the project more personal
|
||||
|
||||
### Dont's
|
||||
* lasercut press fit box
|
||||
* loose wires
|
||||
* no breadboard
|
||||
* No glue gun
|
||||
|
||||
## Extra notes
|
||||
* keep on practicing its a full time job
|
||||
* don't strive for perfection
|
||||
*
|
33
docs/Assignments/bootcamp/imagemagick.md
Normal file
33
docs/Assignments/bootcamp/imagemagick.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# ImageMagick
|
||||
|
||||
## What is ImageMagick and why use it?
|
||||
ImageMagick is a tool to resize, convert or compress images. You can do all sorts of things with it. But right now we will be using it to compress images. So other people don't have to download hunderds of megabytes when cloning your project or viewing your website.
|
||||
|
||||
## How do I install it?
|
||||
ImageMagick can be installed on arch based systems using:
|
||||
```bash
|
||||
sudo pacman -Syu imagemagick
|
||||
```
|
||||
|
||||
## How do I use it?
|
||||
ImageMagick is a CLI tool so you need to use some kind of terminal. On arch based systems you can use it by typing `magick` after you've installed it.
|
||||
A ImageMagick command is build up with a input and a output and in between all the parameters for the conversion. Example:
|
||||
```bash
|
||||
magick imageInput.jpg -strip -quality 80% imageOutput.jpg
|
||||
```
|
||||
|
||||
## Image compression command examples
|
||||
This image compresses the image and strips it of all it's details like date and location.
|
||||
```bash
|
||||
magick source.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% result.jpg
|
||||
```
|
||||
|
||||
Same as above but resizes the image to 800 width and keeps the aspect ratio.
|
||||
```bash
|
||||
magick source.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% -resize 800x result.jpg
|
||||
```
|
||||
|
||||
## Sources
|
||||
* [installing ImageMagick](https://imagemagick.org/script/download.php)
|
||||
* [command source](https://stackoverflow.com/questions/7261855/recommendation-for-compressing-jpg-files-with-imagemagick)
|
||||
* [image resizing](https://legacy.imagemagick.org/Usage/resize/)
|
77
docs/Assignments/bootcamp/mkdocs.md
Normal file
77
docs/Assignments/bootcamp/mkdocs.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# How to set up your own documentation page using mkdocs
|
||||
|
||||
## What is Mkdocs and why use it?
|
||||
Mkdocs generates HTML from Markdown making an easy documentation page. So you don't have to struggle with html and css so you can focus on things more important.
|
||||
|
||||
## How to set it up
|
||||
For this project im going to use Gitlab CI pipelines. CI stands for continuous intergration. That means that with every push you can make something do. For example clean up code or generate a documentation page based on what you've written in markdown.
|
||||
|
||||
### Step 1 choosing a theme
|
||||
In [this](https://github.com/mkdocs/catalog) github repo there is a catalog of themes that you can choose. I went with the Ivory theme. (note this changed to material theme but the steps are still the same. [link](../week_1_fabacademy/customising_mkdocs.md))
|
||||
|
||||
### Step 2 preparing the envoirment
|
||||
You wanna create a couple of files. These all need to be in the root of your project.
|
||||
* `mkdocs.yml` The configuration file for mkdocs
|
||||
* `requirements.txt` The list of dependencies for the python package manager to install
|
||||
* `.gitlab-ci.yml` The script that builds and deploys you page
|
||||
|
||||
#### mkdocs.yml
|
||||
Lets start with mkdocs.yml. In this file is described how to page should look and be named. This is the base of a mkdocs file:
|
||||
```
|
||||
site_name: My Docs by GitLab Pages
|
||||
site_url: https://pages.gitlab.io/mkdocs
|
||||
site_dir: public
|
||||
theme: ivory
|
||||
```
|
||||
In here you can describe the site name and add the theme.
|
||||
|
||||
#### requirements.txt
|
||||
requirements.txt tell the python package manager (pip) what dependencies you want installed. For this project we need mkdocs and the theme you want installed.
|
||||
This is my requirements file
|
||||
```requirements.txt
|
||||
mkdocs>=1.5.3
|
||||
mkdocs-ivory>=0.4.6
|
||||
```
|
||||
To find the version number of the theme you want you need to open the package website and there you can find what the latest version it's on. You don't have to add the version numbers but I do it because if the package mainter sends out a broken update the package still works.
|
||||
|
||||
#### gitlab-ci.yml
|
||||
gitlab-ci.yml tells gitlab what to do when a commit is send out. For example this yml file builds a page and publishes it.
|
||||
```yml
|
||||
image: python:latest
|
||||
|
||||
before_script:
|
||||
- time apt update
|
||||
- time pip install -r requirements.txt
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
script:
|
||||
- time mkdocs build --site-dir public
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
changes:
|
||||
- "docs/**/*"
|
||||
- "mkdocs.yml"
|
||||
```
|
||||
|
||||
What does everything do?
|
||||
|
||||
| Variables | Description |
|
||||
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| image | Defines what OS should be used to for the scripts |
|
||||
| before_script | Commands to run before you run the script or build something |
|
||||
| pages | When this variable is mentioned gitlab knows it a pages job |
|
||||
| stage | Defines what stage the build process is in. This can be used to run jobs in parallel. for example: all early stage jobs at the same time and all main stage jobs at the same time. |
|
||||
| artifacts | Jobs can leave files. This tells them to save them |
|
||||
| path | This tells which files or folders to store as the artifacts |
|
||||
| rules | This tells when to run the pipline |
|
||||
| if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH | If the branch commited to is set to the default branch in gitlab. Then run the pipline |
|
||||
| changes | tell the pipline to only update when certain files or folders are changed |
|
||||
|
||||
## Sources
|
||||
* https://gitlab.com/pages/mkdocs
|
||||
* https://docs.gitlab.com/ee/ci/variables/index.html
|
||||
* https://docs.gitlab.com/ee/user/project/pages/
|
44
docs/Assignments/bootcamp/ssh_config.md
Normal file
44
docs/Assignments/bootcamp/ssh_config.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# SSH config files
|
||||
|
||||
## Why use ssh config files?
|
||||
SSH config files are nice to have when you need to connect to multiple servers and don't wanna type the entire an entire serveradress and username. For example: instead of `ssh user@serveradress.co` you can type `ssh hostname` and that saves some brainpower for the rest of the fabacademy!
|
||||
|
||||
## What can you do with ssh config files
|
||||
In SSH config files you can describe how connections should be handled and with which keys you want to use to log in onto a specific server and much more.
|
||||
|
||||
## How is a config file structured
|
||||
```config
|
||||
Host hostname1
|
||||
SSH_OPTION value
|
||||
SSH_OPTION value
|
||||
|
||||
Host hostname2
|
||||
SSH_OPTION value
|
||||
|
||||
Host *
|
||||
SSH_OPTION value
|
||||
```
|
||||
A entry always start with `Host` and then the name you wanna give to that host. After that you press enter and then tab. Now you can define the options for the ssh connections.
|
||||
|
||||
Example:
|
||||
```config
|
||||
HOST gitwaag
|
||||
Hostname gitlab.waag.org
|
||||
User git
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
IdentitiesOnly yes
|
||||
```
|
||||
In this config I defined the host as gitwaag. So I can connect to it using the command ```ssh gitwaag``` instead of ```ssh gitlab.waag.org```.
|
||||
|
||||
#### Explanation of the parameters used in this config above
|
||||
* `Hostname` Defines the hostname/domain of the server
|
||||
* `User` The username you wanna log in as on the server
|
||||
* `IdentityFile` Which public key you want to use for the connection
|
||||
* `IdentitiesOnly` Set it to only use the IdentityFile instead of other authentication files.
|
||||
|
||||
For a full list of parameters you can visit https://phoenixnap.com/kb/ssh-config or run `man ssh_config` in the terminal.
|
||||
|
||||
|
||||
## Sources:
|
||||
* https://linuxize.com/post/using-the-ssh-config-file/
|
||||
* https://phoenixnap.com/kb/ssh-config
|
56
docs/Assignments/week_1_fabacademy/customising_mkdocs.md
Normal file
56
docs/Assignments/week_1_fabacademy/customising_mkdocs.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# Customising Mkdocs
|
||||
|
||||
I wanna customise my mkdocs theme. So I can have a dark mode. Because it currently looks like this and having a nice looking documentation page is necessary too!
|
||||
|
||||

|
||||
|
||||
## Issues
|
||||
|
||||
### Attempt 1
|
||||
I tried changing it by referencing extra css but when it builded i looked through the job artifacts and I saw that it didnt pick up on the file
|
||||
|
||||
```yml
|
||||
site_name: Fab Academy docs page - Sam
|
||||
site_url: https://pages.gitlab.io/mkdocs
|
||||
site_dir: public
|
||||
theme:
|
||||
name: ivory
|
||||
extra_css: [extra.css]
|
||||
```
|
||||
```css
|
||||
.footer-note {
|
||||
color:rgb(47, 44, 44) !important
|
||||
}
|
||||
|
||||
.home .version {
|
||||
color:rgb(47, 44, 44) !important
|
||||
}
|
||||
```
|
||||
### Attempt 2
|
||||
After I read the documentation thoroughly i found out that the css file needs to be relative to the `docs` folder and not the `mkdocs.yml`. After that it showed the css and I could finaly customise the theme.
|
||||
|
||||
## Customising Material theme
|
||||
### Palette customisation
|
||||
I decided to switch to material theme because its easier to configure. There are premade color schemes and a lot of extensions that work out of the box.
|
||||
Example changing colors.
|
||||
```yaml
|
||||
theme:
|
||||
palette:
|
||||
primary: indigo
|
||||
accent: teal
|
||||
```
|
||||
Of yourse you could also use the extra.css to style the website even more.
|
||||
### Extensions
|
||||
You can add lot's of extensions. For example code highlighting or a table of contents on the right side of your website.
|
||||
This adds a table of contents. You can find all the extensions [here](https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#table-of-contents).
|
||||
```yaml
|
||||
markdown_extensions:
|
||||
- toc:
|
||||
permalink: true
|
||||
```
|
||||
|
||||
|
||||
### Links
|
||||
* [markdown extensions](https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#table-of-contents)
|
||||
* https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#table-of-contents
|
||||
* [mkdocs extra css](https://www.mkdocs.org/user-guide/customizing-your-theme/)
|
17
docs/Assignments/week_1_fabacademy/fritzing.md
Normal file
17
docs/Assignments/week_1_fabacademy/fritzing.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Fritzing
|
||||
|
||||
## What is fritzing
|
||||
|
||||
Fritzing is a program to draw circuits on breadboards to visualise them. You will see them a lot when looking for references on how to connect stuff on breadboards. For the first weeks I will be using this to sketch breadboards for later testing.
|
||||
|
||||
|
||||
## My first design
|
||||
I have made this design early to get started on programming the microcontroller so I have enough time to program the stabilasation algorithm
|
||||

|
||||
|
||||
|
||||
## Fritzing parts used
|
||||
|
||||
* [Xiao fritzing part](https://github.com/Seeed-Studio/fritzing_parts/tree/master/XIAO%20Accessories)
|
||||
* [Brushless motor fritzing part](https://forum.fritzing.org/uploads/short-url/yI6UtxbrrayJVaVYepkntRiD8MT.fzpz)
|
||||
* [ESC + DC motor part](https://johnny-five.readthedocs.io/en/latest/esc-PCA9685/)
|
24
docs/Assignments/week_1_fabacademy/lecture_notes.md
Normal file
24
docs/Assignments/week_1_fabacademy/lecture_notes.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Lecture notes
|
||||
|
||||
## Introduction FabAcademy
|
||||
|
||||
### Lectures
|
||||
First half of the class discuss homework of the week and discuss final projects.
|
||||
|
||||
### Dont's
|
||||
* Loose cables. Use ribbon cables.
|
||||
* No stringing on 3d printers
|
||||
|
||||
### Rescuing filament
|
||||
* Drying it by warming it up slowly
|
||||
* No microwave
|
||||
|
||||
## Project management
|
||||
|
||||
* Document as you go.
|
||||
* Compress your images for lower storage costs and faster website load times
|
||||
|
||||
## Weekly assignment
|
||||
* "You don't have to document git if you're already familiar with it"
|
||||
* We wanna know who you are
|
||||
* What is your possible final project
|
57
docs/Assignments/week_1_fabacademy/markdown.md
Normal file
57
docs/Assignments/week_1_fabacademy/markdown.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# Markdown
|
||||
|
||||
## What is Markdown
|
||||
Markdown is a markup language. It's used a lot for documenting because its easy to style and you dont have to struggle with html css when used with Mkdocs or Hugo.
|
||||
|
||||
## How do I use markdown
|
||||
Markdown can be used anywhere. You just simple have to create a file that ends with `.md`. If you wanna view the markdown that you're writing in vistual studio code you can click the icon below in the top right of your screen.
|
||||
|
||||

|
||||
|
||||
### Styling in markdown
|
||||
You can syle text by placing different operators around text.
|
||||
|
||||
Basic markdown syntax
|
||||
|
||||
|
||||
| Text | How to create it |
|
||||
| --------------------------------------------------- | ----------------------------------------------------- |
|
||||
| *very italic* | ```*a*``` |
|
||||
| **bold** | ```**bold**``` |
|
||||
| # Head 1 | ```# Head1``` |
|
||||
| ## Head 2 | ```## Head 2 ``` |
|
||||
| ### Head 3 | ```### Head 3 ``` |
|
||||
| `code` | suround text with ` |
|
||||
| [Link](https://www.youtube.com/watch?v=dQw4w9WgXcQ) | `[link](https://www.youtube.com/watch?v=dQw4w9WgXcQ)` |
|
||||
|  | ` ` |
|
||||
| | |
|
||||
|
||||
|
||||
## Markdown conventions
|
||||
All markdown files must start with a `Head1` otherwise Mkdocs won't understand the file and the pipline will crash.
|
||||
|
||||
## Drop down menu's
|
||||
|
||||
### How do I install drop down menus?
|
||||
Drop down menu's are part of the `pymdownx.details` extension. You need to place that in your `mkdocs.yml` under `markdown_extensions:` liket his:
|
||||
```yaml
|
||||
markdown_extensions:
|
||||
- pymdownx.details
|
||||
```
|
||||
|
||||
### How do I use it
|
||||
You can use it like this. Don't forget that you need to use 2 tabs to get the text in the collapsable box.
|
||||
```
|
||||
??? Notes
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent lacinia rutrum nibh sit amet pharetra. Aenean in metus fringilla, varius nulla eu, malesuada nulla. Praesent placerat tortor lacus, nec sollicitudin felis elementum sit amet. Nam mollis tincidunt arcu ac gravida. Vivamus turpis nisi, lacinia in eleifend sed, interdum ultricies quam.
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
??? Info
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent lacinia rutrum nibh sit amet pharetra. Aenean in metus fringilla, varius nulla eu, malesuada nulla. Praesent placerat tortor lacus, nec sollicitudin felis elementum sit amet. Nam mollis tincidunt arcu ac gravida. Vivamus turpis nisi, lacinia in eleifend sed, interdum ultricies quam.
|
||||
|
||||
## Sources
|
||||
* [markdown cheatsheet](https://www.markdownguide.org/cheat-sheet/)
|
Reference in New Issue
Block a user