This project aims to provide an OOP based heterogeneous swarm system independent of the vehicle types and motion dynamics. Currently we are using the system with crazyflies.
First of all, you need to install ROS noetic and crazyswarm. Choose the crazyswarm version for physical robot and simulation.
Build workspace.
mkdir -p ~/workspace_name/src
cd ~/workspace_name
catkin_make
Clone the ROS package.
cd ~/workspace_name/src
git clone https://github.com/METUrone/Swarm-22.git
cd ~/workspace_name
catkin_make
Source the workspace.
source ~/workspace_name/devel/setup.bash
Since crazyswarm searches for .yaml file containing the crazyflie information in the parent path, python script should be run in the scripts directory.
cd ~/workspace_name/src/Swarm-22/scripts
There are two options to start the script. If --sim is added after the script name, code will run on simulation mod. If not, crazyflies should start the mission in real-life.
rosrun swarm main.py --sim
Important Points:
-
The crazyflies.yaml file in crazyswarm workspace (
~/crazyswarm/ros_ws/src/crazyswarm/launch/crazyflies.yaml) and the one in the swarm package should contain the same information if the script in running in real-life. -
Crazyflies positions in real-life must be as close as possible to the positions which are determined in crazyflies.yaml files.
-
Comment out the lines between 152-171 in the CMakeList.txt file which is in the Swarm-22 folder. Run
catkin_make. Then return to the original version of CMakeList.txt and runcatkin_makeagain.