cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.12k stars 2.25k forks source link

Install error- Ubuntu 18.04 #1857

Closed gokulp01 closed 2 years ago

gokulp01 commented 3 years ago

Edit: Closing the issue as I fixed it. (The issue was something to do with the ceres)

The error:

<== Finished processing package [2 of 4]: 'cartographer_ros_msgs'

==> Processing catkin package: 'cartographer_ros'
==> Building with env: '/home/gokul/ros_garage/catkin_ws/install_isolated/env.sh'
build.ninja exists, skipping explicit cmake invocation...
==> ninja build.ninja in '/home/gokul/ros_garage/catkin_ws/build_isolated/cartographer_ros'
ninja: no work to do.
==> ninja -j8 -l8 in '/home/gokul/ros_garage/catkin_ws/build_isolated/cartographer_ros'
[2/13] Building CXX object CMakeFiles/cartographer_ros.dir/cartographer_ros/msg_conversion.cc.o
FAILED: CMakeFiles/cartographer_ros.dir/cartographer_ros/msg_conversion.cc.o 
/usr/bin/c++ -DGFLAGS_IS_A_DLL=0 -DROSCONSOLE_BACKEND_LOG4CXX -DROS_PACKAGE_NAME=\"cartographer_ros\" -DURDFDOM_HEADERS_HAS_SHARED_PTR_DEFS -D__CLANG_SUPPORT_DYN_ANNOTATION__ -I/home/gokul/ros_garage/catkin_ws/build_isolated/cartographer_ros -I/home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros -I/usr/src/googletest/googlemock/include -isystem /usr/include/lua5.3 -isystem /usr/local/include/pcl-1.12 -isystem /usr/include/eigen3 -isystem /home/gokul/ros_garage/catkin_ws/install_isolated/include -isystem /opt/ros/melodic/include -isystem /opt/ros/melodic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp -isystem /usr/include/pcl-1.8 -isystem /usr/include/ni -isystem /usr/include/openni2 -isystem /usr/include/vtk-6.3 -isystem /usr/include/freetype2 -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include -isystem /usr/lib/x86_64-linux-gnu/openmpi/include -isystem /usr/include/python2.7 -isystem /usr/include/hdf5/openmpi -isystem /usr/include/libxml2 -isystem /usr/include/jsoncpp -isystem /usr/include/tcl -isystem /home/gokul/catkin_ws/devel/include -O3 -DNDEBUG  -pthread -fPIC  -Wall -Wpedantic -Werror=format-security -Werror=missing-braces -Werror=reorder -Werror=return-type -Werror=switch -Werror=uninitialized -O3 -DNDEBUG -msse4.2 -mfpmath=sse -march=native -mavx2 -MD -MT CMakeFiles/cartographer_ros.dir/cartographer_ros/msg_conversion.cc.o -MF CMakeFiles/cartographer_ros.dir/cartographer_ros/msg_conversion.cc.o.d -o CMakeFiles/cartographer_ros.dir/cartographer_ros/msg_conversion.cc.o -c /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc
In file included from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:37:0:
/opt/ros/melodic/include/pcl_conversions/pcl_conversions.h: In function ‘void pcl_conversions::fromPCL(const pcl::Vertices&, pcl_msgs::Vertices&)’:
/opt/ros/melodic/include/pcl_conversions/pcl_conversions.h:356:30: error: no match for ‘operator=’ (operand types are ‘pcl_msgs::Vertices_<std::allocator<void> >::_vertices_type {aka std::vector<unsigned int>}’ and ‘const Indices {aka const std::vector<int>}’)
     vert.vertices = pcl_vert.vertices;
                              ^~~~~~~~
In file included from /usr/include/c++/7/vector:69:0,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/image.h:21,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/submap_painter.h:22,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.h:21,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:17:
/usr/include/c++/7/bits/vector.tcc:179:5: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]
     vector<_Tp, _Alloc>::
     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/vector.tcc:179:5: note:   no known conversion for argument 1 from ‘const Indices {aka const std::vector<int>}’ to ‘const std::vector<unsigned int>&’
In file included from /usr/include/c++/7/vector:64:0,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/image.h:21,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/submap_painter.h:22,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.h:21,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:17:
/usr/include/c++/7/bits/stl_vector.h:461:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]
       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:461:7: note:   no known conversion for argument 1 from ‘const Indices {aka const std::vector<int>}’ to ‘std::vector<unsigned int>&&’
