A repository with the source code for launching a swarm of Pioneer-Max drones performing various tasks.
- ROS Noetic (installation: http://wiki.ros.org/noetic/Installation)
- Python 3.8 (Download: https://www.python.org/downloads/)
- Operator application on PC (https://github.com/SeriousBanan/gs_swarm_drones_operator)
-
Clone geoscan_pioneer_max repository if Pioneer-Max drone hasn't got it.
git clone https://github.com/geoscan/geoscan_pioneer_max.git cd geoscan_pioneer_max git submodule update --init -
Go to Geoscan ROS Workspace.
cd geoscan_ws/src -
Clone gs_swarm_drones repository.
git clone https://github.com/SeriousBanan/gs_swarm_drones.git
-
Build code in workspace.
cd <path to geoscan_ws> source /opt/ros/noetic/setup.bash catkin_make
-
Install required python modules.
python3 -m pip install -r <path to gs_swarm_drones>/requirements.txt
-
Go to folder with gs_swarm_drones repository.
cd <path to gs_swarm_drones>
-
Generate field file.
python3 scripts/generate_field.py <field with> <field_height> <vertex_width> <vertex_height>
It will generate json file
field.jsonwith field definition of vertexes (ids and positions) and edges between vertexes. -
Connect drones in one Network.
If NetworkManager disabled enable it by bash script.
bash bash/enable_NetworkManager.bash
After that drone stop his hotspot.
Connect to WiFi:
nmcli device wifi connect "<WiFi SSID>" password "<WiFi password>" name "<give name to connection>"
After that check the drone ip by ifconfig utile.
-
Fill json configuration file.
You need to remove
...and fill fields in configuration.json file:-
drone id: int value from 0 to count of all drones.
For example if you have 3 drones you can set here 0, 1 or 2.
-
drones count: int value of amount of drones.
-
drones initial positions: dict where keys - drone's ids, values - ids of vertexes where drone start it program (from field.json file).
For example it can be:
{ "0": 0, "1": 6 } -
drone flight altitude: float value of altitude on which drone fill flight.
-
addresses: dict where keys - drones's ids or operator, values - dict with ips and ports.
For example:
"0": { "ip": "192.168.1.19", "port": 10000 }
This information used to communication between drones and operator.
Example of full filled configuration file:
{ "drone id": 0, "drones count": 2, "drones initial positions": { "0": 6, "1": 0 }, "drone flight altitude": 1, "addresses": { "operator": { "ip": "192.168.1.2", "port": 10000 }, "0": { "ip": "192.168.1.19", "port": 10000 }, "1": { "ip": "192.168.1.18", "port": 10000 } }, "image file path": "received_image.png" } -
-
Install the switch on the remote control to the manual control mode.
-
Restart pioneer by terminal:
rospioneer restart
-
Set drones to it's start positions.
-
Move the switch on the console to the software mode.
Launch program:
roslaunch gs_swarm_drones gs_swarm_drones.launchAfter that drones will start waiting from operator command to start.
Click to button with label start and drones will takeoff.
When one drone found tank image from it's camera fill appear at right bottom corner.