Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cannot store some *.g2o file

I use g2o examples tutorial_slam2d in my ros project. I use 'optimizer.save(file.g2o)' to save graph pose. And I only get empty file. While I debug this behavior, I found vertices and edges do exist.

Then I found G2O_REGISTER_TYPE_GROUP is need, I add the following code: ``` G2O_REGISTER_TYPE_GROUP(graph2d);

G2O_REGISTER_TYPE(TUTORIAL_VERTEX_SE2, VertexSE2);

G2O_REGISTER_TYPE(TUTORIAL_EDGE_SE2, EdgeSE2);

G2O_USE_TYPE_GROUP(graph2d); ```

I also tried directly use

G2O_USE_TYPE_GROUP(slam2d);

G2O_USE_TYPE_GROUP(slam3d);

like the example simple_optimize.

It also does not work.

Do you have any hints to solve this problem?

Thanks

taiping

cannot store some *.g2o file

I use g2o examples tutorial_slam2d in my ros project. I use 'optimizer.save(file.g2o)' to save graph pose. And I only get empty file. While I debug this behavior, I found vertices and edges do exist.

Then I found G2O_REGISTER_TYPE_GROUP is need, I add the following code: ``` G2O_REGISTER_TYPE_GROUP(graph2d);

G2O_REGISTER_TYPE(TUTORIAL_VERTEX_SE2, VertexSE2);

G2O_REGISTER_TYPE(TUTORIAL_EDGE_SE2, EdgeSE2);

G2O_USE_TYPE_GROUP(graph2d); ```

I also tried directly use

G2O_USE_TYPE_GROUP(slam2d);

G2O_USE_TYPE_GROUP(slam3d);

like the example simple_optimize.

It also does not work.

Do you have any hints to solve this problem?problem? I must the miss key point.

Thanks

taiping

cannot store some *.g2o file

I use g2o examples tutorial_slam2d in my ros project. I use 'optimizer.save(file.g2o)' to save graph pose. And I only get empty file. While I debug this behavior, I found vertices and edges do exist.

Then I found G2O_REGISTER_TYPE_GROUP is need, I add the following code: ``` G2O_REGISTER_TYPE_GROUP(graph2d);

G2O_REGISTER_TYPE(TUTORIAL_VERTEX_SE2, VertexSE2);

G2O_REGISTER_TYPE(TUTORIAL_EDGE_SE2, EdgeSE2);

G2O_USE_TYPE_GROUP(graph2d); ```

I also tried directly use

G2O_USE_TYPE_GROUP(slam2d);

G2O_USE_TYPE_GROUP(slam3d);

like the example simple_optimize.

It also does not work.

Do you have any hints to solve this problem? I must miss the miss key point.

Thanks

taiping