From dcb9b68468a5495153d13bee35bb3ad5018ecec4 Mon Sep 17 00:00:00 2001 From: Aaron Ray Date: Mon, 22 Jul 2024 12:26:37 +0000 Subject: [PATCH] anti-frontiers --- include/spark_dsg/node_attributes.h | 1 + python/bindings/src/spark_dsg_bindings.cpp | 1 + src/node_attributes.cpp | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/include/spark_dsg/node_attributes.h b/include/spark_dsg/node_attributes.h index 899c506..a536085 100644 --- a/include/spark_dsg/node_attributes.h +++ b/include/spark_dsg/node_attributes.h @@ -288,6 +288,7 @@ struct PlaceNodeAttributes : public SemanticNodeAttributes { bool real_place = true; bool need_cleanup = false; bool active_frontier = false; + bool anti_frontier = false; Eigen::Vector3d frontier_scale; Eigen::Quaterniond orientation; size_t num_frontier_voxels = 0; diff --git a/python/bindings/src/spark_dsg_bindings.cpp b/python/bindings/src/spark_dsg_bindings.cpp index dc505d1..c072840 100644 --- a/python/bindings/src/spark_dsg_bindings.cpp +++ b/python/bindings/src/spark_dsg_bindings.cpp @@ -353,6 +353,7 @@ PYBIND11_MODULE(_dsg_bindings, module) { &PlaceNodeAttributes::deformation_connections) .def_readwrite("real_place", &PlaceNodeAttributes::real_place) .def_readwrite("active_frontier", &PlaceNodeAttributes::active_frontier) + .def_readwrite("anti_frontier", &PlaceNodeAttributes::anti_frontier) .def_readwrite("frontier_scale", &PlaceNodeAttributes::frontier_scale) .def_property( "orientation", diff --git a/src/node_attributes.cpp b/src/node_attributes.cpp index 6ed0d71..617a718 100644 --- a/src/node_attributes.cpp +++ b/src/node_attributes.cpp @@ -309,6 +309,7 @@ std::ostream& PlaceNodeAttributes::fill_ostream(std::ostream& out) const { out << std::boolalpha << "\n - real place: " << real_place; out << std::boolalpha << "\n - need cleanup: " << need_cleanup; out << std::boolalpha << "\n - active frontier: " << active_frontier; + out << std::boolalpha << "\n - anti frontier: " << anti_frontier; out << "\n - num frontier voxels: " << num_frontier_voxels; return out; } @@ -327,6 +328,13 @@ void PlaceNodeAttributes::serialization_info() { serialization::field("orientation", orientation); serialization::field("need_cleanup", need_cleanup); serialization::field("num_frontier_voxels", num_frontier_voxels); + + const auto& header = io::GlobalInfo::loadedHeader(); + if (header.version < io::Version(1, 0, 5)) { + io::warnOutdatedHeader(header); + } else { + serialization::field("anti_frontier", anti_frontier); + } } bool PlaceNodeAttributes::is_equal(const NodeAttributes& other) const { @@ -347,6 +355,7 @@ bool PlaceNodeAttributes::is_equal(const NodeAttributes& other) const { deformation_connections == derived->deformation_connections && real_place == derived->real_place && active_frontier == derived->active_frontier && + anti_frontier == derived->anti_frontier && frontier_scale == derived->frontier_scale && quaternionsEqual(orientation, derived->orientation) && need_cleanup == derived->need_cleanup &&