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)) 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