- mavad : Networking + Planning stack of the co-simulator codebase
- pci : (Planner - Control Interface) Interface between mavad and MAVROS to further connect to PX4-SITL in Gazebo
- To use this project, you need to install ROS, MAVROS, PX4-SITL and NS3 (using CMake). Note that this project has been tested on Ubuntu 18.04 OS and ROS Melodic distribution. All the instructions to install these dependencies are given in the SETUP.md file
- Clone this repo in your systems and copy pci and planner_msgs to
fans_ws/src
(ROS workspace), mavad tons3-all-in-one/NS3
,sitl8drones.launch
to<path_to_fans_ws>/src/PX4-Autopilot/launch
, andpci8drones.launch
to<path_to_fans_ws>/src/pci/launch
cd ~
git clone https://github.com/Sarang-BITS/FANS.git
cp -r ~/FANS/planner_msgs <path_to_fans_ws>/src/
cp -r ~/FANS/pci <path_to_fans_ws>/src/
cp -r ~/FANS/mavad <path_to_ns3-all-in-one>/NS3/
cp ~/FANS/sitl8drones.launch <path_to_fans_ws>/src/PX4-Autopilot/launch/
cp ~/FANS/pci8drones.launch <path_to_fans_ws>/src/pci/launch/
- Build your ROS workspace (fans_ws)
cd <path_to_fans_ws>
catkin build
- Edit the
CMakeLists.txt
file ofns3-all-in-one/NS3
to buildmavad
cd <path_to_ns3-all-in-one>/NS3/
gedit CMakeLists.txt
- Add the following contents in the CMakelists.txt file and enable the option to build using emulation support
# Build mavad scripts
add_subdirectory(mavad)
option(NS3_EMU "Build with emu support" ON)
set(NS3_EMU ON)
- Build
mavad
(source your ROS workspace before building so it can findplanner_msgs
which is a dependency formavad
). After the build is successful, you would find an executablemavad_main
inside<path_to_ns3-all-in-one>/NS3/build
.
source <path_to_fans_ws>/devel/setup.bash
cd <path_to_ns3-all-in-one>/NS3/cmake-cache
make
- Running the simulation demo
- Launch the the drones with PX4 autopilot and MAVROS in Gazebo (in terminal 1). You should see 8 unarmed, landed drones in the Gazebo simulator window
source <path_to_fans_ws>/devel/setup.bash roslaunch px4 sitl8drones.launch
- Launch the planner control interface for the drones (in terminal 2). You should see the 8 drones armed and hovering at a certain height in the Gazebo simulator window.
Note : If you find only some of the drones hovering and others landed on the ground, kill the process (press Ctrl+C in terminal 2), let the drones land and run the launch file again.
source <path_to_fans_ws>/devel/setup.bash roslaunch pci pci8drones.launch
- Launch the network simulator and planner stack (in terminal 3). You should see the IP initialization and message communication logs in the terminal and the formation motion of drones in the Gazebo simulator window
cd <path_to_ns3-all-in-one>/NS3/build ./mavad_main
- Fire up the NetAnim visualizer to visualize message communication between nodes and their positions and open the XML trace file
<path_to-ns3-all-in-one>/NS3/build/planner_ns3_anim.xml
in it
cd <path_to-ns3-all-in-one>/netanim ./NetAnim
- Sarang Dhongdi
- Ojit Mehta
- Mihir Dharmadhikari
- Vaibhav Agarwal
- Vishal Singh
- Shambhavi Singh
- Aditya Bidwai
This work is supported by Science and Engineering Research Board (SERB-SRG/2019/001204), Government of India.
We would like to extend our special thanks of gratitude to Dr. Mohit P. Tahiliani for his valuable guidance throughout the course of this project
- main : Contains the entire co-simulator setup which integrates NS3 (networking) and PX4-SITL in Gazebo (robot simulator)
- no_ros : Contains the networking + planner stack with visualizations in NetAnim