import os import argparse try: from include_in_path import include, FF_PROJECT_ROOT # include(FF_PROJECT_ROOT, "vendor", "TanksAndTemples", "tanksandtemples_evaluator") # from tanksandtemples_evaluator import TanksAndTemplesEvaluator include(FF_PROJECT_ROOT, "misc", "tools", "tanksandtemples_evaluator") from tanksandtemples_evaluator import TanksAndTemplesEvaluator except: raise SCENE_NAME = "angel" SCENE_FOLDER = os.path.join(FF_PROJECT_ROOT, "scripts", "data", "uavmvs", "angel_v1", "capture-initial_2D") if __name__ == "__main__": parser = argparse.ArgumentParser( description=f"Runs tanksandtemples_evaluator.py on {SCENE_FOLDER}/") parser.add_argument("--dtau", type=float, default=0.5) parser.add_argument("--out_dir", type=str, default=None) parser.add_argument("--plot_stretch", type=int, default=5) args = parser.parse_args() dTau = args.dtau plot_stretch = args.plot_stretch
try: from include_in_path import include, FF_PROJECT_ROOT python_toolbox_path = [ FF_PROJECT_ROOT, "vendor", "TanksAndTemples", "python_toolbox" ] v1_tanksandtemples_path = [ FF_PROJECT_ROOT, "misc", "v1", "reconstruction", "tanksandtemples" ] # FIXME stop using the modified version from v1/, but also, don't use the different # files from python_toolbox/evaluation/, instead, use tanksandtemples_evaluator.py! # Check out eval_Cidadela_2021-01-09-18-27-07.py to see what changes are necessary. if False: include(*python_toolbox_path, "evaluation", "plot") include(*python_toolbox_path, "evaluation", "evaluation") include(*python_toolbox_path, "evaluation", "registration") include(*python_toolbox_path, "evaluation", "trajectory_io") else: include(*v1_tanksandtemples_path, "plot") include(*v1_tanksandtemples_path, "evaluation") include(*v1_tanksandtemples_path, "registration") include(*v1_tanksandtemples_path, "trajectory_io") from plot import plot_graph from evaluation import EvaluateHisto from registration import registration_unif, registration_vol_ds, trajectory_alignment from trajectory_io import read_trajectory include(*python_toolbox_path, "convert_to_logfile")
import os import argparse try: from include_in_path import FF_PROJECT_ROOT, include include(FF_PROJECT_ROOT, "misc", "tools", "uavmvs_make_traj") import uavmvs_make_traj as uavmvs from uavmvs_make_traj import Uavmvs except: raise ############################################################################### ############################################################################### CWD = os.getcwd() HERE = os.path.dirname(os.path.abspath(__file__)) HOME = os.path.expanduser("~") def path_to(*relative_path): return os.path.abspath(os.path.join(*relative_path)) ASSETS_DIR = path_to(HERE, "assets") def setup_args(args: argparse.Namespace) -> None: args.scene = path_to(args.scene) root, ext = os.path.splitext(args.scene)
from ds.rgba import Rgba from ff.types import to_xyz_str, to_xyz_tuple from ie.airsimy import ( YAW_N, AirSimImage, AirSimRecord, connect, pose_at_simulation_pause, quaternion_orientation_from_eye_to_look_at, ) from airsim.types import Pose, YawMode, DrivetrainType try: from include_in_path import FF_PROJECT_ROOT, include include(FF_PROJECT_ROOT, "misc", "tools", "uavmvs_parse_traj") from uavmvs_parse_traj import parse_uavmvs, convert_uavmvs_to_airsim_position include(FF_PROJECT_ROOT, "scripts", "data_config") import data_config except: raise VELOCITY = 5 # SIM_MODE = ff.SimMode.Multirotor SIM_MODE = ff.SimMode.ComputerVision LOOK_AT_TARGET = data_config.Ned.Cidadela_Statue # LOOK_AT_TARGET = data_config.Ned.Urban_Building
from enum import Enum from typing import List import ff import airsim from ds import Rgba, EditMode from airsim import Vector3r from ff.helper import input_or_exit from ie.airsimy import connect try: from include_in_path import FF_PROJECT_ROOT, include include(FF_PROJECT_ROOT, "misc", "tools", "io_ply") from io_ply import read_ply include(FF_PROJECT_ROOT, "misc", "tools", "uavmvs_parse_traj") from uavmvs_parse_traj import ( parse_uavmvs, convert_uavmvs_to_airsim_pose, convert_uavmvs_to_airsim_position, ) except: raise ############################################################################### ## preflight (called before connecting) ####################################### ###############################################################################
import os import argparse from typing import Tuple, Optional, NamedTuple import numpy as np import matplotlib.pyplot as plt from ie.airsimy import AirSimRecord from ie.meshroomy import MeshroomParser, MeshroomTransform try: from include_in_path import include, FF_PROJECT_ROOT include(FF_PROJECT_ROOT, "vendor", "tartanair_tools", "evaluation", "tartanair_evaluator") from tartanair_evaluator import TartanAirEvaluator except: raise DEBUG_ATE = True class TartanAir: # NOTE ATE is well-suited for measuring the performance of visual SLAM systems, in contrast, # RPE is well-suited for measuring the drift of visual odometry systems (e.g. the drift per second) class Result(NamedTuple): ate_score: float rpe_score: Tuple[float, float] kitti_score: Tuple[float, float]
import os import argparse try: from include_in_path import include, FF_PROJECT_ROOT include(FF_PROJECT_ROOT, "vendor", "TanksAndTemples", "tanksandtemples_evaluator") from tanksandtemples_evaluator import TanksAndTemplesEvaluator except: raise SCENE_NAME = "angel" SCENE_FOLDER = os.path.join(FF_PROJECT_ROOT, "scripts", "data", "uavmvs", "angel_v1") RECONSTRUCTION_FOLDER = os.path.join(SCENE_FOLDER, "capture-shortened_2D", "Reconstruction") assert os.path.isdir(RECONSTRUCTION_FOLDER), RECONSTRUCTION_FOLDER if __name__ == "__main__": parser = argparse.ArgumentParser( description=f"Runs tanksandtemples_evaluator.py on {SCENE_FOLDER}/") parser.add_argument("--dtau", type=float, default=0.5) parser.add_argument("--out_dir", type=str, default=None) parser.add_argument("--plot_stretch", type=int, default=5) args = parser.parse_args() dTau = args.dtau plot_stretch = args.plot_stretch
import argparse import ff import airsim from ie import airsimy from ds.rgba import Rgba from ie.airsimy import AirSimNedTransform, connect from airsim.types import Pose, Vector3r, Quaternionr try: from include_in_path import FF_PROJECT_ROOT, include include(FF_PROJECT_ROOT, "scripts", "data_config") import data_config except: raise ############################################################################### ## preflight (called before connecting) ####################################### ############################################################################### def preflight(args: argparse.Namespace) -> None: if args.env_name is not None: # the --launch option was passed ff.launch_env(*ff.LaunchEnvArgs(args)) ff.input_or_exit("\nPress [enter] to connect to AirSim ") ###############################################################################