Re: Develop sensor driver for OpenCV OAK-D to standalone RTAB-Map

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Develop-sensor-driver-for-OpenCV-OAK-D-to-standalone-RTAB-Map-tp7426p7429.html

Hi Bob,

The OAK-D interface looks also proprietary: https://github.com/luxonis/depthai-core/blob/main/include/depthai/device.hpp

You would have to make a CameraOAKD class. For an example, it depends if the images are received in callbacks or on request (e.g., device.capture()). You can look at the Camera abstract class, you would have to override those functions in subclass:
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "") = 0;
virtual bool isCalibrated() const = 0;
virtual std::string getSerial() const = 0;
virtual bool odomProvided() const { return false; }
virtual SensorData captureImage(CameraInfo * info = 0) = 0;
init: this is where we create the device, get camera intrinsics and start the device.
isCalibrated: return true if captured images are rectified.
getSerial: return serial of the device.
odomProvided: if the device provides odometry
captureImage: You have to set left/right + stereo model for stereo images in a rtabmap::SensorData. For RGB-D data, you have to set rgb image and depth image + camera model of the rgb camera. If odometry is provided, it should be set in optional Camera info argument (if not null).

cheers,
Mathieu