d-ORCA: Usage


It is assumed that one of the machines in the network is powerful enough to handle the resource-intensive process of running the PX4 SITL simulation. The recommended configuration of the machine that is used to run the simulation is mentioned here. Also, this machine is usually configured as the master in the ROS network as explained in Setting up ROS Networks.

Launching the simulation

Inorder to launch the PX4 SITL simulation it is neccessary to create a roslaunch file that contains the xml commands to spawn the desired number of iris quadrotors in an empty gazebo world. This process is eased by the multiUAV.sh script provided along with the package by just executing it with the number of quadrotors to be spawned passed as input.

For example, to create a roslaunch file that can launch Gazebo with 30 drones run the following commands in the scripts directory of the package.

chmod +x multiUAV.sh
./multiUAV.sh 30

The number 30 can be replaced with the desired number of quadrotors that has to be spawned.

Note : The multiUAV.sh file has been written keeping in my mind the example program dorcacircle that is used to demonstrate the functioning of the package. Hence, the quadrotor’s default spawning location lies along the perimeter of a circle of radius 5. To modify this file, follow this tutorial.

Running the Simulation

Now that the roslaunch file is created, the simulation can be run on the master as shown below.

Go to the Firmware directory in the package and run the following commands to source the build directory of the PX4 package that was built in Installing d-ORCA package.

source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd):$(pwd)/Tools/sitl_gazebo

Note : Above commands have to be run each time a new terminal is used to launch the simulation.

Assuming that the roslaunch file has already been created as shown here, do the following from the Firmware directory of the package

cd launch
roslaunch px4 multiUAVLaunch.launch

Upon executing the above command, Gazebo should open with the desired number of quadrotors spawned at the locations mentioned in the roslaunch file.

Setting the dorca parameters

The parameters for d-ORCA can be set in params.yaml file in the config directory. The definition for each parameter is given in the file using which the user can set to a desired value. The advantage of setting the parameters this way is that the package need not built again on changing their values.

Creating/Editing launch file

The default dorca roslaunch file in the launch directory launches 30 nodes(each controlling 1 drone) running dorcacircle in the master which also passes the agent number for a particular node as its input. Inorder to distribute the nodes across machines few changes have to made to the roslaunch file. To learn more about modifying this file follow this tutorial.

Running the example program

Assuming that dorca.launch is modified in accordance with the simulation and machines in the network, we can launch the example program by running the following commands

cd ~/dorca_ws
source devel/setup.bash
roslaunch dorca dorca.launch

In the case of each machine controlling only one agent, the example program can also be executed by running the following command in each machine(agent) in the network.

rosrun dorca dorcacircle <agent no>

Note : Agent No in the above command varies for each machine which is user assigned. This tutorial explains how agent numbers are assigned to each agent.

Creating example programs

To understand and modify the existing example program circle.cpp follow this tutorial. You can also go through this tutorial on writing more example programs using the d-ORCA library.

Recommended master configuration

  • 8 core CPU
  • 3.60 GHz clock speed
  • 32 GB RAM
  • NVIDIA GeForce GTX 1080 Graphic Card