ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Compiling Cartographer ros failed (cartographer_pbstream)

asked 2022-01-31 08:12:09 -0500

apprentice_user gravatar image

updated 2022-01-31 08:13:47 -0500

Hi I followed the exact step by step procedure suggested at https://google-cartographer-ros.readt... to build the cartographer package. I came to the build and install step without any problems. when i use this command "catkin_make_isolated --install --use-ninja" i get an error and i couldn't figure it out for days.

The error I get is as follows.

Base path: /home/pi/elk_ws
Source space: /home/pi/elk_ws/src
Build space: /home/pi/elk_ws/build_isolated
Devel space: /home/pi/elk_ws/devel_isolated
Install space: /home/pi/elk_ws/install_isolated
Additional make Arguments: -l4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~  traversing 15 packages in topological order:
~~  - actionlib_msgs
~~  - cartographer (plain cmake)
~~  - common_msgs
~~  - diagnostic_msgs
~~  - geometry_msgs
~~  - cartographer_ros_msgs
~~  - nav_msgs
~~  - sensor_msgs
~~  - rplidar_ros
~~  - shape_msgs
~~  - stereo_msgs
~~  - trajectory_msgs
~~  - visualization_msgs
~~  - cartographer_ros
~~  - cartographer_rviz
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

==> Processing catkin package: 'actionlib_msgs'
build.ninja exists, skipping explicit cmake invocation...
==> ninja build.ninja in '/home/pi/elk_ws/build_isolated/actionlib_msgs'
ninja: no work to do.
==> ninja -l4 in '/home/pi/elk_ws/build_isolated/actionlib_msgs'
[3/3] cd /home/pi/elk_ws/build_isolated/actionlib_msgs && /home/pi/elk_ws/build_isolated/actionlib_msgs/catkin_genera..._check_deps.py actionlib_msgs /home/pi/elk_ws/src/common_msgs/actionlib_msgs/msg/GoalStatus.msg actionlib_msgs/GoalID
==> ninja install in '/home/pi/elk_ws/build_isolated/actionlib_msgs'
[3/4] Install the project...
-- Install configuration: ""
-- Up-to-date: /home/pi/elk_ws/install_isolated/_setup_util.py
-- Up-to-date: /home/pi/elk_ws/install_isolated/env.sh
-- Up-to-date: /home/pi/elk_ws/install_isolated/setup.bash
-- Up-to-date: /home/pi/elk_ws/install_isolated/local_setup.bash
-- Up-to-date: /home/pi/elk_ws/install_isolated/setup.sh
-- Up-to-date: /home/pi/elk_ws/install_isolated/local_setup.sh
-- Up-to-date: /home/pi/elk_ws/install_isolated/setup.zsh
-- Up-to-date: /home/pi/elk_ws/install_isolated/local_setup.zsh
-- Up-to-date: /home/pi/elk_ws/install_isolated/.rosinstall
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/msg/GoalID.msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/msg/GoalStatus.msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/msg/GoalStatusArray.msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/cmake/actionlib_msgs-msg-paths.cmake
-- Up-to-date: /home/pi/elk_ws/install_isolated/include/actionlib_msgs
-- Up-to-date: /home/pi/elk_ws/install_isolated/include/actionlib_msgs/GoalStatus.h
-- Up-to-date: /home/pi/elk_ws/install_isolated/include/actionlib_msgs/GoalStatusArray.h
-- Up-to-date: /home/pi/elk_ws/install_isolated/include/actionlib_msgs/GoalID.h
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/msg/GoalStatusArray.l
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/msg/GoalStatus.l
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/msg/GoalID.l
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/manifest.l
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/_package_GoalStatus.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/_package_GoalID.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/_package_GoalStatusArray.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/GoalStatusArray.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/actionlib_msgs-msg.asd
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/GoalStatus.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/_package.lisp ...
(more)
edit retag flag offensive close merge delete

Comments

I tried this but still I am getting the same error

AutoDiffLocalParameterization : public LocalParameterization {
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<CLIPPED>
/usr/bin/ld: libcartographer.a(histogram.cc.o): in function `cartographer::common::Histogram::ToString[abi:cxx11](int) const':
histogram.cc:(.text+0x372): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<std::basic_string_view<char, std::char_traits<char> > >)'
/usr/bin/ld: histogram.cc:(.text+0x94f): undefined reference to `absl::lts_20211102::strings_internal::AppendPieces(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::initializer_list<std::basic_string_view<char, std::char_traits<char> > >)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
<== Failed to process package 'cartographer': 
  Command '['ninja', '-j4', '-l4']' returned non-zero exit status 1.
Ramba gravatar image Ramba  ( 2022-07-10 05:05:34 -0500 )edit

@Ramba, please don't post answers that are not actually answers. I've slightly edited your answer and reposted as a comment. If you are still having an issue, I'd recommend opening a new question and linking to this thread and explaining how the recommended fix is not working.

jarvisschultz gravatar image jarvisschultz  ( 2022-07-11 11:02:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-01-31 21:22:53 -0500

ljaniec gravatar image

The part undefined reference to symbol __atomic_load_8 seems to be connected with similar problems:

Adding this line in the src/cartographer/CMakeLists.txt and _src/cartographer_ros/cartographer_ros/CMakeLists.txt set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")

  • there, with two ways of approach:

1)

nano CMakeLists.txt

go to the bottom and add in the file:

set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")

2)

I finally got it working by intsallint gcc 5 and trying again! sudo apt-get install gcc-5 g++-5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

sudo update-alternatives --set gcc "/usr/bin/gcc-5"

Please comment if you tried these and what did you get.

edit flag offensive delete link more

Comments

Very nice answer @ljaniec

osilva gravatar image osilva  ( 2022-02-01 01:37:17 -0500 )edit
1

thanks this solution solved my problem

apprentice_user gravatar image apprentice_user  ( 2022-02-02 01:13:45 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-01-31 08:12:09 -0500

Seen: 205 times

Last updated: Jul 11