MCPcopy Create free account
hub / github.com/PeterFWS/Structure-PLP-SLAM / register_graph

Method register_graph

src/PLPSLAM/data/map_database.cc:656–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654 }
655
656 void map_database::register_graph(const unsigned int id, const nlohmann::json &json_keyfrm)
657 {
658 // Graph information
659 const auto spanning_parent_id = json_keyfrm.at("span_parent").get<int>();
660 const auto spanning_children_ids = json_keyfrm.at("span_children").get<std::vector<int>>();
661 const auto loop_edge_ids = json_keyfrm.at("loop_edges").get<std::vector<int>>();
662
663 assert(keyframes_.count(id));
664 assert(spanning_parent_id == -1 || keyframes_.count(spanning_parent_id));
665 keyframes_.at(id)->graph_node_->set_spanning_parent((spanning_parent_id == -1) ? nullptr : keyframes_.at(spanning_parent_id));
666 for (const auto spanning_child_id : spanning_children_ids)
667 {
668 assert(keyframes_.count(spanning_child_id));
669 keyframes_.at(id)->graph_node_->add_spanning_child(keyframes_.at(spanning_child_id));
670 }
671 for (const auto loop_edge_id : loop_edge_ids)
672 {
673 assert(keyframes_.count(loop_edge_id));
674 keyframes_.at(id)->graph_node_->add_loop_edge(keyframes_.at(loop_edge_id));
675 }
676 }
677
678 void map_database::register_association(const unsigned int keyfrm_id, const nlohmann::json &json_keyfrm)
679 {

Callers

nothing calls this directly

Calls 4

set_spanning_parentMethod · 0.80
add_spanning_childMethod · 0.80
add_loop_edgeMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected