top of page

DroneKit-Python SITL 2D Simulation


Software in The Loop, or SITL in short is the simulation of a virtual drone on your front yard for testing and debugging on your programming codes. The reason why SITL is being used is due to the limitations of external factors.

Initially, the drone was tested with an assisted simulation in life, with the need to involve different personnels to carry out the testing with the propellers removed from the drone. This raises a few issues:

  1. Simulation of the increase in altitude

  2. “Hearing” the change in direction

  3. Waiting for a GPS fix

The team had to walk up a few floors just to simulate the altitude to see if the code behaves as desired. The need to constantly wait for a GPS downplays the role significantly. Not just that, it is relatively difficult to judge if the drone is behaving the way as the algorithm has commanded it to operate. With all these factors in mind, the team had digged into software simulation, and has used it for developments.

The SITL was then set up on a MacBook Pro. To simulate the vehicle, one must run a few lines in the Terminal which involves the use of pip. One of the primary reason why the team faced hurdles installing SITL at the first place was due to pip. Python must first be installed on your OS platform.

To install python, firstly we need to set up homebrew:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Once the homebrew is successfully, Homebrew directory must be inserted at the top of the PATH environment variable. To do this, locate the file named ~/. profile and add the following line at the bottom of the page.

export PATH=/usr/local/bin:/usr/local/sbin: $PATH

The final step then allows us to install python 2.7 by running:

$ brew install python

For the MacBook users who have previously installed Homebrew or Python 2.7, all steps can be skipped.

To install DroneKit, with SITL:

$ pip install dronekit

$ pip install dronekit-sitl

It is also possible to connect the simulation, or real flight to an android device as shown below.


About Me.

I'm a paragraph. Click here to add your own text and edit me. I’m a great place for you to tell a story and let your users know a little more about you.

  • Black Facebook Icon
  • Black Instagram Icon
  • Black Twitter Icon
Never Miss a Post!
bottom of page