Robotics StackExchange | Archived questions

RGBDSLAM in Gazebo environment

Dear Felix Endres, dear ROS users

I would like to know if it's possible to use RGBDSLAM in outdoor simulated environment. I use a simulated kinect with the plugin provided in gazebo ros (gazeborosopenni_kinect). Then I launch rgbdslam.launch. I change some params to remap topics used by camera. This is my launch file:

<!-- Input data settings--> <!--if empty, poincloud will be reconstructed from image and depth -->

<param name="fixed_frame_name"                     value="/Robot0/map"/>
<param name="base_frame_name"                      value="/Robot0/base_link"/>

<!-- These are the default values of some important parameters -->
<param name="config/feature_extractor_type"        value="ORB"/><!-- also available: SIFT, SIFTGPU, SURF, SURF128 (extended SURF), ORB. -->
<param name="config/feature_detector_type"         value="ORB"/><!-- also available: SIFT, SURF, GFTT (good features to track), ORB. -->
<param name="config/detector_grid_resolution"      value="3"/><!-- detect on a 3x3 grid (to spread ORB keypoints and parallelize SIFT and SURF) -->
<param name="config/max_keypoints"                 value="600"/><!-- Extract no more than this many keypoints -->
<param name="config/max_matches"                   value="300"/><!-- Keep the best n matches (important for ORB to set lower than max_keypoints) -->

<param name="config/min_sampled_candidates"        value="4"/><!-- Frame-to-frame comparisons to random frames (big loop closures) -->
<param name="config/predecessor_candidates"        value="4"/><!-- Frame-to-frame comparisons to sequential frames-->
<param name="config/neighbor_candidates"           value="4"/><!-- Frame-to-frame comparisons to graph neighbor frames-->
<param name="config/ransac_iterations"             value="100"/>
<param name="config/cloud_creation_skip_step"      value="2"/><!-- subsample the images' pixels (in both, width and height), when creating the cloud (and therefore reduce memory consumption) -->


<param name="config/cloud_display_type"            value="POINTS"/><!-- Show pointclouds as points (as opposed to TRIANGLE_STRIP) -->
<param name="config/pose_relative_to"              value="largest_loop"/><!-- optimize only a subset of the graph: "largest_loop" = Everything from the earliest matched frame to the current one. Use "first" to optimize the full graph, "inaffected" to optimize only the frames that were matched (not those inbetween for loops) -->
<param name="config/backend_solver"                value="pcg"/><!-- pcg is faster and good for continuous online optimization, cholmod and csparse are better for offline optimization (without good initial guess)-->
<param name="config/optimizer_skip_step"           value="1"/><!-- optimize only every n-th frame -->

First error I note is because gazeboros plugin, if pointcloaud is not dense, automatically change width and height from structured to unstructured data (for example imageraw has width = 640 and height = 480, points come 307200 x 1). I've modified openni_listener.cpp to remove this error. So in the kinectCallbak

oid OpenNIListener::kinectCallback (const sensormsgs::ImageConstPtr& visualimgmsg, const sensormsgs::ImageConstPtr& depthimgmsg,
const sensormsgs::PointCloud2ConstPtr& sensorpoint_cloud) {

//Pointcloud reorganization into structured matrix sensormsgs::PointCloud2::Ptr pointcloud = boost::makeshared<sensormsgs::PointCloud2>(); if(sensorpointcloud->height == 1 && sensorpointcloud->width == visualimgmsg->width * visualimgmsg->height) { ROSWARNSTREAM("Reorganization of the poincloud as structured"); pcl::PointCloudpcl::PointXYZRGB pclcloud; pcl::fromROSMsg(*sensorpointcloud, pclcloud); pclcloud.width = visualimgmsg->width; pclcloud.height = visualimgmsg->height; pcl::toROSMsg(pclcloud, *pointcloud); } else pointcloud = boost::makeshared(*sensorpointcloud); ... } Thi is the only modification to origin code I make. Now I can see images and feature estimated but I get some errors and /rgbdslam/onlineclouds and /rgbdslam/batchclouds are both empty.

Can you help me? Thanks a lot

Anna

Asked by anna on 2016-06-17 09:10:54 UTC

Comments

Answers