#!/bin/bash

set -euo pipefail

trap 'kill -TERM $(jobs -p) &>/dev/null; wait &>/dev/null; exit 130' INT
trap 'kill -TERM $(jobs -p) &>/dev/null; wait &>/dev/null' EXIT

# Find workspace and set up env
workspace=$(bazel info workspace)
cd ${workspace}
source "$workspace/scripts/shell/bazel/function.sh"

# Launch diagnostics aggregator for Base nodes since teleop is launch in Base
export ZOOX_VEHICLE_CONFIG="vehicle/common/config/testdata/kitt_01.json"
bazel_run //teleop/scripts:diagnostics_launch &
# Launch diagnostics visualizer
bazel_run //bin:rqt_robot_monitor
