#!/usr/bin/env bash
# For usage instructions, see: https://docs.mola-slam.org/latest/
#
# Runs MOLA LiDAR odometry on the 'geode' dataset (heterogeneous LiDAR
# recorded in deliberately degenerate geometry: tunnels, stairwells,
# flat surfaces, waterways) through
# mola-lidar-odometry-cli (offline batch).
#
# Everything this script knows about the dataset lives in
# lib/profiles/geode.sh, shared with the matching
# mola-lo-gui-geode 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
mola_lo_load_profile geode "$@" || exit $?
mola_lo_exec_cli
