syntax = "proto3";

import "eigen_matrix.proto";

// 支持float二维数组
message FloatMatrix {
    int32 rows = 1;
    int32 cols = 2;
    repeated float data = 3; // row-major
}

package scancontext;


message ScanContextDescriptor {
    eigen.MatrixXd sc_descriptor = 1;
    eigen.MatrixXd ringkey = 2;
    eigen.MatrixXd sectorkey = 3;
    double timestamp = 4; // optional
    FloatMatrix polarcontext_invkeys_mat = 5;
    eigen.Matrix4d pose = 6;
    uint64 frame_id = 7;
}

message SCManagerState {
    // Parameters
    double lidar_height = 1;
    int32 pc_num_ring = 2;
    int32 pc_num_sector = 3;
    double pc_max_radius = 4;
    double sc_dist_thres = 5;

    // Data
    repeated ScanContextDescriptor descriptors = 6;

    // Tree state (optional, 可选择不序列化树结构，重建时重新构建)
    bool is_tree_batch_made = 7;
}