Override camera thread

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

Override camera thread

brunoeducsantos
Hi,

My goal is using RTABMAP as a standalone API.
From this point, I aim to integrate RTABMAP with my camera streaming class. Where and how can I override  RTABMAP camera thread in a simple way to integrate my camera class without changing RTABMAP much?

Best,

Bruno
Reply | Threaded
Open this post in threaded view
|

Re: Override camera thread

brunoeducsantos
Alternatively, is there a way to integrate as a library into my camera class?
Reply | Threaded
Open this post in threaded view
|

Re: Override camera thread

matlabbe
Administrator
Hi,

If your camera inherits from Camera class, it will be straightforward to integrate to RTAB-Map. For example based on C++ RGBD example:
Transform opticalRotation(0,0,1,0, -1,0,0,0, 0,-1,0,0);

// Create custom camera driver with standard arguments 
// of Camera class: FrameRate (0=as fast as camera can take images), LocalTransform
Camera * camera = new MyAwesomeCameraDriver(0, opticalRotation); 

if(camera->init())
{
    CameraThread cameraThread(camera);
}

Camera is an abstract class, you should implement at least the pure virtual functions. Many implementations can be found in CameraRGBD and CameraStereo.

What is the model of the camera? Maybe one of the general drivers already in rtabmap can support it.

cheers,
Mathieu