Hi,
1. There is a c++ example without threads that you can get at the end of the
C++ RGBD Mapping tutorial (
main.cpp). If you have RGB-D images, you may want to use CameraRGBDImages class instead of CameraStereoImages.
2. You can stop mapping at some time (e.g., after 1000 frames), close the database, backup it somewhere and copy it back each time you want to restart from the latest state contained in the backup database. However, rtabmap will create a new map on restart (as it cannot assume that the robot is starting from the latest position). If a loop closure can be found on start, the new map will be merged with the old one in the database. When starting fresh the GUI with an old database, you will need to refresh the cache so you can view the previous map (see
Open a previous mapping session section on the Kinect tutorial).
cheers,
Mathieu