RGBDSLAM Problem compilation (fuerte and cv 2.4.0)( solved)
Hello I'm compiling the rgbdslam (like http://www.ros.org/wiki/rgbdslam). And i get problems:
(Ubuntu 12.04; ROS Fuert; PCL 1.5.1; OpenCv 2.3.1(in OS) and opencv 2.4.0 (in ros))
UPDATE RESOLUTION
In rgbdslam/src/openni_listener.cpp:
//#include "pcl/common/transform.h" (i think this not exist yet! is now transforms.h) ... //#include "pcl/ros/for_each_type.h" (libpcl1.5, don't have this?!)
in rgbdslam/src/glviewer.cpp (add):
#include "GL/glut.h" ... #include "boost/foreach.hpp" #include "pcl/point_types.h" ... template <typename PointType> inline bool hasValidXYZ(const PointType& p){ return std::isfinite(p.x) && std::isfinite(p.y) && std::isfinite(p.z); };
in rgbdslam/src/misc.cpp (add):
#include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/nonfree/nonfree.hpp" ... // based on http://answers.ros.org/question/30249/minimal-topics-for-rgbdslam sensor_msgs::ImagePtr rgb_msg(new sensor_msgs::Image); rgb_msg->header = rgb_msg1->header; rgb_msg->height = rgb_msg1->height; rgb_msg->width = rgb_msg1->width; rgb_msg->encoding = rgb_msg1->encoding; rgb_msg->is_bigendian = rgb_msg1->is_bigendian; rgb_msg->step = rgb_msg1->step; rgb_msg->data = rgb_msg1->data; if (rgb_msg->encoding.compare("bgr8") == 0) { rgb_msg->encoding = "rgb8"; for (int i=0; i<rgb_msg->data.size(); i+=3) { char temp_red = rgb_msg->data[i]; rgb_msg->data[i] = rgb_msg->data[i+2]; rgb_msg->data[i+2] = temp_red; } } .... in line 287 fd = new SiftFeatureDetector(); //SIFT::DetectorParams::GET_DEFAULT_THRESHOLD(), //SIFT::DetectorParams::GET_DEFAULT_EDGE_THRESHOLD()); ROS_INFO("Default SIFT threshold:"); /*%f, Default SIFT Edge Threshold: %f", SIFT::DetectorParams::GET_DEFAULT_THRESHOLD(), SIFT::DetectorParams::GET_DEFAULT_EDGE_THRESHOLD());*/ ... in line 310: fd = new OrbFeatureDetector();//params->get<int>("max_keypoints"), //ORB::CommonParams(1.2, ORB::CommonParams::DEFAULT_N_LEVELS, 31, ORB::CommonParams::DEFAULT_FIRST_LEVEL)); }
in CMAKEFILE
SET(LIBS_LINK GL GLU -lgl2ps ${G2O_LIBS} ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${OpenCV_LIBS} -lboost_signals)
And now appears to work :) :D ;)
What ROS, PCL and OpenCV version do you use?
Ubuntu 12.04; ROS Fuert; PCL 1.5.1; OpenCv 2.4.0 (update not 2.3.1)