Skip to content

Commit

Permalink
Updated docker script to run container with host gazebo version (#16)
Browse files Browse the repository at this point in the history
* Updated docker script to automaatically run the docker container that corresponds to the host gazebo version

* added newline

* fixed whitespace
  • Loading branch information
lmarzen committed Oct 20, 2022
1 parent 1f170d9 commit 36ad419
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Tools/docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@ if [ -z ${PX4_DOCKER_REPO+x} ]; then
PX4_DOCKER_REPO="px4io/px4-dev-clang:2021-02-04"
elif [[ $@ =~ .*tests* ]] || [[ $@ =~ .*px4_sitl.* ]]; then
# run all tests with simulation
PX4_DOCKER_REPO="px4io/px4-dev-simulation-bionic:2021-12-11"
GAZEBO_VERSION=$(gazebo --version | sed -n -e 's/^.*version //p' | sed 's/\.[^ ]*//g')
if [[ "$GAZEBO_VERSION" == "9" ]]; then
echo "Found gazebo version $GAZEBO_VERSION"
PX4_DOCKER_REPO="px4io/px4-dev-simulation-bionic:latest"
echo "PX4_DOCKER_REPO is set to '$PX4_DOCKER_REPO'";
elif [[ "$GAZEBO_VERSION" == "11" ]]; then
echo "Found gazebo version $GAZEBO_VERSION"
PX4_DOCKER_REPO="px4io/px4-dev-simulation-focal:latest"
echo "PX4_DOCKER_REPO is set to '$PX4_DOCKER_REPO'";
else
echo "Warning: Gazebo version could not be identified, defaulting to gazebo 9"
PX4_DOCKER_REPO="px4io/px4-dev-simulation-bionic:latest"
fi
fi
else
echo "PX4_DOCKER_REPO is set to '$PX4_DOCKER_REPO'";
Expand Down

0 comments on commit 36ad419

Please sign in to comment.