@@ -33,7 +33,7 @@ namespace distributed_pcm {
3333 return std::make_pair (total_max_clique_sizes, total_outliers_rejected);
3434 }
3535
36- std::pair<int , int > DistributedPCM::solveDecentralized (const int & other_robot_id,
36+ std::pair<std::pair< int , int >, std::set<std::pair<gtsam::Key, gtsam::Key>> > DistributedPCM::solveDecentralized (const int & other_robot_id,
3737 boost::shared_ptr<distributed_mapper::DistributedMapper>& dist_mapper,
3838 gtsam::GraphAndValues& local_graph_and_values,
3939 robot_measurements::RobotLocalMap& robot_local_map,
@@ -167,7 +167,7 @@ namespace distributed_pcm {
167167 return std::make_pair (max_clique.size (), max_clique_info.second );
168168 }
169169
170- std::pair<int , int > DistributedPCM::executePCMDecentralized (const int & other_robot_id, robot_measurements::RobotLocalMap& robot_local_map,
170+ std::pair<std::pair< int , int >, std::set<std::pair<gtsam::Key, gtsam::Key>> > DistributedPCM::executePCMDecentralized (const int & other_robot_id, robot_measurements::RobotLocalMap& robot_local_map,
171171 const robot_measurements::RobotLocalMap& other_robot_local_info,
172172 boost::shared_ptr<distributed_mapper::DistributedMapper>& dist_mapper,
173173 gtsam::GraphAndValues& local_graph_and_values,
@@ -193,16 +193,18 @@ namespace distributed_pcm {
193193 // Retrieve indexes of rejected measurements
194194 auto separators_ids = dist_mapper->separatorEdge ();
195195 std::vector<int > rejected_separator_ids;
196+ std::set<std::pair<gtsam::Key, gtsam::Key>> rejected_key_pairs;
196197 for (int i = 0 ; i < separators_ids.size (); i++) {
197198 if (isSeparatorToBeRejected (max_clique, separators_ids[i], roboti_robotj_separators_transforms,
198199 interrobot_measurements.getLoopClosures (), dist_mapper)) {
199200 rejected_separator_ids.emplace_back (i);
200201
201- // Update robot local map
202+ // Update robot local map and store keys
202203 auto separator_factor = boost::dynamic_pointer_cast<gtsam::BetweenFactor<gtsam::Pose3> >(dist_mapper->currentGraph ().at (separators_ids[i]));
203204 robot_local_map.removeTransform (std::make_pair (separator_factor->keys ().at (0 ), separator_factor->keys ().at (1 )));
204205 dist_mapper->eraseSeparatorsSymbols (std::make_pair (separator_factor->keys ().at (0 ), separator_factor->keys ().at (1 )));
205206 dist_mapper->eraseSeparatorsSymbols (std::make_pair (separator_factor->keys ().at (1 ), separator_factor->keys ().at (0 )));
207+ rejected_key_pairs.insert (std::make_pair (separator_factor->keys ().at (0 ), separator_factor->keys ().at (1 )));
206208 }
207209 }
208210 // Remove measurements not in the max clique
@@ -230,7 +232,7 @@ namespace distributed_pcm {
230232 }
231233 dist_mapper->setSeparatorIds (new_separator_ids);
232234
233- return std::make_pair (max_clique.size (), max_clique_info.second );
235+ return std::make_pair (std::make_pair ( max_clique.size (), max_clique_info.second ), rejected_key_pairs );
234236 }
235237
236238 bool DistributedPCM::isSeparatorToBeRejected (const std::vector<int >& max_clique, const int & separtor_id, const graph_utils::Transforms& separators_transforms,
0 commit comments