0
$\begingroup$

Rosanswers logo

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; idata.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("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 ;)


Originally posted by Filipe Santos on ROS Answers with karma: 346 on 2012-05-08

Post score: 2


Original comments

Comment by Felix Endres on 2012-05-08:
What ROS, PCL and OpenCV version do you use?

Comment by Filipe Santos on 2012-05-08:
Ubuntu 12.04; ROS Fuert; PCL 1.5.1; OpenCv 2.4.0 (update not 2.3.1)

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

you should change function name (hasValidXYZ -> isFinite) :-)

Because of version change, I change lots of things.

However, it doesn't work well. (Now I'm searching the problems)


Originally posted by munhoney with karma: 26 on 2012-05-08

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Filipe Santos on 2012-05-08:
Yeh, I'm facing another troubles :)

$\endgroup$
0
$\begingroup$

Rosanswers logo

Hey,

Your work here really helped me out, thanks!

One thing I found was that the hasValidXYZ function needed to be altered such that it becomes:

template <typename PointType>
inline bool hasValidXYZ(const PointType& p){
      return std::isfinite(p.x) && std::isfinite(p.y) && std::isfinite(p.z);
};

I have no idea why (I'm a ROS novice), but changing

template "typename PointType" 

to

template <typename PointType> 

and adding the trailing semi-colon sorted out the majority of my problems, and things compiled cleanly.

Thanks again,

Cameron


Originally posted by Toaster with karma: 13 on 2012-05-31

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Felix Endres on 2012-06-03:
Same here (on electric emys though)

Comment by Filipe Santos on 2012-06-03:
Sorry that was my mistake (here in this forum), because i don't know what correct tags should i use in this forum to put code.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.