From f026f52f8ea651f530e9d3474f19fcf2a4dafa6c Mon Sep 17 00:00:00 2001 From: Joe Macek Date: Sun, 29 Sep 2019 15:47:23 -0400 Subject: [PATCH 1/2] revert to pulling px4 firmware from github, add temporary command to build sim --- Makefile | 10 ++++++++++ scripts/setup_sim.sh | 7 ++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b353a8b..10ecfbe 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,18 @@ clean: nuke: cd; rm -r /software/bin; rm -r /software/lib; rm -r /software/build +# Temporary command to build gazebo and px4 firmware until this is in setup_sim.sh +# Only call this from within the docker container - make sure you have the new image +setup-sim: + pwd + cd /PX4Firmware + num_procs_avail=$(($(grep -c ^processor /proc/cpuinfo)-1)) + make posix_sitl_default gazebo -j$((num_procs_avail > 1 ? num_procs_avail : 1)) + + .PHONY: build .PHONY: bash .PHONY: run-all .PHONY: clean .PHONY: nuke +.PHONY: setup-sim diff --git a/scripts/setup_sim.sh b/scripts/setup_sim.sh index c931d24..dfaea4b 100755 --- a/scripts/setup_sim.sh +++ b/scripts/setup_sim.sh @@ -7,10 +7,7 @@ curl -sSL http://get.gazebosim.org | sh # Install PX4 firmware echo "Installing PX4 firmware" -wget https://github.com/PX4/Firmware/archive/v1.9.2.zip -O Firmware.zip -unzip Firmware.zip -rm Firmware.zip -mv Firmware-1.9.2 PX4Firmware +git clone --single-branch --branch v1.8.2 https://github.com/PX4/Firmware/ PX4Firmware # Ubuntu Config echo "We must first remove modemmanager" @@ -57,4 +54,4 @@ if [ ! -f exe/QGroundControl.AppImage ]; then echo "Downloading QGroundControl" wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/builds/master/QGroundControl.AppImage -P /bin chmod a+x /bin/QGroundControl.AppImage -fi \ No newline at end of file +fi From f4d3265ab73cecf77d1e39a9c9d8aefad189156a Mon Sep 17 00:00:00 2001 From: Joe Macek Date: Sun, 6 Oct 2019 14:57:12 -0400 Subject: [PATCH 2/2] fixed gazebo build setup, add x window support for linux --- Makefile | 10 ---------- docker-compose.yml | 13 ++++++++++++- scripts/build_gazebo.sh | 8 ++++++++ 3 files changed, 20 insertions(+), 11 deletions(-) create mode 100755 scripts/build_gazebo.sh diff --git a/Makefile b/Makefile index 10ecfbe..b353a8b 100644 --- a/Makefile +++ b/Makefile @@ -13,18 +13,8 @@ clean: nuke: cd; rm -r /software/bin; rm -r /software/lib; rm -r /software/build -# Temporary command to build gazebo and px4 firmware until this is in setup_sim.sh -# Only call this from within the docker container - make sure you have the new image -setup-sim: - pwd - cd /PX4Firmware - num_procs_avail=$(($(grep -c ^processor /proc/cpuinfo)-1)) - make posix_sitl_default gazebo -j$((num_procs_avail > 1 ? num_procs_avail : 1)) - - .PHONY: build .PHONY: bash .PHONY: run-all .PHONY: clean .PHONY: nuke -.PHONY: setup-sim diff --git a/docker-compose.yml b/docker-compose.yml index 7693e5d..fa7f8a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,4 +7,15 @@ services: - ./software:/software - ${PWD}/Makefile:/Makefile container_name: maav-run - command: "make ${ACTION}" \ No newline at end of file + command: "make ${ACTION}" + gazebo: + image: maav-software + volumes: + - ./software:/software + - ${PWD}/Makefile:/Makefile + - $HOME/.Xauthority:/root/.Xauthority:rw + environment: + - DISPLAY + network_mode: "host" + container_name: gazebo-run + command: "gazebo" diff --git a/scripts/build_gazebo.sh b/scripts/build_gazebo.sh new file mode 100755 index 0000000..1478c91 --- /dev/null +++ b/scripts/build_gazebo.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Run this command from the container only to build the PX4 firmware. +# This will launch a PX4 shell, so once the command stops running you can +# CTRL+C or exit. To save the build files, docker commit your container +cd /PX4Firmware +num_procs_avail=$(($(grep -c ^processor /proc/cpuinfo)-1)) +make posix_sitl_default gazebo -j$((num_procs_avail > 1 ? num_procs_avail : 1))