Doubts in regards to standalone version

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

Doubts in regards to standalone version

CrisMiranda
Hi,

I've just started using RTAB map as part of a big project (that does not use ROS, so I'm trying to avoid it) and I have a  doubt.

My goal is to generate a 2D occupancy grid to work with my navigation algorithms.  What I'm doing right now is creating a map, saving it and then navigating offline. However, I would like to create the 2D map and work on It online, is there any way to do this without ROS?

Thank you very much in advance!


Reply | Threaded
Open this post in threaded view
|

Re: Doubts in regards to standalone version

matlabbe
Administrator
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


Reply | Threaded
Open this post in threaded view
|

Re: Doubts in regards to standalone version

CrisMiranda
Hi Mathieu,
Thank you so much for your help! I'm finally able to move a little forward with this project (I'm struggling a bit on doing what I want without ROS, but little by little It will all work out! ).

Anyway, can I ask you something else? I'm trying to access the RGB image stream (using the ASUS Xtion). Does RTAB-map have a function for accessing it? I was doing it by myself with OpenCV and OpenNI, but the program is crashing.


Thank you again so much, and sorry for bothering you.
Best!
Reply | Threaded
Open this post in threaded view
|

Re: Doubts in regards to standalone version

matlabbe
Administrator
Hi,

See CameraOpenNI2 class:
Transform opticalRotation(0,0,1,0, -1,0,0,0, 0,-1,0,0);
CameraOpenNI2 camera("", CameraOpenNI2::kTypeColorDepth, 0, opticalRotation);
camera.init();
SensorData data = camera.takeImage();
...
See also this c++ example.

cheers,
Mathieu