Thursday, August 9, 2018

PX4 SITL Dronekit

  • dependencies
  • run jmavsim as simulator
  • run dronekit sample code

Install dependencies

sudo apt-get install python-jinja2 sudo pip install numpy toml

Download PX4 and build

  • ROS and gazebo are preinstalled
  • mkdir px4 cd px4 git clone https://github.com/PX4/Firmware.git cd Framework wget https://raw.githubusercontent.com/PX4/Devguide/master/build_scripts/ubuntu_sim_common_deps.sh source ubuntu_sim_common_deps.sh #First Build (Using the jMAVSim Simulator) make posix jmavsim

    DroneKit

    dronekit
    • droneKit
    • dronekit-sitl
    sudo pip install dronekit

    Demo

    • Dronekit read data from PX4 SITL
    • Run PX4 SITL (simulation)

    dronekit sample code

    from dronekit import connect, VehicleMode connection_string = "127.0.0.1:14540" # Connect to the Vehicle. print("Connecting to vehicle on: %s" % (connection_string,)) vehicle = connect(connection_string, wait_ready=True) # Get some vehicle attributes (state) print " System status: %s" % vehicle.system_status.state

    Run gazebo simulation (without gzclient)

    HEADLESS=1 make posix_sitl_default gazebo

    No comments: