kimera_pgmo::MeshCompression
(deformation_compression_
) 에서, 오래된 mesh 제거kimera_pgmo::MeshCompression
(deformation_compression_
)에 추가한 후, 압축kimera_pgmo::Graph
(deformation_graph_
)에, 위 과정에서 새로 생성된 압축된 mesh 면
(삼각형, 꼭지점)들을 그래프 형태(노드 + 엣지)로 변환하여 추가해줌kimera_pgmo::Graph
(deformation_graph_
)에 추가된 새 압축된 edge들
을 이용해서, PoseGraph를 만듭니다.새롭게 추가된 mesh 정보들
을 담고 있습니다.void FrontendModule::updateDeformationGraph(const ReconstructionOutput& input) {
ScopedTimer timer("frontend/dgraph_compresssion", input.timestamp_ns, true, 1, false);
const auto& prefix = GlobalInfo::instance().getRobotPrefix();
const auto time_ns = std::chrono::nanoseconds(input.timestamp_ns);
double time_s =
std::chrono::duration_cast<std::chrono::duration<double>>(time_ns).count();
auto interface = PgmoMeshLayerInterface(input.map().getMeshLayer());
PgmoCloud new_vertices;
std::vector<size_t> new_indices;
std::vector<pcl::Vertices> new_triangles;
deformation_compression_->pruneStoredMesh(time_s - config.pgmo.time_horizon);
deformation_compression_->compressAndIntegrate(interface,
new_vertices,
new_triangles,
new_indices,
deformation_remapping_,
time_s);
PgmoCloud::Ptr vertices(new PgmoCloud());
deformation_compression_->getVertices(vertices);
std::vector<kimera_pgmo::Edge> new_edges;
if (new_indices.size() > 0 && new_triangles.size() > 0) {
// Add nodes and edges to graph
new_edges = deformation_graph_.addPointsAndSurfaces(new_indices, new_triangles);
}
if (backend_input_) {
backend_input_->deformation_graph = kimera_pgmo::makePoseGraph(
prefix.id, time_s, new_edges, new_indices, *vertices);
}
}
변형 그래프 관리
압축
및 통합해 그래프에 반영Pose Graph 생성과 전달
최적화된 변형 그래프
를 사용할 수 있도록 함kimera_pgmo::MeshCompression
(deformation_compression_
)pruneStoredMesh
호출:오래된 정점(지정된 시간 임계값 이전에 생성된 정점)을 삭제
compressAndIntegrate
호출:interface
로부터 새 메시 데이터(정점, 삼각형)를 받아 압축 및 통합new_vertices
: 새롭게 통합된 정점.new_triangles
: 새롭게 구성된 삼각형 표면.new_indices
: 새로 추가된 정점의 인덱스.deformation_compression_->getVertices()
호출:kimera_pgmo::Graph
(deformation_graph_
): mesh 를 추가하여 graph 형태로 변환addPointsAndSurfaces
를 통해 정점과 표면을 그래프의 노드와 간선으로 추가deformation_graph_.addPointsAndSurfaces
makePoseGraph()
호출:backend_input_
에 저장해 백엔드 모듈이 최적화에 사용할 수 있도록 합니다.