/supaero2024

Robotics class, 2024 edition

Primary LanguageJupyter NotebookBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Supaero robotics, 2024

This repository contains the exercices for the robotics class at Supaero, 2024. The exercices are organized by notebook. Each notebook corresponds to one chapter of the class. The notebooks are in Python and based on the software Pinocchio.

Set up

Default setup

This setup should work on Linux / MacOS / WSL2.

You must use a virtualenv or a similar.

For example on Debian/Ubuntu, you can get started with:

sudo apt install python-is-python3 python3-pip python3-venv

To create a virtual environment and activate it:

python -m venv .venv
source .venv/bin/activate

Once in your virtual environment, install this package:

pip install -U pip
pip install .

After that, you can start the server with jupyter notebook

Docker

If the default setup is not working for you, as a backup solution, a Docker image is provided, and can be started with:

docker run --rm -p 7000:7000 -p 7001:7001 -p 7002:7002 -p 7003:7003 -p 7004:7004 -p 8888:8888 -v data:/home/user/tp -it gepetto/supaero2024

On Linux host systems, you may simply start the Docker with:

docker run --rm --net host -v data:/home/user/tp -it gepetto/supaero

In case of big update, you must update the docker:

docker pull gepetto/supaero2024

Use

Update the notebooks

If the repository changes (for example when new tutorials are pushes), you need to update your local version by "pulling" it from the repository. On a native installation, just go in the folder containing the tutorials and execute git pull

With a docker, execute the following:

docker run --rm -v data:/home/user/tp -it gepetto/supaero git pull --rebase origin main

To avoid conflict when pulling a new version, you should better do your modifications in copy of the original files, not directly in the original files itself. We then strongly suggest that you don't work on the notebooks directly, but on a copy of it (save 0-introduction_to_numerical_robotics.ipynb into something like 0_mycopy.ipynb before working on it).

Side notes

Installing docker

See how to get Docker.

Docker as normal user

To avoid the need to run sudo docker:

sudo usermod -aG docker nmansard
newgrp docker

Join me on [Matrix]

[Matrix] is a distributed chat system that will be used during the class. Consider creating an account and join the classroom channel.

Set up of the system ... for admin only

Build and push the docker

Build the docker as specified in Dockerfile. You need the buildkit for that. The following file +/etc/docker/deamon_json+ should contain:

{ "features" : { "buildkit" : true } }

Add DOCKER_BUILDKIT=1 in your environment and restart docker.

sudo systemctl restart docker
export DOCKER_BUILDKIT=1

Then build:

docker build -t gepetto/supaero2024 .

Log to Docker-hub using your credentials.

docker login

Use the login corresponding to +https://hub.docker.com/+. And push it to the Gepetto repository of Docker-hub.

docker push gepetto/supaero2024