Skip to content

patrickpbarroso/drone-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Drone Simulation Project

A simulation environment for multiple drones using the simulator Webots and the framework ROS2 (Robot Operating System) for implementing control logics.

Table of Contents

Installation

This project requires the instalation of ROS2 to work. The recommended version is ROS2 Humble, which can be installed by following the instructions on ROS2 Humble official website:

ROS2 Humble Installation Guide

Usage

Activate environment

In order to run the simulation, first you need to activate ROS2 on your machine by running the following command

source /opt/ros/humble/setup.bash

Then, make sure you're inside the project workspace and run

source install/local_setup.bash

Run simulation

Before running the simulation, run the following command, which will build ROS2 nodes

colcon build

Then, in order to run the simulation, run the following command

ros2 launch mavic_simulation robot_launch.py

This will execute the launcher of the project, install Webots if you don't have it already installed, ask how many drones are desired in the simulation and, finally, open the Webots window of the simulaton.

Control drones

Once the simulation has been launched successfully, run the following command to run the controller for a drone, changing the ID in teleop_twist_keyboard_Mavic_ID and cmd_vel_Mavic_ID to the index of the drone you want to control.

ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r __node:=teleop_twist_keyboard_Mavic_ID -r cmd_vel:=cmd_vel_Mavic_ID

Drones are counted from left to right, which means the leftmost drone is the drone with ID 1 and the rightmost drone is the drone with ID n, being n the amount of drones in the simulation.

About

Drone simulation using ros2 and webots.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published