#ifndef BASIC_TYPES_H
#define BASIC_TYPES_H
#pragma once
#include <boost/shared_ptr.hpp>
#include <eigen3/Eigen/Geometry>
#include "glog/logging.h"
#include <map>
#include <iomanip>
#include <pcl/io/pcd_io.h>
#include <thread>
#include <boost/make_shared.hpp>

using namespace std;
using namespace Eigen;
#define MAX_THREAD_CNT (48)

typedef boost::shared_ptr<boost::thread> ThreadPtr;

/////////// AbstractParser /////////////

enum LidarType
{
    HesaiP40 = 0,
    HesaiXT32,
    Hesai80
};

/////////// Trajectory /////////////

#include <fstream>

struct PPK_Raw_Info{
    uint32_t gps_week;
    double gps_sec, lat, lng, height,
    roll, pitch, yaw;
};

struct NODE_Raw_Info{
    uint32_t node_id;
    double time, x, y, z, w, qx, qy, qz;
};

enum DevicePosition{
    TopLidar = 0,
    BackLidar = 1,
    IMU = 2
};

struct TrajPoint{
    double timestamp = 0;
    uint32_t nodeId = 0;
    Vector3d translation = Vector3d(0, 0, 0);
    Quaterniond rotation = Quaterniond::Identity();
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};

enum TrajType{
    PPK,
    NODE
};

/////////// MapTask /////////////

struct Time_Duration{
    double start_sec;
    double end_sec;
};

/////////// StrategyControl /////////////

enum Pointcloud_Source_Mode{
    PCAP_MODE,
    BAG_MODE,
    PCAP_BAG_MODE
};

enum PointCloudSource{
    PCAP,
    BAG
};

enum Trajectory_Source_Mode{
    NODE_MODE,
    PPK_MODE,
    PPK_UNDISORT_NODE_MAP_MODE
};

enum Filter_Mode{
    DYNAMIC_REMOVE_MODE,
    DIRECT_OUTPUT_MODE
};

struct StageInfo{
    DevicePosition lidarPosition;
    PointCloudSource pointcloudSource;
};

enum Strategy_Mode{
    MESH,
    PERIOD
};

enum Bag_Mode{
    Disorted,
    Undisorted
};

/////////// TaskServer /////////////

#define NODES_PER_SUBMAP (64)
#define SUBMAP_PACE (32)


struct TaskDescribe{
    string task_prefix;
    vector<vector<Time_Duration>> time_durations_vec;
    vector<string> output_prefix_vec;
};

/////////// DynamicRemover /////////////

const double MISS_PER_HIT_PER_STAGE = 4;


#endif // BASIC_TYPES_H