RoboHome / code /robohome /src /tools /rplan /build_full.sh
RoboParty Release
Unify robohome source, assets and scenes delivery
3f15e9f
Raw History Blame Contribute Delete
1.32 kB
#!/bin/bash
# Convert every record of the RPLAN data file and screen the plans with the generator of a code tree (two libraries: with and without hallway rooms).
# usage: [PROFILE=balanced|wide] build_full.sh <out dir> <code tree> [extra convert_rplan.py flags]
# writes <out dir>/{hall,nohall}.{converted,screened}.json (+ .log) and progress.log; use the .screened.json files as RHG_RPLAN_SEEDS.
H=$(cd "$(dirname "$0")" && pwd)
OUT=$1; TREE=$2; shift 2
MAT=$(PYTHONPATH="$TREE${PYTHONPATH:+:$PYTHONPATH}" python3 -B -c 'import rhg_paths; print(rhg_paths.resolve("${RPLAN_MAT}"))') || exit 1
export PYTHONPATH=$TREE/engine/supervisor_site PYTHONDONTWRITEBYTECODE=1
cd "$H"; mkdir -p "$OUT"
for variant in hall nohall; do
flags=""; [ $variant = nohall ] && flags="--no-hallways"
/usr/bin/python3 convert_rplan.py --mat "$MAT" --out "$OUT/$variant.converted.json" --min-retained 0 --workers 16 \
--target-area 100 --extra-bedroom-area 10 --profile "${PROFILE:-balanced}" $flags "$@" > "$OUT/$variant.converted.log" 2>&1
/usr/bin/python3 screen_library.py --src "$TREE" --library "$OUT/$variant.converted.json" --out "$OUT/$variant.screened.json" --workers 16 \
> "$OUT/$variant.screened.log" 2>&1
echo "$(date +%T) $variant done" >> "$OUT/progress.log"
done
echo "$(date +%T) all done" >> "$OUT/progress.log"