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

RGBDSlam Compiler Errors

asked 2011-09-15 01:41:12 -0600

drew212 gravatar image

updated 2014-01-28 17:10:23 -0600

ngrennan gravatar image

When compiling RGBDSlam I get a couple of errors. My ROS version is Electric and Ubuntu release is natty. Here are the errors:

[ 47%] Building CXX object CMakeFiles/rgbdslam.dir/src/openni_listener.o
In file included from /opt/ros/electric/stacks/rgbdslam/src/openni_listener.cpp:24:0:
/opt/ros/electric/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h: In static member function ‘static sensor_msgs::Image_<std::allocator<void> >::Ptr sensor_msgs::CvBridge::cvToImgMsg(const IplImage*, std::string)’:
/opt/ros/electric/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:408:55: warning: ‘static bool sensor_msgs::CvBridge::fromIpltoRosImage(const IplImage*, sensor_msgs::Image&, std::string)’ is deprecated (declared at /opt/ros/electric/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:307)
/opt/ros/electric/stacks/rgbdslam/src/openni_listener.cpp: In member function ‘void OpenNIListener::cameraCallback(const sensor_msgs::ImageConstPtr&, const sensor_msgs::ImageConstPtr&, const sensor_msgs::PointCloud2ConstPtr&)’:
/opt/ros/electric/stacks/rgbdslam/src/openni_listener.cpp:85:24: warning: ‘sensor_msgs::CvBridge::CvBridge()’ is deprecated (declared at /opt/ros/electric/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:64)
[ 52%] Building CXX object CMakeFiles/rgbdslam.dir/src/qtcv.o
[ 57%] Building CXX object CMakeFiles/rgbdslam.dir/src/node.o
[ 63%] Building CXX object CMakeFiles/rgbdslam.dir/src/graph_manager.o
/opt/ros/electric/stacks/rgbdslam/src/graph_manager.cpp: In member function ‘void GraphManager::visualizeFeatureFlow3D(unsigned int, bool) const’:
/opt/ros/electric/stacks/rgbdslam/src/graph_manager.cpp:442:9: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 8 has type ‘std::vector<cv::DMatch, std::allocator<cv::DMatch> >::size_type’
/opt/ros/electric/stacks/rgbdslam/src/graph_manager.cpp:442:9: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 9 has type ‘std::vector<cv::DMatch, std::allocator<cv::DMatch> >::size_type’
/opt/ros/electric/stacks/rgbdslam/src/graph_manager.cpp: In function ‘void transformAndAppendPointCloud(const pointcloud_type&, pointcloud_type&, tf::Transform, float)’:
/opt/ros/electric/stacks/rgbdslam/src/graph_manager.cpp:1043:67: error: invalid conversion from ‘const float*’ to ‘float*’
/opt/ros/electric/stacks/rgbdslam/src/graph_manager.cpp:1043:67: error:   initializing argument 1 of ‘Eigen::Map<MatrixType, MapOptions, StrideType>::Map(Eigen::Map<MatrixType, MapOptions, StrideType>::PointerArgType, Eigen::Map<MatrixType, MapOptions, StrideType>::Index, Eigen::Map<MatrixType, MapOptions, StrideType>::Index, const StrideType&) [with PlainObjectType = Eigen::Matrix<float, 3, 1>, int MapOptions = 0, StrideType = Eigen::Stride<0, 0>, Eigen::Map<MatrixType, MapOptions, StrideType>::PointerArgType = float*, Eigen::Map<MatrixType, MapOptions, StrideType>::Index = int]’
make[3]: *** [CMakeFiles/rgbdslam.dir/src/graph_manager.o] Error 1
edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
6

answered 2011-10-17 06:14:47 -0600

Daniel Canelhas gravatar image

updated 2011-10-17 20:04:38 -0600

I had the same compilation errors with rgbdslam under ubuntu 10.10 ros-electric.

I had to change a few lines in the source code to get it working (really, just going after the compiler errors and changing each expression to something equivalent).

On line 1043 the compiler is complanining that the argument passed to the function is a constant (cannot be changed). However, the function expects a mutable variable. To solve it in an easy way, copy the contents of the const float* to a new variable that is declared as float* and pass that to the function instead. The hard but more correct way would be to change the function to accept a pointer to constant floats instead.

For example, replace line 1043 in graph_manager.cpp with the following two lines and try compiling it again.

 pointcloud_type ncloud=cloud_in;
 Eigen::Map<Eigen::Vector3f> p_in (&ncloud.points[i].x, 3, 1);

I don't know how this code could have worked earlier, maybe this is related to new versions of g++ ?

edit flag offensive delete link more
2

answered 2011-09-15 01:45:27 -0600

DimitriProsser gravatar image

updated 2011-09-15 02:03:28 -0600

It appears that you've checked out the Electric version of the RGBDSlam package, and you said that you're currently running Diamondback, so this could be causing a problem. Electric uses Eigen3 library, while Diamondback uses the Eigen2 library. This might be the issue. I hope this helps.

Also, you could look here under heading # 5 to see some solutions to common compilation issues.

edit flag offensive delete link more

Comments

I actually mistyped, i'm using electric.
drew212 gravatar image drew212  ( 2011-09-15 01:50:18 -0600 )edit
0

answered 2011-10-17 02:15:55 -0600

I have not tried the latest svn version against electric, so I am not sure what causes this problem. I suggest the latest snapshot which does compile with diamondback and electric. The this installation manual for instructions.

edit flag offensive delete link more

Comments

Hi Felix. Even i am getting the same error in line 1043 graph_manager.cpp. I am using 11.04 Ubuntu and ROS electric. Above solution of Daniel didn't solve issue. I get glviewer.cpp:300:50: error: in C++98 ‘origin’ must be initialized by constructor, not by ‘{...}’. I am posting this as a new quest.
karthik gravatar image karthik  ( 2011-11-10 10:13:37 -0600 )edit
If someone had this issue on glviewer.cpp then i posted the solution at http://answers.ros.org/question/2857/rgbdslam-compile-errors thanks to Daniel Canelhas for the answer to the previous issue.
karthik gravatar image karthik  ( 2011-11-11 05:02:56 -0600 )edit

Question Tools

Stats

Asked: 2011-09-15 01:41:12 -0600

Seen: 1,162 times

Last updated: Oct 17 '11