spanning_tree.h
Go to the documentation of this file.
1 #ifndef SPANNING_TREE_H
2 #define SPANNING_TREE_H
3 
4 #include <queue>
5 #include <unordered_set>
6 #include <valarray>
7 #include <ros/ros.h>
8 #include <tf2/utils.h>
9 #include <geometry_msgs/PoseArray.h>
10 #include <nav_msgs/OccupancyGrid.h>
11 #include "lib/edge.h"
12 
13 using namespace std;
14 using namespace ros;
15 
20 {
21 public:
25  spanning_tree ();
26 
31  vector<edge> get_mst_edges ();
32 
37  geometry_msgs::PoseArray get_tree ();
38 
44  void initialize_graph (nav_msgs::OccupancyGrid gridmap, bool connect4 = true);
45 
49  void construct ();
50 
51 private:
58  void add_edge (int from, int to, int cost);
59 
66  bool different_sets (int a, int b);
67 
71  vector<unordered_set<int>> nodes;
72 
76  priority_queue<edge, vector<edge>, compare_edge> edges;
77 
81  vector<edge> mst_edges;
82 
86  nav_msgs::OccupancyGrid map;
87 };
88 
89 #endif // SPANNING_TREE_H
nav_msgs::OccupancyGrid map
The grid map that needs to be covered by the MST.
Definition: spanning_tree.h:86
vector< edge > mst_edges
Edges in Minimal-Spanning Tree.
Definition: spanning_tree.h:81
nav_msgs::OccupancyGrid gridmap
The grid map representing the environment to be covered.
Definition: coverage_path.h:69
A struct that provides the comparison of edge objects.
Definition: edge.h:46
A class that generates a minimum-spanning-tree (MST) graph for a given grid map.
Definition: spanning_tree.h:19
vector< unordered_set< int > > nodes
The sets of connected vertices.
Definition: spanning_tree.h:71
priority_queue< edge, vector< edge >, compare_edge > edges
Priority queue of edge objects sorted by cost.
Definition: spanning_tree.h:76


coverage_path
Author(s): Micha Sende
autogenerated on Thu Oct 31 2019 10:37:31