ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

distortion model depth camera

asked 2017-01-18 09:03:08 -0500

aerydna gravatar image

Hi everyone, i'm using rtabmap with his ros wrapper for slam operations. i've made a distortion model (a ".bin" file) following this guide https://github.com/introlab/rtabmap/w... but i don't know how to use the distortion model with the ros wrapper of rtabmap. the calibration tutorial show where to link the distortion model file in the standalone application only. thanks in advance

Andrea Ruzzenenti

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-01-27 14:25:39 -0500

matlabbe gravatar image

updated 2017-01-30 14:52:47 -0500

EDIT: there is already a nodelet existing in rtabmap_ros source doing the work below, see this link.

Hi,

Unfortunatly, since this feature is quite new, there is no existing node yet that can distort the depth image using the distortion model.

You may create one by subscribing to depth image and loading the *.bin generated by the standalone.

#include "rtabmap/core/clams/discrete_depth_distortion_model.h"

clams::DiscreteDepthDistortionModel model;

void init(const std::string & modelPath) {
    model.load(modelPath);
    if(!model.isValid())
    {
        ROS_ERROR("Loaded distortion model \"%s\" is not valid!", modelPath.c_str());
    }
}

void callback(...) {
   cv::Mat depth = //... (cv_bridge subscription to depth msg)
   model.undistort(depth);
   // ... republish the depth undistorted
}

cheers

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-01-18 09:03:08 -0500

Seen: 611 times

Last updated: Jan 30 '17