mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
update Tools/setup/ dev environment setup scripts
- Ubuntu install NuttX toolchain, gazebo, and switch to python3 - OSX switch to python3
This commit is contained in:
@@ -28,8 +28,8 @@ fi
|
|||||||
|
|
||||||
# Python dependencies
|
# Python dependencies
|
||||||
sudo easy_install pip
|
sudo easy_install pip
|
||||||
sudo -H pip install --upgrade --force-reinstall pip
|
sudo -H python3 -m pip install --upgrade --force-reinstall pip
|
||||||
sudo -H pip install -I -r ${DIR}/requirements.txt
|
sudo -H python3 -m pip install -I -r ${DIR}/requirements.txt
|
||||||
|
|
||||||
# Optional, but recommended additional simulation tools:
|
# Optional, but recommended additional simulation tools:
|
||||||
if [[ $INSTALL_SIM == "--sim-tools" ]]; then
|
if [[ $INSTALL_SIM == "--sim-tools" ]]; then
|
||||||
|
|||||||
@@ -1,5 +1,20 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
INSTALL_NUTTX="true"
|
||||||
|
INSTALL_SIM="true"
|
||||||
|
|
||||||
|
# Parse arguments
|
||||||
|
for arg in "$@"
|
||||||
|
do
|
||||||
|
if [[ $arg == "--no-nuttx" ]]; then
|
||||||
|
INSTALL_NUTTX="false"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $arg == "--no-sim-tools" ]]; then
|
||||||
|
INSTALL_SIM="false"
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
# detect if running in docker
|
# detect if running in docker
|
||||||
if [ -f /.dockerenv ]; then
|
if [ -f /.dockerenv ]; then
|
||||||
@@ -34,11 +49,15 @@ fi
|
|||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
echo "Installing PX4 general dependencies"
|
||||||
|
|
||||||
sudo apt-get update -yy --quiet
|
sudo apt-get update -yy --quiet
|
||||||
sudo apt-get -yy --quiet --no-install-recommends install \
|
sudo apt-get -yy --quiet --no-install-recommends install \
|
||||||
astyle \
|
astyle \
|
||||||
bzip2 \
|
build-essential \
|
||||||
ccache \
|
ccache \
|
||||||
|
clang \
|
||||||
|
clang-tidy \
|
||||||
cmake \
|
cmake \
|
||||||
cppcheck \
|
cppcheck \
|
||||||
doxygen \
|
doxygen \
|
||||||
@@ -50,33 +69,94 @@ sudo apt-get -yy --quiet --no-install-recommends install \
|
|||||||
lcov \
|
lcov \
|
||||||
make \
|
make \
|
||||||
ninja-build \
|
ninja-build \
|
||||||
python-pip \
|
python3-pip \
|
||||||
python-pygments \
|
python3-pygments \
|
||||||
python-setuptools \
|
python3-setuptools \
|
||||||
rsync \
|
rsync \
|
||||||
shellcheck \
|
shellcheck \
|
||||||
unzip \
|
unzip \
|
||||||
wget \
|
wget \
|
||||||
xsltproc \
|
xsltproc \
|
||||||
zip
|
zip \
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
# python dependencies
|
# python dependencies
|
||||||
if [ -f /.dockerenv ]; then
|
echo "Installing PX4 Python dependencies"
|
||||||
# in docker install requirements system wide
|
|
||||||
sudo python -m pip install --upgrade pip setuptools wheel
|
# TODO: deprecate python 2
|
||||||
sudo python -m pip install -r ${DIR}/requirements.txt
|
sudo python -m pip install --upgrade pip setuptools wheel
|
||||||
else
|
sudo python -m pip install -r ${DIR}/requirements.txt
|
||||||
# otherwise only install for the user
|
|
||||||
python -m pip install --user --upgrade pip setuptools wheel
|
sudo python3 -m pip install --upgrade pip setuptools wheel
|
||||||
python -m pip install --user -r ${DIR}/requirements.txt
|
sudo python3 -m pip install -r ${DIR}/requirements.txt
|
||||||
|
|
||||||
|
|
||||||
|
# NuttX toolchain (arm-none-eabi-gcc)
|
||||||
|
if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||||
|
|
||||||
|
echo "Installing NuttX dependencies"
|
||||||
|
|
||||||
|
sudo apt-get -yy --quiet --no-install-recommends install \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
bison \
|
||||||
|
bzip2 \
|
||||||
|
flex \
|
||||||
|
gdb-multiarch \
|
||||||
|
gperf \
|
||||||
|
libncurses-dev \
|
||||||
|
libtool \
|
||||||
|
pkg-config \
|
||||||
|
vim-common \
|
||||||
|
;
|
||||||
|
|
||||||
|
# add user to dialout group (serial port access)
|
||||||
|
sudo usermod -a -G dialout $USER
|
||||||
|
|
||||||
|
|
||||||
|
# arm-none-eabi-gcc
|
||||||
|
NUTTX_GCC_VERSION="7-2017-q4-major"
|
||||||
|
|
||||||
|
GCC_VER_STR=$(arm-none-eabi-gcc --version)
|
||||||
|
STATUSRETVAL=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}")
|
||||||
|
|
||||||
|
if [ $STATUSRETVAL -eq "1" ]; then
|
||||||
|
echo "arm-none-eabi-gcc-${NUTTX_GCC_VERSION} found, skipping installation"
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "Installing arm-none-eabi-gcc-${NUTTX_GCC_VERSION}";
|
||||||
|
wget -O /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 && \
|
||||||
|
sudo tar -jxf /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 -C /opt/;
|
||||||
|
|
||||||
|
# add arm-none-eabi-gcc to user's PATH
|
||||||
|
exportline="export PATH=/opt/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}/bin:\$PATH"
|
||||||
|
|
||||||
|
if grep -Fxq "$exportline" $HOME/.profile;
|
||||||
|
then
|
||||||
|
echo "${NUTTX_GCC_VERSION} path already set.";
|
||||||
|
else
|
||||||
|
echo $exportline >> $HOME/.profile;
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# java (jmavsim or fastrtps)
|
# Simulation tools
|
||||||
# TODO: only install when necessary
|
if [[ $INSTALL_SIM == "true" ]]; then
|
||||||
sudo apt-get -y --quiet --no-install-recommends install \
|
|
||||||
default-jre-headless \
|
|
||||||
default-jdk-headless
|
|
||||||
|
|
||||||
# TODO: nuttx, raspberrypi, armhf generic
|
echo "Installing PX4 simulation dependencies"
|
||||||
|
|
||||||
# TODO: gazebo or ROS optional
|
# java (jmavsim or fastrtps)
|
||||||
|
sudo apt-get -yy --quiet --no-install-recommends install \
|
||||||
|
ant \
|
||||||
|
default-jre-headless \
|
||||||
|
default-jdk-headless \
|
||||||
|
;
|
||||||
|
|
||||||
|
# Gazebo
|
||||||
|
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
|
||||||
|
sudo apt-get update -yy --quiet
|
||||||
|
sudo apt-get -yy --quiet --no-install-recommends install gazebo9
|
||||||
|
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user