Last active
September 30, 2020 15:21
-
-
Save Tiryoh/bf24f61992bfa8e32f2e75fc0672a647 to your computer and use it in GitHub Desktop.
A script to download Gazebo models from models.gazebosim.org manually
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
# (C) 2019 Daisuke Sato | |
# https://tiryoh.mit-license.org/2019 | |
function download_model(){ | |
if [[ -d $HOME'/.gazebo/models/'$1 ]]; then | |
echo model $1 is ready. | |
else | |
wget -l1 -np -nc -r "http://models.gazebosim.org/"$1 --accept=gz | |
fi | |
} | |
mkdir -p ~/.gazebo/models && cd ~/.gazebo/models | |
cd /tmp | |
TMPDIR=$(mktemp -d tmp.XXXXXXXXXX) | |
cd $TMPDIR | |
download_model sun | |
download_model ground_plane | |
download_model table | |
download_model wood_cube_5cm | |
if [[ -d "models.gazebosim.org" ]]; then | |
cd "models.gazebosim.org" | |
for i in *; do tar -zvxf "$i/model.tar.gz"; done | |
cp -vfR * ~/.gazebo/models/ | |
fi | |
rm -rf $TMPDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
curl -SsfL https://u.ty0.jp/download_gazebo_models | bash
or