The flocking behavior package is a ROS package that implements a proximal control-based method for UAV self-organized flocking based on the work of Ferrante et al. (2012).
The package contains two central nodes:
-
SensorNeighbor: this node is responsible for receive and process the data used to obtain the range and bearing of the neighbors and then send it to the next node through publisher-subscriber communication. It can process the data generated by two methods:
- GPS - all the UAVs trades position's information through publisher-subscriber communication
- UVDAR - each UAV estimates the relative position of its neighbors using the UVDAR sensor
-
Formation: this node uses the relative range and bearing of the neighbors to transform this information into the position where the UAV should go to achieve or maintain the flocking behavior. It forces the UAV to follow three essential rules to accomplish the desired behavior:
- Keep a certain distance from its neighbors
- Keep moving forward
- Have non-holonomic movement
- ROS Noetic
- Multi-robot Systems Group UAV system
- UVDAR drivers and processing - Only for UVDAR scripts
- UVDAR Gazebo plugin - Only for UVDAR scripts
Follow the instructions to install our package into your machine and use it for testing in simulations
- Install all dependencies
- Clone the repository into a ROS workspace -
git clone https://github.com/thulioguilherme/flocking_behavior.git
- Build the package using catkin tools -
catkin build flocking_behavior
The package can be tested using the Multi-robot Systems Group UAV system. There are a few examples already settled in the scripts directory.
- Start one of the scripts from the simulation directory. The flocking behavior will start automatically after a few seconds if the parameter
auto_start
istrue
(seeconfig/flocking/default.yaml
). You don't do the following steps if this is the case. Only the optional step, if necessary.
cd scripts/($SELECTED_SCRIPT) && ./start.sh
- The following steps are only needed if the flocking behavior is not supposed to start automatically. After the takeoff, send the command to the UAVs to change to hover mode. For this, you need to call the service
send_command
from the nodeCommandSender
using the request value equals to0
.
rosservice call /command_sender/send_command "value: 0"
- Then send the command to the UAVs to start the flocking behavior. For this, you need to call the service
send_command
from the nodeCommandSender
using the request value equals to1
.
rosservice call /command_sender/send_command "value: 1"
-
The flocking behavior will stop manually after the duration is over.
-
(Optional) You can end the flocking behavior anytime calling the service
send_command
from the nodeCommandSender
using the request value equals to2
.
rosservice call /command_sender/send_command "value: 2"