0
$\begingroup$

Rosanswers logo

Hi, I am using 11.04 Ubuntu, ROS Electric. I compiled the RGBDslam package as mentioned in http://www.ros.org/wiki/rgbdslam with the command

rosmake --rosdep-install rgbdslam

I got the following errors

[rosmake-1] Starting >>> rgbdslam [ make ]                                                                                                                              
[ rosmake ] All 36 linesgbdslam: 8.0 sec ]                                                                                                   [ 1 Active 60/61 Complete ]
{-------------------------------------------------------------------------------
  mkdir -p bin
  cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
  [rosbuild] Building package rgbdslam
  [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/rospy/cmake/rospy.cmake
  [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/roslisp/cmake/roslisp.cmake
  [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /workspace/karthik/RRC/ros_workspace/rgbdslam/build
  cd build && make -l4
  make[1]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[2]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[3]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[3]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  [  0%] Built target rospack_genmsg_libexe
  make[3]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[3]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  [  0%] Built target rosbuild_precompile
  make[3]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  Scanning dependencies of target rgbdslam
  make[3]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[3]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  [  5%] Building CXX object CMakeFiles/rgbdslam.dir/src/graph_manager.o
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/graph_manager.cpp: In member function ‘void GraphManager::visualizeFeatureFlow3D(unsigned int, bool) const’:
  /workspace/karthik/RRC/ros_workspace/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’
  /workspace/karthik/RRC/ros_workspace/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’
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/graph_manager.cpp: In function ‘void transformAndAppendPointCloud(const pointcloud_type&, pointcloud_type&, tf::Transform, float)’:
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/graph_manager.cpp:1043:67: error: invalid conversion from ‘const float*’ to ‘float*’
  /workspace/karthik/RRC/ros_workspace/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
  make[3]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[2]: *** [CMakeFiles/rgbdslam.dir/all] Error 2
  make[2]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
-------------------------------------------------------------------------------}

I found this issue already answered for this issue at http://answers.ros.org/question/2183/rgbdslam-compiler-errors But it didn't work for me. When i followed the solution proposed by Daniel Canelhas, by editing the line 1043 in graph_manager.cpp with

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

I am getting the following errors when i compile after this change.

[rosmake-2] Starting >>> rgbdslam [ make ]                                                                                                                              
[ rosmake ] All 39 linesgbdslam: 23.6 sec ]                                                                                                  [ 1 Active 60/61 Complete ]
{-------------------------------------------------------------------------------
  mkdir -p bin
  cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
  [rosbuild] Building package rgbdslam
  [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/rospy/cmake/rospy.cmake
  [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/roslisp/cmake/roslisp.cmake
  [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /workspace/karthik/RRC/ros_workspace/rgbdslam/build
  cd build && make -l4
  make[1]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[2]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[3]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[3]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  [  0%] Built target rospack_genmsg_libexe
  make[3]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[3]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  [  0%] Built target rosbuild_precompile
  make[3]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[3]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[3]: Entering directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  [  5%] Building CXX object CMakeFiles/rgbdslam.dir/src/graph_manager.o
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/graph_manager.cpp: In member function ‘void GraphManager::visualizeFeatureFlow3D(unsigned int, bool) const’:
  /workspace/karthik/RRC/ros_workspace/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’
  /workspace/karthik/RRC/ros_workspace/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’
  [ 10%] Building CXX object CMakeFiles/rgbdslam.dir/src/glviewer.o
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/glviewer.cpp: In member function ‘void GLViewer::pointCloud2GLStrip(const pointcloud_type*)’:
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/glviewer.cpp:300:50: error: in C++98 ‘origin’ must be initialized by constructor, not by ‘{...}’
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/glviewer.cpp:300:50: error: could not convert ‘{{{0.0}}, {{0.0}}}’ to ‘const point_type’
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/glviewer.cpp: In member function ‘void GLViewer::pointCloud2GLList(const pointcloud_type*)’:
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/glviewer.cpp:446:50: error: in C++98 ‘origin’ must be initialized by constructor, not by ‘{...}’
  /workspace/karthik/RRC/ros_workspace/rgbdslam/src/glviewer.cpp:446:50: error: could not convert ‘{{{0.0}}, {{0.0}}}’ to ‘const point_type’
  make[3]: *** [CMakeFiles/rgbdslam.dir/src/glviewer.o] Error 1
  make[3]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[2]: *** [CMakeFiles/rgbdslam.dir/all] Error 2
  make[2]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `/workspace/karthik/RRC/ros_workspace/rgbdslam/build'
-------------------------------------------------------------------------------}

So can someone help me out in compiling the rgbdslam. Sorry for posting such a long question. I just wanted to be clear in what the issue is.

Thanks, Karthik


Originally posted by karthik on ROS Answers with karma: 2831 on 2011-11-10

Post score: 1


Original comments

Comment by Daniel Canelhas on 2011-11-12:
I think the second problem might be related to this warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x

Comment by Daniel Canelhas on 2011-11-12:
I think the second problem might be related to this warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x (ie, add one of those flags...or maybe I just had to remove some of the curly brackets?) Feel free to add your solution to my earlier answer in any case

Comment by LiMuBei on 2011-11-11:
Well, the solution seems to have solved your first problem. Now you have another compilation problem. check out lines 300 and 446 in glviewer.cpp to see what could be the cause for this.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Thanks LiMuBei, I did checkout for the error before posting the question. I rechecked the error and replaced the lines 300 and 446 in the glviewer.cpp with the following lines.

unsigned int kr=0, kb=0, kg=0;
const point_type origin(kr, kb, kg);

And it worked. I don't know if these errors are environment specific. In that case they have to be incorporated in the source as well at both glviewer.cpp and graphmanager.cpp.

Thanks, Karthik


Originally posted by karthik with karma: 2831 on 2011-11-11

This answer was ACCEPTED on the original site

Post score: 6

$\endgroup$

Your Answer

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