Probem in continous RGBD mapping

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Probem in continous RGBD mapping

Nima
Hello, I tried the RGBD mapping example with RTABMAP . However, I need to press a key for mapping to continue otherwise it stops. I tried using the following link:
https://github.com/introlab/rtabmap/wiki/Cplusplus-RGBD-Mapping
but I got this error: MyProject/MapBuilder.h: In constructor ‘MapBuilder::MapBuilder(rtabmap::CameraThread*)’:
/home/nima/MyProject/MapBuilder.h:62:44: error: no matching function for call to ‘rtabmap::OccupancyGrid::OccupancyGrid()’
   62 |                 lastOdometryProcessed_(true)
      |                                            ^
In file included from /usr/local/include/rtabmap-0.21/rtabmap/core/OccupancyGrid.h:35,
                 from /home/nima/MyProject/MapBuilder.h:41,
                 from /home/nima/MyProject/main.cpp:16:
/usr/local/include/rtabmap-0.21/rtabmap/core/global_map/OccupancyGrid.h:43:9: note: candidate: ‘rtabmap::OccupancyGrid::OccupancyGrid(const rtabmap::LocalGridCache*, const ParametersMap&)’
   43 |         OccupancyGrid(const LocalGridCache * cache, const ParametersMap & parameters = ParametersMap());
      |         ^~~~~~~~~~~~~
/usr/local/include/rtabmap-0.21/rtabmap/core/global_map/OccupancyGrid.h:43:9: note:   candidate expects 2 arguments, 0 provided
/usr/local/include/rtabmap-0.21/rtabmap/core/global_map/OccupancyGrid.h:40:27: note: candidate: ‘rtabmap::OccupancyGrid::OccupancyGrid(const rtabmap::OccupancyGrid&)’
   40 | class RTABMAP_CORE_EXPORT OccupancyGrid : public GlobalMap
      |                           ^~~~~~~~~~~~~
/usr/local/include/rtabmap-0.21/rtabmap/core/global_map/OccupancyGrid.h:40:27: note:   candidate expects 1 argument, 0 provided
/usr/local/include/rtabmap-0.21/rtabmap/core/global_map/OccupancyGrid.h:40:27: note: candidate: ‘rtabmap::OccupancyGrid::OccupancyGrid(rtabmap::OccupancyGrid&&)’
/usr/local/include/rtabmap-0.21/rtabmap/core/global_map/OccupancyGrid.h:40:27: note:   candidate expects 1 argument, 0 provided
In file included from /home/nima/MyProject/main.cpp:16:
/home/nima/MyProject/MapBuilder.h: In member function ‘virtual void MapBuilder::processStatistics(const rtabmap::Statistics&)’:
/home/nima/MyProject/MapBuilder.h:255:39: error: ‘class rtabmap::OccupancyGrid’ has no member named ‘addToCache’
  255 |                                 grid_.addToCache(stats.getLastSignatureData().id(), groundCells, obstacleCells, emptyCells);
      |                                       ^~~~~~~~~~
/home/nima/MyProject/MapBuilder.h:259:55: error: ‘class rtabmap::OccupancyGrid’ has no member named ‘cacheSize’
  259 |                 if(grid_.addedNodes().size() || grid_.cacheSize())
      |                                                       ^~~~~~~~~
/home/nima/MyProject/MapBuilder.h:270:57: error: ‘convertMap2Image8U’ is not a member of ‘rtabmap::util3d’
  270 |                                 cv::Mat map8U = util3d::convertMap2Image8U(map8S);
      |                                                         ^~~~~~~~~~~~~~~~~~
/home/nima/MyProject/main.cpp: In function ‘int main(int, char**)’:
/home/nima/MyProject/main.cpp:220:24: warning: ‘void rtabmap::Rtabmap::get3DMap(std::map<int, rtabmap::Signature>&, std::map<int, rtabmap::Transform>&, std::multimap<int, rtabmap::Link>&, bool, bool) const’ is deprecated [-Wdeprecated-declarations]
  220 |       rtabmap->get3DMap(nodes, optimizedPoses, links, true, true);
      |       ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/nima/MyProject/main.cpp:2:
/usr/local/include/rtabmap-0.21/rtabmap/core/Rtabmap.h:185:22: note: declared here
  185 |                 void get3DMap(std::map<int, Signature> & signatures,
      |                      ^~~~~~~~
make[2]: *** [CMakeFiles/rgbd_mapping.dir/build.make:80: CMakeFiles/rgbd_mapping.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/rgbd_mapping.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
I would appreciate your help in telling me what can I do to have a continous mapping without pressing a key
Reply | Threaded
Open this post in threaded view
|

Re: Probem in continous RGBD mapping

matlabbe
Administrator
Hi,

Not sure what you are referring with
However, I need to press a key for mapping to continue otherwise it stops.
Do you refer to red screens / odometry lost?

For your compilation error, the code on wiki has not been updated, refer to https://github.com/introlab/rtabmap/tree/master/examples/RGBDMapping  (I'll try to fix the wiki in the mean time)
Reply | Threaded
Open this post in threaded view
|

Re: Probem in continous RGBD mapping

Nima
I have tried this link as well. The application now gets built without error. when I run it, I have to keep pressing a keyboard key so that when camera rotates , its new frames gets stitched to the old ones and make the map. if I stop pressing a keyboard key, mapping stops meaning even though the camera is connected and window of visualization is open, new frames of the camera doesn't get added to the map. I think the issue is due to these lines:
QAction * pause = new QAction(this);
this->addAction(pause);
pause->setShortcut(Qt::Key_Space);
connect(pause, SIGNAL(triggered()), this, SLOT(pauseDetection()));

I also recall that old wiki version didn't have this issue when I tried it in july but that version has the build error I posted.
Reply | Threaded
Open this post in threaded view
|

Re: Probem in continous RGBD mapping

matlabbe
Administrator
I just tried the example again, and it seems to do what is expected. The space bar would pause the mapping. If you don't press the space bar, you can move the camera around and the map will expand.

EDIT: maybe it is a platform/system specific problem. "rtabmap --version"?