/usr/include/c++/7/bits/stl_vector.h:482:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]
       operator=(initializer_list<value_type> __l)
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:482:7: note:   no known conversion for argument 1 from ‘const Indices {aka const std::vector<int>}’ to ‘std::initializer_list<unsigned int>’
In file included from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:37:0:
/opt/ros/melodic/include/pcl_conversions/pcl_conversions.h: In function ‘void pcl_conversions::moveFromPCL(pcl::Vertices&, pcl_msgs::Vertices&)’:
/opt/ros/melodic/include/pcl_conversions/pcl_conversions.h:373:41: error: no matching function for call to ‘std::vector<unsigned int>::swap(pcl::Indices&)’
     vert.vertices.swap(pcl_vert.vertices);
                                         ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/image.h:21,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/submap_painter.h:22,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.h:21,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:17:
/usr/include/c++/7/bits/stl_vector.h:1229:7: note: candidate: void std::vector<_Tp, _Alloc>::swap(std::vector<_Tp, _Alloc>&) [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]
       swap(vector& __x) _GLIBCXX_NOEXCEPT
       ^~~~
/usr/include/c++/7/bits/stl_vector.h:1229:7: note:   no known conversion for argument 1 from ‘pcl::Indices {aka std::vector<int>}’ to ‘std::vector<unsigned int>&’
In file included from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:37:0:
/opt/ros/melodic/include/pcl_conversions/pcl_conversions.h: In function ‘void pcl_conversions::toPCL(const Vertices&, pcl::Vertices&)’:
/opt/ros/melodic/include/pcl_conversions/pcl_conversions.h:390:30: error: no match for ‘operator=’ (operand types are ‘pcl::Indices {aka std::vector<int>}’ and ‘const _vertices_type {aka const std::vector<unsigned int>}’)
     pcl_vert.vertices = vert.vertices;
                              ^~~~~~~~
In file included from /usr/include/c++/7/vector:69:0,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/image.h:21,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/submap_painter.h:22,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.h:21,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:17:
/usr/include/c++/7/bits/vector.tcc:179:5: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]
     vector<_Tp, _Alloc>::
     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/vector.tcc:179:5: note:   no known conversion for argument 1 from ‘const _vertices_type {aka const std::vector<unsigned int>}’ to ‘const std::vector<int>&’
In file included from /usr/include/c++/7/vector:64:0,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/image.h:21,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/submap_painter.h:22,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.h:21,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:17:
/usr/include/c++/7/bits/stl_vector.h:461:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]
       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:461:7: note:   no known conversion for argument 1 from ‘const _vertices_type {aka const std::vector<unsigned int>}’ to ‘std::vector<int>&&’
/usr/include/c++/7/bits/stl_vector.h:482:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]
       operator=(initializer_list<value_type> __l)
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:482:7: note:   no known conversion for argument 1 from ‘const _vertices_type {aka const std::vector<unsigned int>}’ to ‘std::initializer_list<int>’
In file included from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:37:0:
/opt/ros/melodic/include/pcl_conversions/pcl_conversions.h: In function ‘void pcl_conversions::moveToPCL(pcl_msgs::Vertices&, pcl::Vertices&)’:
/opt/ros/melodic/include/pcl_conversions/pcl_conversions.h:407:41: error: no matching function for call to ‘std::vector<int>::swap(pcl_msgs::Vertices_<std::allocator<void> >::_vertices_type&)’
     pcl_vert.vertices.swap(vert.vertices);
                                         ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/image.h:21,
                 from /home/gokul/ros_garage/catkin_ws/install_isolated/include/cartographer/io/submap_painter.h:22,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.h:21,
                 from /home/gokul/ros_garage/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/msg_conversion.cc:17:
/usr/include/c++/7/bits/stl_vector.h:1229:7: note: candidate: void std::vector<_Tp, _Alloc>::swap(std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]
       swap(vector& __x) _GLIBCXX_NOEXCEPT
       ^~~~
/usr/include/c++/7/bits/stl_vector.h:1229:7: note:   no known conversion for argument 1 from ‘pcl_msgs::Vertices_<std::allocator<void> >::_vertices_type {aka std::vector<unsigned int>}’ to ‘std::vector<int>&’
ninja: build stopped: subcommand failed.
<== Failed to process package 'cartographer_ros': 
  Command '['/home/gokul/ros_garage/catkin_ws/install_isolated/env.sh', 'ninja', '-j8', '-l8']' returned non-zero exit status 1

Reproduce this error by running:
==> cd /home/gokul/ros_garage/catkin_ws/build_isolated/cartographer_ros && /home/gokul/ros_garage/catkin_ws/install_isolated/env.sh ninja -j8 -l8

I followed the documentation specified here

The error pops up while running catkin_make_isolated --install --use-ninja command. I also tried catkin_make_isolated --use-ninja --pkg cartographer cartographer_ros, but the issue still persists.

Any help would be much appreciated!

Thanks :)