#!/bin/bash ## Create a Gazebo Box # Create a box gazebo model # # Usage: # Place the texture on the same directory as the script, then: # ./create-model-flat.sh model-name texture w l h static texture-scale-w texture-scale-l # mkdir ~/.gazebo/models/$1/ mkdir ~/.gazebo/models/$1/materials/ mkdir ~/.gazebo/models/$1/materials/scripts mkdir ~/.gazebo/models/$1/materials/textures # model.config cat > ~/.gazebo/models/$1/model.config <<- EOM $1 1.0 model.sdf EOM # model.sdf cat > ~/.gazebo/models/$1/model.sdf <<- EOM $6 $3 $4 $5 1 1 1 $3 $4 $5 EOM # script.material cat > ~/.gazebo/models/$1/materials/scripts/script.material <<- EOM material $1 { receive_shadows on technique { pass { texture_unit { texture $2 filtering anistropic max_anisotropy 16 scale $7 $8 } } } } EOM # Texture cp $2 ~/.gazebo/models/$1/materials/textures/ # script.material cat <<- EOM model://$1 0 0 0 0 0 0 EOM