Repository: introlab/rtabmap

Issue #363: EdgeSE3Prior not declared in scope
Created: 2019-02-27T18:46:45Z
I just started using RTAB map. I have an installation in a ubuntu 16.04 system where it builds without problem. But I have another computer where I have Ubuntu 18.04 and I get the following build error:
In member function ‘virtual std::map<int, rtabmap::Transform> rtabmap::OptimizerG2O::optimize(int, const std::map<int, rtabmap::Transform>&, const std::multimap<int, rtabmap::Link>&, cv::Mat&, std::__cxx11::list<std::map<int, rtabmap::Transform> >*, double*, int*)’:
/home/aumi/rtabmap/corelib/src/optimizer/OptimizerG2O.cpp:497:8: error: ‘EdgeSE3XYZPrior’ was not declared in this scope
        EdgeSE3XYZPrior * priorEdge = new EdgeSE3XYZPrior();
        ^~~~~~~~~~~~~~~
/home/aumi/rtabmap/corelib/src/optimizer/OptimizerG2O.cpp:497:8: note: suggested alternative:
In file included from /usr/local/include/g2o/types/slam3d/types_slam3d.h:50:0,
                 from /home/aumi/rtabmap/corelib/src/optimizer/OptimizerG2O.cpp:61:
/usr/local/include/g2o/types/slam3d/edge_se3_xyzprior.h:39:30: note:   ‘g2o::EdgeSE3XYZPrior’
   class G2O_TYPES_SLAM3D_API EdgeSE3XYZPrior : public BaseUnaryEdge<3, Vector3, VertexSE3>
                              ^~~~~~~~~~~~~~~
/home/aumi/rtabmap/corelib/src/optimizer/OptimizerG2O.cpp:497:26: error: ‘priorEdge’ was not declared in this scope
        EdgeSE3XYZPrior * priorEdge = new EdgeSE3XYZPrior();
                          ^~~~~~~~~
/home/aumi/rtabmap/corelib/src/optimizer/OptimizerG2O.cpp:497:26: note: suggested alternative: ‘priorsIgnored’
        EdgeSE3XYZPrior * priorEdge = new EdgeSE3XYZPrior();
                          ^~~~~~~~~
                          priorsIgnored
/home/aumi/rtabmap/corelib/src/optimizer/OptimizerG2O.cpp:497:42: error: expected type-specifier before ‘EdgeSE3XYZPrior’
        EdgeSE3XYZPrior * priorEdge = new EdgeSE3XYZPrior();

To test I changed the line temporarily and made it
 g2o::EdgeSE3XYZPrior * priorEdge = new g2o::EdgeSE3XYZPrior();

which builds and I can run ./rtabmap just fine it seems like. Could you please give me an idea if it's somehow related to ubuntu 18.04 or something else?

Duplicate issue #360: Global grid optimized does not remain and get reconstructed
Created: 2019-02-14T14:52:08Z
Greetings,
I have created a map using rtabmap_ros and processed the database using rtabmap-databaseviewer, after that when I want to navigate that map I find 2 big problems and I would very much appreciate your help solving them.
The first problem I have is that the correction of the robot's pose some times is very big making the robot "jump" on the map long distances, I would like to know how could I minimize this "jumps" to have the robot navigate smoother.
The second problem is actually related to the grid map, as I mentioned on the title I would like to use the globally optimized grid map for navigation, the problem I am facing is that the optimized grid does not remain constant and get "unloaded" and "reconstructed" again some times, but it does not load the full grid globally optimized.
I tried exporting the grid, cleaning it and then re importing it again using the databaseviewer, it works when it first load the database, but then it gets unloaded and the same as before happens.
I also tried publishing the static grid map using map_server, it works for most of the time but there are some areas where the sync is not perfect and there is a risk of the robot thinking that is navigating on a wall or something like that.
in order to help illustrating my issues I will share some screen recordings and the database used for this navigation.
Video showing rtabmap grid unloaded
Video showing static map
Database used for navigation
Thank you very much in advance for the help you can provide on this.
Best regards,
David

Closing comment (2019-03-03T19:39:31Z): This g2o error is strange (same as #363), because that EdgeSE3XYZPrior is defined here. It is maybe the order of the included files. I'll try to build g2o from source and see if I can reproduce this problem. EDIT: It is fixed in this commit.
For the crash log, it crashes in g2o library:
0x00007fffee55f45f in g2o::EdgeProjectP2SC::linearizeOplus() ()
   from /usr/local/lib/libg2o_types_sba.so
#3  0x00007ffff79355d9 in g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::buildSystem() () from /usr/local/lib/librtabmap_core.so.0.18
#4  0x00007fffeecc21f6 in g2o::OptimizationAlgorithmGaussNewton::solve(int, bool) () from /usr/local/lib/libg2o_core.so
#5  0x00007fffeecba297 in g2o::SparseOptimizer::optimize(int, bool) ()

Can you show the full output of cmake for rtabmap build? This is maybe related to BUILD_WITH_MARCH_NATIVE, in particular is PCL built from source too? The misusage of compilation flag -march=native across different linked libraries can cause this kind of problem. Or there is a problem with latest version of g2o from source...