| 52 | using LabelClusters = MeshSegmenter::LabelClusters; |
| 53 | |
| 54 | FrontendModule::FrontendModule(const RobotPrefixConfig& prefix, |
| 55 | const FrontendConfig& config, |
| 56 | const SharedDsgInfo::Ptr& dsg, |
| 57 | const SharedModuleState::Ptr& state) |
| 58 | : queue_(std::make_shared<FrontendInputQueue>()), |
| 59 | prefix_(prefix), |
| 60 | config_(config), |
| 61 | dsg_(dsg), |
| 62 | state_(state) { |
| 63 | config_.pgmo_config.robot_id = prefix_.id; |
| 64 | label_map_.reset(new kimera::SemanticLabel2Color(config_.semantic_label_file)); |
| 65 | |
| 66 | // add placeholder mesh to allow mesh edges to be added |
| 67 | dsg_->graph->initMesh(); |
| 68 | dsg_->graph->createDynamicLayer(DsgLayers::AGENTS, prefix_.key); |
| 69 | |
| 70 | const auto mesh_resolution = config_.pgmo_config.mesh_resolution; |
| 71 | mesh_compression_.reset(new kimera_pgmo::DeltaCompression(mesh_resolution)); |
| 72 | |
| 73 | CHECK(mesh_frontend_.initialize(config_.pgmo_config)); |
| 74 | segmenter_.reset( |
| 75 | new MeshSegmenter(config_.object_config, dsg_->graph->getMeshVertices())); |
| 76 | |
| 77 | if (config_.should_log) { |
| 78 | VLOG(1) << "[Hydra Frontend] logging to " << (config_.log_path + "/frontend"); |
| 79 | frontend_graph_logger_.setOutputPath(config_.log_path + "/frontend"); |
| 80 | frontend_graph_logger_.setLayerName(DsgLayers::OBJECTS, "objects"); |
| 81 | frontend_graph_logger_.setLayerName(DsgLayers::PLACES, "places"); |
| 82 | } |
| 83 | |
| 84 | input_callbacks_.push_back( |
| 85 | std::bind(&FrontendModule::updateMeshAndObjects, this, std::placeholders::_1)); |
| 86 | input_callbacks_.push_back( |
| 87 | std::bind(&FrontendModule::updateDeformationGraph, this, std::placeholders::_1)); |
| 88 | input_callbacks_.push_back( |
| 89 | std::bind(&FrontendModule::updatePoseGraph, this, std::placeholders::_1)); |
| 90 | input_callbacks_.push_back( |
| 91 | std::bind(&FrontendModule::updatePlaces, this, std::placeholders::_1)); |
| 92 | } |
| 93 | |
| 94 | FrontendModule::~FrontendModule() { stop(); } |
| 95 |
nothing calls this directly
no test coverage detected