99#include < pybind11/stl.h>
1010
1111#include < metrics.h>
12+ #include < orth_extract.h>
13+ #include < config.h>
1214
1315// Python: arg0: List[numpy.ndarray[numpy.float64[3, n]]], arg1: List[numpy.ndarray[numpy.float64[4, 4]]]) -> float
1416
1517namespace py = pybind11;
1618
19+ std::vector<cilantro::VectorSet3d> extract_orthogonal (
20+ cilantro::VectorSet3d const & points , config::CustomConfig config, double eps=1e-1 )
21+ {
22+ return orth_extract::ExtractOrthogonalSubset (cilantro::PointCloud3d (points), config, eps);
23+ }
24+
1725PYBIND11_MODULE (map_metrics, m){
18- m.doc () = " Baseline of MPV and MME metrics" ;
19- m.def (" mpv" , py::overload_cast<
20- const std::vector<cilantro::VectorSet3d> &,
21- const std::vector<Eigen::Matrix4d> &, int , double >(&metrics::GetMPV));
22- m.def (" mme" , py::overload_cast<
23- const std::vector<cilantro::VectorSet3d> &,
24- const std::vector<Eigen::Matrix4d> &, int , double >(&metrics::GetMME));
26+ m.doc () = R"( Map-Metrics library
27+ A tool for evaluating the quality of odometry algorithm trajectory.)" ;
28+
29+ py::module_ mcfg = m.def_submodule (" config" , " Config submodule" );
30+
31+ py::class_<config::CustomConfig>(mcfg, " CustomConfig" )
32+ .def (py::init<int , double , int , int >());
33+
34+ m.def (" mpv" , &metrics::GetMPV, " Mean Plane Variance trajectory metric" ,
35+ py::arg (" pcs" ),
36+ py::arg (" poses" ),
37+ py::arg (" config" ) = config::CustomConfig ());
38+
39+ m.def (" mme" , &metrics::GetMME, " Mean Map Entropy trajectory metric" ,
40+ py::arg (" pcs" ),
41+ py::arg (" poses" ),
42+ py::arg (" config" ) = config::CustomConfig ());
43+
44+ m.def (" mom" , &metrics::GetMOM, " Mutually Orthogonal Metric trajectory metric" ,
45+ py::arg (" pcs" ),
46+ py::arg (" poses" ),
47+ py::arg (" config" ) = config::CustomConfig (),
48+ py::arg (" orth_subset" ) = std::vector<cilantro::VectorSet3d>());
49+
50+ m.def (" extract_orthogonal" , &extract_orthogonal, " Extract orthogonal plane subset from Point Cloud" ,
51+ py::arg (" pc" ),
52+ py::arg (" config" ) = config::CustomConfig (),
53+ py::arg (" eps" ) = 1e-1 );
2554}
0 commit comments