#!/usr/bin/env bash
# -net interactive aim/drive diagnosis (task #48): A drives (BT_AUTODRIVE) and
# runs its targeting block; capture [target] (noRay/mechPicks/groundPicks),
# [EYE] (does the active eye publish the aim camera?), and gait/position (does
# A move?).  B is a passive target.
set -x
cd /c/git/bt411/content || exit 1
rm -f mp_a.log mp_b.log

BT_LOG=mp_a.log BT_AFFINITY=0x1 BT_AUTODRIVE=1 BT_MP_LOG=1 \
  ../build/Debug/btl4.exe -egg MP.EGG -net 1501 &
sleep 2
BT_LOG=mp_b.log BT_AFFINITY=0x2 BT_MP_LOG=1 \
  ../build/Debug/btl4.exe -egg MP.EGG -net 1601 &
sleep 4
python ../tools/btconsole.py MP.EGG 127.0.0.1:1501 127.0.0.1:1601 &
PC=$!
sleep 40
kill $PC 2>/dev/null
taskkill //F //IM btl4.exe 2>/dev/null
taskkill //F //IM python.exe 2>/dev/null
echo "=== DONE ==="
