Skip to content

KNR-PW/Dron_symulacja

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

KNR Drone Simulation - README

Installation Instructions

1. Install Docker

Ensure you have Docker installed on your system. You can follow the official installation guide:
Docker Installation Guide

2. Install NVIDIA Container Toolkit

For systems with NVIDIA GPUs, install the NVIDIA Container Toolkit (official installation guide):

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg

curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

sudo apt update
sudo apt install -y nvidia-container-toolkit
sudo systemctl restart docker

3. Pull the KNR Drone Simulation Docker Image

Download the prebuilt Docker image from Docker Hub:

docker image pull staskolo/knr-drone-sim:latest

4. Start the Docker Container

Navigate to the docker directory and execute the setup script:
If your host has nvidia gpu:

cd docker
./setup_container_gpu.sh staskolo/knr-drone-sim:latest

If your host doesnt have nvidia gpu:

cd docker
./setup_container_cpu.sh staskolo/knr-drone-sim:latest

Once executed, you will be attached to the newly created Docker container.

5. ROS2 Workspace and Build Process

Inside the container:

cd ~/ros_ws
colcon build
source install/setup.bash

6. Run Webots Simulation and ROS2 Packages

To launch the Webots simulator along with required ROS2 packages:

ros2 launch drone_bringup drone_simulation.launch.py

7. Run ArduPilot SITL (Software-in-the-Loop)

To start the ArduPilot SITL environment, open new terminal and run the following command outside the Docker container:

./run_ardupilot_sitl.sh

First run can take a while since ardupilot will build required components.

8. Control the Drone

You can now control the drone using:

  • Command-line interface
  • ROS2 interface

9. Managing the Docker Container

Detach from the container (keep it running):

Press Ctrl + P then Ctrl + Q

Reattach to a running container (no need to create new every time):

docker attach knr_drone

Start a stopped container:

docker start knr_drone

Stop the container:

docker stop knr_drone

10. Important Notes

  • The src directory is shared between the host and the Docker container. In the container, it is located at ~/ros_ws/src.
  • Your development code should be placed inside this directory to be visible in the container.
  • After stopping the container, its memory persists. However, if the container is removed, all data outside the shared src directory will be lost.
  • Keep everything in the src directory to prevent data loss.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published