Skip to content

Commit

Permalink
pybind ground align api separately (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh1002 authored Feb 4, 2025
1 parent d696406 commit ee51bec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/map_closures/map_closures.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ def get_closures(self, query_idx: int, local_map: np.ndarray) -> List[ClosureCan

def get_density_map_from_id(self, map_id: int) -> np.ndarray:
return self._pipeline._getDensityMapFromId(map_id)


def align_map_to_local_ground(pointcloud, resolution):
return map_closures_pybind._align_map_to_local_ground(
map_closures_pybind._Vector3dVector(pointcloud),
resolution,
)
3 changes: 3 additions & 0 deletions python/map_closures/pybind/map_closures_pybind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <tuple>
#include <vector>

#include "map_closures/GroundAlign.hpp"
#include "map_closures/MapClosures.hpp"
#include "stl_vector_eigen.h"

Expand Down Expand Up @@ -80,5 +81,7 @@ PYBIND11_MODULE(map_closures_pybind, m) {
.def("_GetBestClosure", &MapClosures::GetBestClosure, "query_id"_a, "local_map"_a)
.def("_GetTopKClosures", &MapClosures::GetTopKClosures, "query_id"_a, "local_map"_a, "k"_a)
.def("_GetClosures", &MapClosures::GetClosures, "query_id"_a, "local_map"_a);

m.def("_align_map_to_local_ground", &AlignToLocalGround, "pointcloud"_a, "resolution"_a);
}
} // namespace map_closures

0 comments on commit ee51bec

Please sign in to comment.