Skip to content

Sarang-BITS/FANS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FANS : Flying Ad-hoc Network Simulator (main branch)

Content Description

  • 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

Setup and demo

  • 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 to ns3-all-in-one/NS3, sitl8drones.launch to <path_to_fans_ws>/src/PX4-Autopilot/launch, and pci8drones.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 of ns3-all-in-one/NS3 to build mavad
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 find planner_msgs which is a dependency for mavad). After the build is successful, you would find an executable mavad_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

Contributors

Acknowledgement

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

Related Publication

FANS: Flying Ad-hoc Network Simulator

Branches

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published