#!/bin/bash ## Bash script for setting up a PX4 development environment on Ubuntu LTS (16.04). ## It can be used for installing simulators (only) or for installing the preconditions for Snapdragon Flight or Raspberry Pi. ## ## Installs: ## - Common dependencies libraries and tools as defined in `ubuntu_sim_common_deps.sh` ## - Gazebo9 simulator echo "Downloading dependent script 'ubuntu_sim_common_deps.sh'" # Source the ubuntu_sim_common_deps.sh script directly from github common_deps=$(wget https://raw.githubusercontent.com/PX4/Devguide/v1.9.0/build_scripts/ubuntu_sim_common_deps.sh -O -) wget_return_code=$? # If there was an error downloading the dependent script, we must warn the user and exit at this point. if [[ $wget_return_code -ne 0 ]]; then echo "Error downloading 'ubuntu_sim_common_deps.sh'. Sorry but I cannot proceed further :("; exit 1; fi # Otherwise, source the downloaded script. . <(echo "${common_deps}") ### # Gazebo (9) simulator dependencies echo "Installing Gazebo9" sudo apt-get install protobuf-compiler libeigen3-dev libopencv-dev -y sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' ## Setup keys wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - ## Update the debian database: sudo apt-get update -y ## Install Gazebo9 sudo apt-get install gazebo9 -y ## For developers (who work on top of Gazebo) one extra package sudo apt-get install libgazebo9-dev -y # Go to the firmware directory cd $clone_dir/Firmware