mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
WIP: in tree Dockerfile and github actions push to github registry
This commit is contained in:
@@ -130,7 +130,7 @@ pipeline {
|
|||||||
// TODO: actually upload artifacts to S3
|
// TODO: actually upload artifacts to S3
|
||||||
// stage('S3 Upload') {
|
// stage('S3 Upload') {
|
||||||
// agent {
|
// agent {
|
||||||
// docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
// docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
// }
|
// }
|
||||||
// options {
|
// options {
|
||||||
// skipDefaultCheckout()
|
// skipDefaultCheckout()
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
"parameters_metadata",
|
"parameters_metadata",
|
||||||
]
|
]
|
||||||
container:
|
container:
|
||||||
image: px4io/px4-dev-nuttx-focal:2021-04-29
|
image: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
|
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
- 'github-actions'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '*'
|
- '*'
|
||||||
@@ -11,7 +12,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: px4io/px4-dev-nuttx-focal:2021-04-29
|
container: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
config: [
|
config: [
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: px4io/px4-dev-nuttx-focal:2021-04-29
|
container: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
config: [
|
config: [
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
name: Build and publish Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'github-actions'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
px4/px4-dev:latest
|
||||||
|
ghcr.io/px4/px4-dev:latest
|
||||||
|
|
||||||
|
- name: Image digest
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
@@ -11,7 +11,7 @@ jobs:
|
|||||||
|
|
||||||
airframe:
|
airframe:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: px4io/px4-dev-base-focal:2021-04-29
|
container: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
|
|
||||||
module:
|
module:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: px4io/px4-dev-base-focal:2021-04-29
|
container: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
parameter:
|
parameter:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: px4io/px4-dev-base-focal:2021-04-29
|
container: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
|
|
||||||
uorb_graph:
|
uorb_graph:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: px4io/px4-dev-nuttx-focal:2021-04-29
|
container: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
@@ -80,7 +80,7 @@ jobs:
|
|||||||
|
|
||||||
micrortps_agent:
|
micrortps_agent:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: px4io/px4-dev-base-focal:2021-04-29
|
container: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
@@ -94,7 +94,7 @@ jobs:
|
|||||||
|
|
||||||
ROS_msgs:
|
ROS_msgs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: px4io/px4-dev-base-focal:2021-04-29
|
container: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
|
|
||||||
ROS2_bridge:
|
ROS2_bridge:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: px4io/px4-dev-base-focal:2021-04-29
|
container: ghcr.io/px4/px4-dev:2021-05-06
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
#
|
||||||
|
# PX4 development environment
|
||||||
|
#
|
||||||
|
|
||||||
|
FROM ubuntu:20.04
|
||||||
|
LABEL maintainer="Daniel Agar <daniel@agar.ca>"
|
||||||
|
|
||||||
|
COPY Tools/setup/ubuntu.sh /tmp/ubuntu.sh
|
||||||
|
COPY Tools/setup/requirements.txt /tmp/requirements.txt
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive /tmp/ubuntu.sh --no-sim-tools \
|
||||||
|
&& apt-get -y autoremove \
|
||||||
|
&& apt-get clean autoclean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
# create user with id 1001 (jenkins docker workflow default)
|
||||||
|
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user
|
||||||
|
|
||||||
|
ENV CCACHE_UMASK=000
|
||||||
|
ENV PATH="/usr/lib/ccache:$PATH"
|
||||||
|
|
||||||
|
# SITL UDP PORTS
|
||||||
|
EXPOSE 14556/udp
|
||||||
|
EXPOSE 14557/udp
|
||||||
|
|
||||||
|
# create and start as LOCAL_USER_ID
|
||||||
|
COPY Tools/setup/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||||
|
|
||||||
|
CMD ["/bin/bash"]
|
||||||
Vendored
+9
-9
@@ -85,7 +85,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('Airframe') {
|
stage('Airframe') {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'make distclean'
|
sh 'make distclean'
|
||||||
@@ -105,7 +105,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('Parameter') {
|
stage('Parameter') {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'make distclean'
|
sh 'make distclean'
|
||||||
@@ -125,7 +125,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('Module') {
|
stage('Module') {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'make distclean'
|
sh 'make distclean'
|
||||||
@@ -176,7 +176,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('Userguide') {
|
stage('Userguide') {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh('export')
|
sh('export')
|
||||||
@@ -206,7 +206,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('QGroundControl') {
|
stage('QGroundControl') {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh('export')
|
sh('export')
|
||||||
@@ -234,7 +234,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('microRTPS agent') {
|
stage('microRTPS agent') {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh('export')
|
sh('export')
|
||||||
@@ -264,7 +264,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('PX4 ROS msgs') {
|
stage('PX4 ROS msgs') {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh('export')
|
sh('export')
|
||||||
@@ -293,7 +293,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('PX4 ROS2 bridge') {
|
stage('PX4 ROS2 bridge') {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh('export')
|
sh('export')
|
||||||
@@ -336,7 +336,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('S3') {
|
stage('S3') {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
docker { image 'ghcr.io/px4/px4-dev:2021-05-06' }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh('export')
|
sh('export')
|
||||||
|
|||||||
+3
-5
@@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||||
echo "guessing PX4_DOCKER_REPO based on input";
|
echo "guessing PX4_DOCKER_REPO based on input";
|
||||||
if [[ $@ =~ .*px4_fmu.* ]]; then
|
if [[ $@ =~ .*navio2.* ]] || [[ $@ =~ .*raspberry.* ]] || [[ $@ =~ .*beaglebone.* ]] || [[ $@ =~ .*pilotpi.default ]]; then
|
||||||
# nuttx-px4fmu-v{1,2,3,4,5}
|
|
||||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-04-29"
|
|
||||||
elif [[ $@ =~ .*navio2.* ]] || [[ $@ =~ .*raspberry.* ]] || [[ $@ =~ .*beaglebone.* ]] || [[ $@ =~ .*pilotpi.default ]]; then
|
|
||||||
# beaglebone_blue_default, emlid_navio2_default, px4_raspberrypi_default, scumaker_pilotpi_default
|
# beaglebone_blue_default, emlid_navio2_default, px4_raspberrypi_default, scumaker_pilotpi_default
|
||||||
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2021-02-04"
|
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2021-02-04"
|
||||||
elif [[ $@ =~ .*pilotpi.arm64 ]]; then
|
elif [[ $@ =~ .*pilotpi.arm64 ]]; then
|
||||||
@@ -30,7 +27,7 @@ fi
|
|||||||
|
|
||||||
# otherwise default to nuttx
|
# otherwise default to nuttx
|
||||||
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-04-29"
|
PX4_DOCKER_REPO="ghcr.io/px4/px4-dev:2021-05-06"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# docker hygiene
|
# docker hygiene
|
||||||
@@ -67,4 +64,5 @@ docker run -it --rm -w "${SRC_DIR}" \
|
|||||||
--publish 14556:14556/udp \
|
--publish 14556:14556/udp \
|
||||||
--volume=${CCACHE_DIR}:${CCACHE_DIR}:rw \
|
--volume=${CCACHE_DIR}:${CCACHE_DIR}:rw \
|
||||||
--volume=${SRC_DIR}:${SRC_DIR}:rw \
|
--volume=${SRC_DIR}:${SRC_DIR}:rw \
|
||||||
|
-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -h $HOSTNAME
|
||||||
${PX4_DOCKER_REPO} /bin/bash -c "$1 $2 $3"
|
${PX4_DOCKER_REPO} /bin/bash -c "$1 $2 $3"
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
.PHONY: docker_build docker_push all
|
||||||
|
|
||||||
|
DATE := $(shell date +%Y-%m-%d)
|
||||||
|
|
||||||
|
docker_build:
|
||||||
|
docker build -f Dockerfile -t px4-dev:${DATE} .
|
||||||
|
|
||||||
|
docker_push: build
|
||||||
|
docker push px4io/px4-dev:${DATE}
|
||||||
|
|
||||||
|
all: docker_build
|
||||||
Regular → Executable
Executable
+27
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Start virtual X server in the background
|
||||||
|
# - DISPLAY default is :99, set in dockerfile
|
||||||
|
# - Users can override with `-e DISPLAY=` in `docker run` command to avoid
|
||||||
|
# running Xvfb and attach their screen
|
||||||
|
if [[ -x "$(command -v Xvfb)" && "$DISPLAY" == ":99" ]]; then
|
||||||
|
echo "Starting Xvfb"
|
||||||
|
Xvfb :99 -screen 0 1600x1200x24+32 &
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if the ROS_DISTRO is passed and use it
|
||||||
|
# to source the ROS environment
|
||||||
|
if [ -n "${ROS_DISTRO}" ]; then
|
||||||
|
source "/opt/ros/$ROS_DISTRO/setup.bash"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use the LOCAL_USER_ID if passed in at runtime
|
||||||
|
if [ -n "${LOCAL_USER_ID}" ]; then
|
||||||
|
echo "Starting with UID : $LOCAL_USER_ID"
|
||||||
|
# modify existing user's id
|
||||||
|
usermod -u $LOCAL_USER_ID user
|
||||||
|
# run as user
|
||||||
|
exec gosu user "$@"
|
||||||
|
else
|
||||||
|
exec "$@"
|
||||||
|
fi
|
||||||
@@ -1,24 +1,26 @@
|
|||||||
argcomplete
|
argcomplete
|
||||||
argparse>=1.2
|
argparse
|
||||||
cerberus
|
cerberus
|
||||||
coverage
|
coverage
|
||||||
empy>=3.3
|
empy>=3.3
|
||||||
jinja2>=2.8
|
jinja2>=2.8
|
||||||
|
jsonschema
|
||||||
|
kconfiglib
|
||||||
matplotlib>=3.0.*
|
matplotlib>=3.0.*
|
||||||
numpy>=1.13
|
numpy>=1.13
|
||||||
nunavut>=1.1.0
|
nunavut>=1.1.0
|
||||||
packaging
|
packaging
|
||||||
pandas>=0.21
|
|
||||||
pkgconfig
|
pkgconfig
|
||||||
psutil
|
psutil
|
||||||
pygments
|
pygments
|
||||||
wheel>=0.31.1
|
|
||||||
pymavlink
|
pymavlink
|
||||||
pyros-genmsg
|
pyros-genmsg
|
||||||
pyserial>=3.0
|
pyserial>=3.0
|
||||||
pyulog>=0.5.0
|
pyulog>=0.5.0
|
||||||
pyyaml
|
pyyaml
|
||||||
requests
|
requests
|
||||||
|
serial
|
||||||
setuptools>=39.2.0
|
setuptools>=39.2.0
|
||||||
six>=1.12.0
|
six>=1.12.0
|
||||||
toml>=0.9
|
toml>=0.9
|
||||||
|
wheel>=0.31.1
|
||||||
|
|||||||
+28
-45
@@ -31,10 +31,9 @@ done
|
|||||||
# detect if running in docker
|
# detect if running in docker
|
||||||
if [ -f /.dockerenv ]; then
|
if [ -f /.dockerenv ]; then
|
||||||
echo "Running within docker, installing initial dependencies";
|
echo "Running within docker, installing initial dependencies";
|
||||||
apt-get --quiet -y update && DEBIAN_FRONTEND=noninteractive apt-get --quiet -y install \
|
apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
gnupg \
|
gosu \
|
||||||
lsb-core \
|
|
||||||
sudo \
|
sudo \
|
||||||
wget \
|
wget \
|
||||||
;
|
;
|
||||||
@@ -53,7 +52,7 @@ fi
|
|||||||
|
|
||||||
# check ubuntu version
|
# check ubuntu version
|
||||||
# otherwise warn and point to docker?
|
# otherwise warn and point to docker?
|
||||||
UBUNTU_RELEASE="`lsb_release -rs`"
|
UBUNTU_RELEASE=$(cat /etc/os-release | grep VERSION_ID | cut -d "\"" -f 2)
|
||||||
|
|
||||||
if [[ "${UBUNTU_RELEASE}" == "14.04" ]]; then
|
if [[ "${UBUNTU_RELEASE}" == "14.04" ]]; then
|
||||||
echo "Ubuntu 14.04 is no longer supported"
|
echo "Ubuntu 14.04 is no longer supported"
|
||||||
@@ -63,16 +62,18 @@ elif [[ "${UBUNTU_RELEASE}" == "16.04" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
elif [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
|
elif [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
|
||||||
echo "Ubuntu 18.04"
|
echo "Ubuntu 18.04"
|
||||||
|
|
||||||
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
||||||
echo "Ubuntu 20.04"
|
echo "Ubuntu 20.04"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installing PX4 general dependencies"
|
echo "Installing PX4 general dependencies"
|
||||||
|
|
||||||
sudo apt-get update -y --quiet
|
sudo apt-get -qq update
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \
|
||||||
astyle \
|
astyle \
|
||||||
build-essential \
|
build-essential \
|
||||||
ccache \
|
ccache \
|
||||||
@@ -93,20 +94,23 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends i
|
|||||||
python3-wheel \
|
python3-wheel \
|
||||||
rsync \
|
rsync \
|
||||||
shellcheck \
|
shellcheck \
|
||||||
unzip \
|
|
||||||
zip \
|
|
||||||
;
|
;
|
||||||
|
|
||||||
if [[ "${UBUNTU_RELEASE}" == "16.04" ]]; then
|
if [[ "${UBUNTU_RELEASE}" == "16.04" ]]; then
|
||||||
echo "Installing Ubuntu 16.04 PX4-compatible ccache version"
|
echo "Installing Ubuntu 16.04 PX4-compatible ccache version"
|
||||||
wget -O /tmp/ccache_3.4.1-1_amd64.deb http://launchpadlibrarian.net/356662933/ccache_3.4.1-1_amd64.deb
|
wget -q -O /tmp/ccache_3.4.1-1_amd64.deb http://launchpadlibrarian.net/356662933/ccache_3.4.1-1_amd64.deb
|
||||||
sudo dpkg -i /tmp/ccache_3.4.1-1_amd64.deb
|
sudo dpkg -i /tmp/ccache_3.4.1-1_amd64.deb
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Python3 dependencies
|
# Python3 dependencies
|
||||||
echo
|
echo
|
||||||
echo "Installing PX4 Python3 dependencies"
|
echo "Installing PX4 Python3 dependencies"
|
||||||
python3 -m pip install --user -r ${DIR}/requirements.txt
|
if [ -f /.dockerenv ]; then
|
||||||
|
# system wide for docker
|
||||||
|
python3 -m pip install -r ${DIR}/requirements.txt
|
||||||
|
else
|
||||||
|
python3 -m pip install --user --quiet -r ${DIR}/requirements.txt
|
||||||
|
fi
|
||||||
|
|
||||||
# NuttX toolchain (arm-none-eabi-gcc)
|
# NuttX toolchain (arm-none-eabi-gcc)
|
||||||
if [[ $INSTALL_NUTTX == "true" ]]; then
|
if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||||
@@ -114,33 +118,13 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
|||||||
echo
|
echo
|
||||||
echo "Installing NuttX dependencies"
|
echo "Installing NuttX dependencies"
|
||||||
|
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \
|
||||||
automake \
|
|
||||||
binutils-dev \
|
|
||||||
bison \
|
|
||||||
build-essential \
|
|
||||||
flex \
|
|
||||||
g++-multilib \
|
g++-multilib \
|
||||||
gcc-multilib \
|
gcc-multilib \
|
||||||
gdb-multiarch \
|
gdb-multiarch \
|
||||||
genromfs \
|
genromfs \
|
||||||
gettext \
|
|
||||||
gperf \
|
|
||||||
kconfig-frontends \
|
|
||||||
libelf-dev \
|
|
||||||
libexpat-dev \
|
|
||||||
libgmp-dev \
|
|
||||||
libisl-dev \
|
|
||||||
libmpc-dev \
|
|
||||||
libmpfr-dev \
|
|
||||||
libncurses5-dev \
|
|
||||||
libncursesw5-dev \
|
|
||||||
libtool \
|
|
||||||
pkg-config \
|
pkg-config \
|
||||||
screen \
|
screen \
|
||||||
texinfo \
|
|
||||||
u-boot-tools \
|
|
||||||
util-linux \
|
|
||||||
vim-common \
|
vim-common \
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -164,7 +148,7 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
|||||||
|
|
||||||
else
|
else
|
||||||
echo "Installing arm-none-eabi-gcc-${NUTTX_GCC_VERSION}";
|
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/${NUTTX_GCC_VERSION_SHORT}/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-${INSTALL_ARCH}-linux.tar.bz2 && \
|
wget -q -O /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/${NUTTX_GCC_VERSION_SHORT}/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-${INSTALL_ARCH}-linux.tar.bz2 && \
|
||||||
sudo tar -jxf /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 -C /opt/;
|
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
|
# add arm-none-eabi-gcc to user's PATH
|
||||||
@@ -185,37 +169,36 @@ if [[ $INSTALL_SIM == "true" ]]; then
|
|||||||
echo "Installing PX4 simulation dependencies"
|
echo "Installing PX4 simulation dependencies"
|
||||||
|
|
||||||
# General simulation dependencies
|
# General simulation dependencies
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \
|
||||||
bc \
|
bc \
|
||||||
;
|
;
|
||||||
|
|
||||||
if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
|
if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
|
||||||
java_version=11
|
|
||||||
gazebo_version=9
|
gazebo_version=9
|
||||||
|
MAVSDK_VERSION=0.39.0
|
||||||
|
wget -q "https://github.com/mavlink/MAVSDK/releases/download/v${MAVSDK_VERSION}/mavsdk_{MAVSDK_VERSION})_ubuntu18.04_amd64.deb" -O /tmp/mavsdk.deb && sudo dpkg -i /tmp/mavsdk.deb
|
||||||
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
||||||
java_version=14
|
|
||||||
gazebo_version=11
|
gazebo_version=11
|
||||||
|
MAVSDK_VERSION=0.39.0
|
||||||
|
wget -q "https://github.com/mavlink/MAVSDK/releases/download/v{MAVSDK_VERSION}/mavsdk_{MAVSDK_VERSION}_ubuntu20.04_amd64.deb" -O /tmp/mavsdk.deb && sudo dpkg -i /tmp/mavsdk.deb
|
||||||
else
|
else
|
||||||
java_version=14
|
|
||||||
gazebo_version=11
|
gazebo_version=11
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Java (jmavsim or fastrtps)
|
# Java (jmavsim or fastrtps)
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \
|
||||||
ant \
|
ant \
|
||||||
openjdk-$java_version-jre \
|
default-jre-headless \
|
||||||
openjdk-$java_version-jdk \
|
default-jdk-headless \
|
||||||
libvecmath-java \
|
libvecmath-java \
|
||||||
;
|
;
|
||||||
|
|
||||||
# Set Java 11 as default
|
|
||||||
sudo update-alternatives --set java $(update-alternatives --list java | grep "java-$java_version")
|
|
||||||
|
|
||||||
# Gazebo
|
# 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 sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
|
||||||
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
|
wget -q http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
|
||||||
# Update list, since new gazebo-stable.list has been added
|
# Update list, since new gazebo-stable.list has been added
|
||||||
sudo apt-get update -y --quiet
|
sudo apt-get update -qq
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \
|
||||||
dmidecode \
|
dmidecode \
|
||||||
gazebo$gazebo_version \
|
gazebo$gazebo_version \
|
||||||
gstreamer1.0-plugins-bad \
|
gstreamer1.0-plugins-bad \
|
||||||
|
|||||||
Reference in New Issue
Block a user