0
$\begingroup$

Rosanswers logo

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

Originally posted by drew212 on ROS Answers with karma: 57 on 2011-09-15

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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++ ?


Originally posted by Daniel Canelhas with karma: 465 on 2011-10-17

This answer was ACCEPTED on the original site

Post score: 6

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by DimitriProsser with karma: 11163 on 2011-09-15

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by drew212 on 2011-09-15:
I actually mistyped, i'm using electric.

$\endgroup$

Your Answer

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