Git Product home page Git Product logo

dronekit-sitl's Introduction

DroneKit-SITL

Logo

PyPi published version Windows Build status OS X Build Status Linux Build Status

SITL Runner for DroneKit.

Overview

The ArduPilot SITL (Software In The Loop) simulator allows you to simulate an ArduPilot based autopilot and communicate with it using MAVLink over the local IP network.

DroneKit-SITL is the fastest and easiest way to run SITL on Windows, Linux, or MAC OSX. It is installed from Python’s pip tool on all platforms, and provides a few simple commands to run pre-built vehicle binaries that are appropriate for the host operating system (downloading them if needed). You can even use it to run binaries you've build locally.

The tool is used extensively by DroneKit projects to test DroneKit apps and example code.

Note: DroneKit-SITL currently only supplies x86 binaries for Mac, Linux and Windows. You can't run it on ARM platforms like RaPi.

Installing

Install using pip (recommended):

pip install dronekit-sitl

Installing from Github master:

pip install git+https://github.com/dronekit/dronekit-sitl

The -UI or --upgrade --ignore-installed flags can be added to the commands to update an existing installation to the latest version.

Usage

List of available commands:

  dronekit-sitl --list
  dronekit-sitl --reset
  dronekit-sitl <copter(-version)> [parameters]
  dronekit-sitl <plane(-version)> [parameters]
  dronekit-sitl <rover(-version)> [parameters]
  dronekit-sitl <solo(-version)> [parameters]
  dronekit-sitl /path/to/local/binary [parameters]

The --list commmand is used to display the available build versions (e.g. copter-3.4-dev).

The -h parameter can be passed in the command above to list all the parameters to the build (these are reproduced below).

Option Description
--h Help (display help for the build - i.e. these parameters)
--home HOME Set home location (lat,lng,alt,yaw)
--model MODEL Set simulation model
--wipe Wipe eeprom and dataflash
--rate RATE Set SITL framerate
--console Use console instead of TCP ports
--instance N Set instance of SITL (adds 10*instance to all port numbers)
--speedup SPEEDUP Set simulation speedup
--gimbal Enable simulated MAVLink gimbal
--autotest-dir DIR set directory for additional files

Examples

The following command might be used to start SITL for build of copter-3.3:

dronekit-sitl copter-3.3 --home=-35.363261,149.165230,584,353

SITL starts and waits for TCP connections on 127.0.0.1:5760. In a second terminal you can spawn an instance of MAVProxy to forward messages to UDP ports 127.0.0.1:14550 and 127.0.0.1:14551 (in the same way as sim_vehicle.sh):

mavproxy.py --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --out 127.0.0.1:14550 --out 127.0.0.1:14551

Ardupilot versions available

You can get the available vehicle builds using the command:

dronekit-sitl --list

You can also view the pre-compiled Ardupilot Copter, Plane and Rover binaries at the links below:

Platform List
Copter http://dronekit-assets.s3-website-us-east-1.amazonaws.com/sitl/copter/
Plane http://dronekit-assets.s3-website-us-east-1.amazonaws.com/sitl/plane/
Rover http://dronekit-assets.s3-website-us-east-1.amazonaws.com/sitl/rover/
Solo http://dronekit-assets.s3-website-us-east-1.amazonaws.com/sitl/solo/

API

SITL exposes a Python API for managing a SITL instance.

from dronekit_sitl import SITL
sitl = SITL(path=apm) # load a binary path (optional)
sitl.download(system, version, verbose=False) # ...or download system (e.g. "copter") and version (e.g. "3.3")
sitl.launch(args, verbose=False, await_ready=False, restart=False)
sitl.block_until_ready(verbose=False) # explicitly wait until receiving commands
code = sitl.complete(verbose=False) # wait until exit
sitl.poll() # returns None or return code
sitl.stop() # terminates SITL

A simpler (but less flexible) interface is also available:

import dronekit_sitl
sitl = dronekit_sitl.start_default() # basic ArduCopter sim
connection_string = sitl.connection_string()
.
.
sitl.stop() # terminates SITL

License

dronekit-sitl is licensed as MIT, Apache-2.0, and GPLv3.

pysim is licensed as GPLv3.

Resources

dronekit-sitl's People

Contributors

givanfp avatar hamishwillee avatar mrpollo avatar peterbarker avatar pietrodn avatar sciencectn avatar squilter avatar tcr3dr avatar tshapinsky avatar wsilva32 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.