#!/usr/bin/env bash # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 # This script adds map generation plugin to the input world and plugin config parameters # Input args via command line: # [required] # [required] # [required] set -e if [ $# -ne 3 ]; then echo "expects 3 arguments" exit 2 fi worldfile=$2 config=$1 worldbody=`xpath -q -e '/sdf/world/*' $worldfile` template=""" <% %> $worldbody <%= @map_res %> 0.3 <%= @map_size_x %> <%= @map_size_y %> <%= @robot_init_x %> <%= @robot_init_y %> """ echo $template | erb -r "$config" | xmllint --format - > $3 echo $3