Hi,
RTAB-Map doesn't have any TCP-IP connection that can be used to get data in or out the standalone library while mapping. rtabmap_ros should be then used to have online interaction with rtabmap.
Without ROS, if RTAB-Map has been integrated as a C++ library in your application, then you may use the events mechanism already in the library to subscribe to map updates. The
C++ RGB-D mapping tutorial is an example where the MapBuilder object is handling events from rtabmap to construct the 3D map online. The processStatistics() function is called (by handleEvent()) each time rtabmap updates the map. To show how to construct an occupancy grid map from the rtabmap events, it was easier to me to just update the code example. See this
commit. Make sure rtabmap is initialized with parameter "RGBD/CreateOccupancyGrid" set to true (see comment in main.cpp of the commit).
The "virtual bool handleEvent(UEvent * event)" function can be added to any class, just inherit UEventsHandler abstract class and call registerToEventsManager() to tell the UEventsManager you want the events.
cheers,
Mathieu