#!/bin/bash

function untar_with_pbar () {
    pv $1 | tar xf - -C $2
}

DSET_SRC=/robosim/data/bnet/bnet_dataset_full

echo -e "Copy dataset"
rsync -arh --info=progress2 $DSET_SRC /local/

echo -e "Untar dataset"
cd /local/bnet_dataset_full
untar_with_pbar control.tar .
untar_with_pbar images.tar .

echo -e "Intall vista"
cd /robosim/workspace/driving-BarrierNet/vista
pip install -e .

# eval "$(./set-vars2.sh)"
# eval "$(export RESULTS_ROOT=/robosim/results/bnet/)"
# export RESULTS_ROOT=/robosim/results/bnet/
# export DATA_ROOT=/local/
# exec "$@"