#!/usr/bin/env bash
# For usage instructions, see: https://docs.mola-slam.org/latest/
#
# Runs MOLA LiDAR odometry on the 'tiers' dataset through
# mola-lidar-odometry-cli (offline batch).
#
# Everything this script knows about the dataset lives in
# lib/profiles/tiers.sh, shared with the matching
# mola-lo-gui-tiers-velodyne wrapper. Any MOLA_* variable you export
# before invoking this takes precedence over the profile's default.
set -euo pipefail

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
MOLA_LO_LIB="$SCRIPT_DIR/lib/dataset-profile.sh"
if [ ! -f "$MOLA_LO_LIB" ]; then
  MOLA_LO_LIB="$SCRIPT_DIR/../share/mola_lidar_odometry/scripts-lib/dataset-profile.sh"
fi
# shellcheck source=lib/dataset-profile.sh
source "$MOLA_LO_LIB"

MOLA_LO_MODE=cli
export TIERS_SENSOR=velodyne
mola_lo_load_profile tiers "$@" || exit $?
mola_lo_exec_cli
