Skip to content

Commit

Permalink
anti-frontiers
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenZephyr committed Nov 19, 2024
1 parent 8de35eb commit 19892d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/spark_dsg/node_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions python/bindings/src/spark_dsg_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,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",
Expand Down
9 changes: 9 additions & 0 deletions src/node_attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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 {
Expand All @@ -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 &&
Expand Down

0 comments on commit 19892d6

Please sign in to comment.