Skip to content

bisson2000/DroneMapping

Repository files navigation

Drone Mapping system

Demonstration of the requirements

SIMULATION

PHYSIQUE

R.F.7 - Retour à la base : https://youtu.be/qT0P7P8uJD8

AUTRES

Project Configuration for Ubuntu

Cloning project

This command requires a valid ssh key that is registered in GitLab

git clone [email protected]:polytechnique-montr-al/inf3995/20221/equipe-106/INF3995-106.git --recursive

Installing Dependencies

Docker:

You have to install docker

    sudo apt-get install docker-ce docker-ce-cli containerd.io

You will also need nvidia-docker if you have a nvidia gpu that is being used on ubuntu

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
   && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
   && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
   sudo apt-get update
   sudo apt-get install -y nvidia-docker2
   sudo systemctl restart docker

You can then test it with this command

sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

To get a detailed explanation of these steps please visit the official Nvidia documentation

Docker-compose:

You must also install docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

The minimum required version of docker-composed is 1.25.* unless you are using nvidia-docker then you must at least install version 1.29.*

Additional information about the installation is provided:Docker-Compose documentation

Automatic Launch

In order to launch the application you can simply execute the shell script present in the repository

./start.sh

The script will launch and configure all of the Docker containers

If the file is not recognized as an executable please run this next command from the root of the project

chmod u+x start.sh

Running tests

You can test each component of the project by running the start script with the test option (-t).

./start.sh -t

The test results will then be available in the terminal.

Manual Launch

This next part explains how to manually launch and configure the containers as Docker devcontainers

Graphic Card Configuration (OPTIONAL)

If you are using an NVIDIA GPU you must install additionnal software for the simulation to display properly in the container

Follow the instructions provided here : https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html (NOTE it is not necessary to reinstall Docker)

You also need to modify the devcontainer.json file located in INF3995-106/embedded/.devcontainer/ by replacing the runArgs section with the following

"runArgs": [
	  	//"--privileged",
	    //"--net=host",
		"--device=/dev/ttyUSB0",
		"--gpus=all", //Uncomment to use NVDIA GPU
		"-e",
		"DISPLAY=${env:DISPLAY}",
	],

Manually Lauching the project

To launch all the components of the project, you need the folders backend, frontend and embedded opened in vscode. Then using the Remote-Explorer extension from vscode, re-open all three folders in their respective container.

Launching the Client

In the devcontainer for the frontend directory. Once the container is built, open a terminal window inside vscode and run the command

npm run serve

Once the compilation is done, the client can now be accessed in a web-browser at http://localhost:8080

Lauching the Server

In the devcontainer for the frontend directory. Once the container is built, open a terminal widow inside vscode and run the command

python3 server.py

This will start the server and allow the client to connect to it.

Launching the simulation

In the devcontainer for the embedded directory.

Once the container is built, hit CTRL-SHIFT-P, select Tasks: Run Task and run the Install Argos3 Package Task

Afterwards, the same way as above, run the Compile Simulation Firmware Task

Then make sure the server and client are in their inital state (i.e. Have just been launched)

On the client, check the Simulation Toggle and press the Démarrer mission button

In the embedded devcontainer open a terminal inside vscode and run the commands

cd simulation
argos3 -c experiments/crazyflie_sensing.argos

A simulation window should pop-up

You can now start the simulation using the Play button and send commands to the drone with the Lancer Mission and Terminer mission buttons on the client.

Flashing the Drone

Make sure the CrazyRadio is connected to your computer.

In the devcontainer for the embedded directory, hit CTRL-SHIFT-P and select Remote-Containers: Rebuild Container

Once the container is re-built, hit CTRL-SHIFT-P, select Tasks: Run Task and run the Flash embedded firmware Task

The drones should now be flashed

Sending commands to the physical drones

Make sure the CrazyRadio is connected to your computer.

In the devcontainer for the server directory, hit CTRL-SHIFT-P and select Remote-Containers: Rebuild Container

Launch the client (See Launching the Client) Launch the server (See Launching the Server)

Make sure the drones have been flashed (See Flashing the Drone) and are powered on

On the client, do not check the Simulation Toggle button and press the Démarrer mission button

You should be able to select drone radio addresses in the top bar of the UI on the client. Selecting a Drone will allow you to send the identify command which will make its LED blink.

Coding style

The main coding style follows the Google coding style. https://google.github.io/styleguide/?fbclid=IwAR2KlL02zVoscso_aX_n-sn4-7QVHfnk01A4TJjdtIatdC5YVyx6PAKSUPw

To apply the coding style, we used:

For the frontend: eslint

For the backend: yapf

For the embedded: clang-format and clang-tidy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published