45 for (
size_t i = 0; i < e->
vertices().size(); ++i) {
56 for (HyperGraph::VertexIDMap::const_iterator it=optimizer.
vertices().begin(); it!=optimizer.
vertices().end(); it++){
57 vset.insert(it->second);
73 int minDim = numeric_limits<int>::max();
74 for (HyperGraph::VertexSet::const_iterator it = vertices.begin(); it != vertices.end(); ++it){
77 maxDim = (std::max)(vdim, maxDim);
78 minDim = (std::min)(vdim, minDim);
82 if (extension.size() == 0)
87 bool hasOdomEdge =
false;
88 bool hasLandmarkEdge =
false;
89 for (HyperGraph::EdgeSet::const_iterator it = edges.begin(); it != edges.end(); ++it) {
95 hasLandmarkEdge =
true;
97 if (hasOdomEdge && hasLandmarkEdge)
101 bool fileStatus =
true;
103 string odomFilename = baseFilename +
"_odom_edges." + extension;
104 cerr <<
"# saving " << odomFilename <<
" ... ";
105 ofstream fout(odomFilename.c_str());
107 cerr <<
"Unable to open file" << endl;
113 for (HyperGraph::EdgeSet::const_iterator it = edges.begin(); it != edges.end(); ++it) {
117 (*saveGnuplot)(e, ¶ms);
119 cerr <<
"done." << endl;
122 if (hasLandmarkEdge) {
123 string filename = baseFilename +
"_landmarks_edges." + extension;
124 cerr <<
"# saving " << filename <<
" ... ";
125 ofstream fout(filename.c_str());
127 cerr <<
"Unable to open file" << endl;
133 for (HyperGraph::EdgeSet::const_iterator it = edges.begin(); it != edges.end(); ++it) {
137 (*saveGnuplot)(e, ¶ms);
139 cerr <<
"done." << endl;
143 string filename = baseFilename +
"_edges." + extension;
144 cerr <<
"# saving " << filename <<
" ... ";
145 ofstream fout(filename.c_str());
147 cerr <<
"Unable to open file" << endl;
153 for (HyperGraph::EdgeSet::const_iterator it = edges.begin(); it != edges.end(); ++it) {
155 (*saveGnuplot)(e, ¶ms);
157 cerr <<
"done." << endl;
161 string filename = baseFilename +
"_vertices." + extension;
162 cerr <<
"# saving " << filename <<
" ... ";
163 ofstream fout(filename.c_str());
165 cerr <<
"Unable to open file" << endl;
170 for (HyperGraph::VertexSet::const_iterator it = vertices.begin(); it != vertices.end(); ++it){
172 (*saveGnuplot)(v, ¶ms);
174 cerr <<
"done." << endl;
192 os <<
"set terminal x11 noraise" << endl;
193 os <<
"set size ratio -1" << endl;
194 os <<
"plot \"-\" w l" << endl;
195 for (HyperGraph::EdgeSet::const_iterator it = optimizer.
edges().begin(); it != optimizer.
edges().end(); ++it) {
197 (*saveGnuplot)(e, ¶ms);
std::string getFileExtension(const std::string &filename)
#define __PRETTY_FUNCTION__
bool dumpEdges(std::ostream &os, const OptimizableGraph &optimizer)
Abstract action that operates on a graph entity.
std::set< Vertex * > VertexSet
const VertexIDMap & vertices() const
std::set< Edge * > EdgeSet
int dimension() const
dimension of the estimated state belonging to this node
Protocol The SLAM executable accepts such as solving the and retrieving or vertices in the explicitly state the reprensentation poses are represented by poses by VERTEX_XYZRPY In the Quaternions and other representations could be but note that it is up to the SLAM algorithm to choose the internal representation of the angles The keyword is followed by a unique vertex ID and an optional initialization of the or edges in the explicitly state the type of the constraint pose constraints are given by pose constraints by EDGE_XYZRPY The keyword is followed by a unique edge the IDs of the referenced vertices
const VertexContainer & vertices() const
const EdgeSet & edges() const
std::string getPureFilename(const std::string &filename)
A general case Vertex for optimization.
bool edgeAllVertsSameDim(OptimizableGraph::Edge *e, int dim)
bool saveGnuplot(const std::string &gnudump, const HyperGraph::VertexSet &vertices, const HyperGraph::EdgeSet &edges)