41 T* e=
dynamic_cast<T*
> (e_);
50 T* e=
dynamic_cast<T*
> (e_);
55 if (from && to && from!=to){
56 int deltaId = abs(from->
id() - to->
id());
58 if (from->
id()>to->
id()){
70 int main(
int argc,
char** argv) {
72 std::string outputFilename;
73 std::string inputFilename;
74 arg.
param(
"o", outputFilename,
"anon.g2o",
"output file" );
75 arg.
paramLeftOver(
"graph-output", inputFilename,
"",
"graph file which will be read",
true);
79 if (inputFilename.size() == 0) {
80 cerr <<
"No input data specified" << endl;
82 }
else if (inputFilename ==
"-") {
83 cerr <<
"Read input from stdin" << endl;
84 if (!graph.
load(cin)) {
85 cerr <<
"Error loading graph" << endl;
89 cerr <<
"Read input from " << inputFilename << endl;
90 ifstream ifs(inputFilename.c_str());
92 cerr <<
"Failed to open file" << endl;
95 if (!graph.
load(ifs)) {
96 cerr <<
"Error loading graph" << endl;
101 for (HyperGraph::EdgeSet::iterator it = graph.
edges().begin(); it!=graph.
edges().end(); it++){
103 if (anonymizeLandmarkEdge<EdgeSE2PointXY>(e, graph))
continue;
104 if (anonymizeLandmarkEdge<EdgeSE2PointXYOffset>(e, graph))
continue;
105 if (anonymizeLandmarkEdge<EdgeSE2PointXYBearing>(e, graph))
continue;
106 if (anonymizePoseEdge<EdgeSE2>(e, graph))
continue;
107 if (anonymizePoseEdge<EdgeSE2Offset>(e, graph))
continue;
110 ofstream os (outputFilename.c_str());
int main(int argc, char **argv)
virtual bool setEdgeVertex(HyperGraph::Edge *e, int pos, HyperGraph::Vertex *v)
int id() const
returns the id
Command line parsing of argc and argv.
bool anonymizeLandmarkEdge(HyperGraph::Edge *e_, OptimizableGraph &g)
bool parseArgs(int argc, char **argv, bool exitOnError=true)
virtual bool save(std::ostream &os, int level=0) const
save the graph to a stream. Again uses the Factory system.
const EdgeSet & edges() const
void paramLeftOver(const std::string &name, std::string &p, const std::string &defValue, const std::string &desc, bool optional=false)
bool anonymizePoseEdge(HyperGraph::Edge *e_, OptimizableGraph &g)
void param(const std::string &name, bool &p, bool defValue, const std::string &desc)
abstract Vertex, your types must derive from that one
virtual bool load(std::istream &is, bool createEdges=true)
load the graph from a stream. Uses the Factory singleton for creating the vertices and edges...
Protocol The SLAM executable accepts such as solving the and retrieving or vertices in the graph