Closed ResearcherYan closed 5 months ago
Similar problem for me:
/colcon_ws/install/cslam/lib/cslam/pose_graph_manager: symbol lookup error: /colcon_ws/install/cslam/lib/cslam/pose_graph_manager: undefined symbol: _ZNK5gtsam15NonlinearFactor5errorERKNS_12HybridValuesE
Hi! The GTSAM version is the problem. As you figured out, it needs to be 4.1 or higher, otherwise the robust solver GNC is not available. So you need to make sure that the pose_grapg_manager uses GTSAM 4.1 when building. One solution could be to build/install everything, including LIO-SAM, with 4.1.
Fortunately, I might have an even better solution for you! I recently added a Dockerfile to isolate Swarm-SLAM in a container and avoid conflicts with your base system. See here for the dockerfile as well as build and run instructions in the makefile https://github.com/lajoiepy/cslam_experiments/tree/main/docker
@lajoiepy Thanks a lot for your generous help! In the beginning, I tried your first solution to install GTSAM 4.1.1 to /usr/local
and rebuild LIO-SAM, which confirmed that LIO-SAM can't work with GTSAM 4.1.1. Then, I transferred to the docker solution. I'll show my successful deployment procedure to help someone who has similar problems.
@mjforan Hey my friend, maybe you could try out my solution to see whether it suits you.
Download Dockerfile.lidar
and makefile
in cslam_experiments/docker to local folder ~/ros2_ws/src/Swarm-SLAM/src/cslam_experiments/docker
. Directly building based on the source dockerfile will produce error File has unexpected size (1347063 != 1459378). Mirror sync in progress? [IP: 192.168.111.241 8081]
. So I modify the dockerfile and keep only the first line as follows:
FROM ros:humble-perception
Then build the docker image.
cd ~/ros2_ws/src/Swarm-SLAM/src/cslam_experiments/docker
make build
Based on the built image, then create the container. Don't use make cpu_run
to create the container, otherwise the later command apt install zenoh-bridge-ros2dds
will lead to the error System has not been booted with systemd as init system (PID 1). Can't operate.
docker run --privileged -itd --rm --ipc host --net host --pid host --name swarmslam swarmslam
docker exec -it swarmslam bash
Inside the container, I install the rest dependencies.
apt update
apt install python3-pip python3-vcstool vim -y
git clone https://github.com/MISTLab/Swarm-SLAM.git
cd Swarm-SLAM && mkdir src && vcs import src < cslam.repos
pip install -r requirements.txt
cd /
git clone https://github.com/ros/rosdistro
vim /etc/ros/rosdep/sources.list.d/20-default.list
# Modify the following lines
yaml file:///rosdistro/rosdep/osx-homebrew.yaml osx
yaml file:///rosdistro/rosdep/base.yaml
yaml file:///rosdistro/rosdep/python.yaml
yaml file:///rosdistro/rosdep/ruby.yaml
gbpdistro file:///rosdistro/releases/fuerte.yaml fuerte
vim /usr/lib/python3/dist-packages/rosdep2/sources_list.py
# Modify the following line
DEFAULT_SOURCES_LIST_URL = 'file:///etc/ros/rosdep/sources.list.d/20-default.list'
vim /usr/lib/python3/dist-packages/rosdep2/rep3.py
# Modify the following line
REP3_TARGETS_URL = 'file:///rosdistro/releases/targets.yaml'
vim /usr/lib/python3/dist-packages/rosdistro/__init__.py
# Modify the following line
DEFAULT_INDEX_URL = 'file:///rosdistro/index-v4.yaml'
# After modifying the above files, `rosdep update` will go way faster
rosdep update
cd Swarm-SLAM
rosdep install --from-paths src --ignore-src -r -y
. /opt/ros/humble/setup.sh
colcon build
cd /
git clone https://github.com/MIT-SPARK/TEASER-plusplus.git
cd TEASER-plusplus && mkdir build && cd build
cmake -DTEASERPP_PYTHON_VERSION=3.10 ..
make teaserpp_python
cd python && pip install .
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
echo "source Swarm-SLAM/install/setup.bash" >> ~/.bashrc
cd /
apt install wget
wget -O head_cslam https://api.github.com/repos/lajoiepy/cslam/commits?per_page=1
wget -O head_cslam_interfaces https://api.github.com/repos/lajoiepy/cslam_interfaces/commits?per_page=1
wget -O head_cslam_experiments https://api.github.com/repos/lajoiepy/cslam_experiments/commits?per_page=1
cd Swarm-SLAM/src/cslam && git pull
cd ../cslam_experiments && git pull
cd ../cslam_interfaces && git pull
cd ../.. && colcon build
echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | tee -a /etc/apt/sources.list > /dev/null
apt update && apt install zenoh-bridge-ros2dds
# At last, some addtional dependencies also needs to be installed.
pip install pickle5
apt install ros-humble-rtabmap*
Then ros2 launch cslam_experiments graco_lidar.launch.py
goes without any error!
I also had GTSAM 4.1.1 installed as per the instructions and still got that error. I was able to get the existing Dockerfile to build without issue. I had to manually install rtabmap-odom but everything seems to work. Just waiting on a dataset to download so I can fully test it.
Hello, I've been carefully preparing the prerequisite steps of Swarm-SLAM following the Start-up Instructions.
GTSAM installation
One thing different from the standard installation procedure is the GTSAM installing location. Since I used the following command to install GTSAM through ppa when I deployed LIO-SAM code,
I chose to install GTSAM 4.1.1 locally in the folder
/home/yan/cmake_ws/gtsam/install
when deploying Swarm-SLAM. So I usedcmake -DCMAKE_INSTALL_PREFIX:PATH=/home/yan/cmake_ws/gtsam/install ..
to set GTSAM install path. In the meantime, I did the following modification to mycslam/CMakeList.txt
to make sure it found the right version of GTSAM.colcon build
Then the
colcon build
output comes with some warning and a summary like1 package had stderr output: cslam
. The full output is shown below:Later I confirmed that these warnings and stderr emerged in the summary was caused by the line
find_package(pcl_ros REQUIRED)
in the CMakeLists.txt. Whilefind_package(GTSAM CONFIG REQUIRED)
itself didn't produce stderr output.Runtime error
Under this circumstance, I tried to launch the
graco_lidar.launch.py
but yield[ERROR] [pose_graph_manager-5]: process has died
. The log is shown below.The error
/home/yan/ros2_ws/install/cslam/lib/cslam/pose_graph_manager: undefined symbol: _ZNK5gtsam6Factor9printKeysERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt8functionIFS6_mEE
showed that there is something wrong with GTSAM. After that, I usedldd -r
to check the dynamic link library of node pose_graph_manager.The above errors show that pose_graph_manager has so many libraries unlinked.
Until then, I had no idea how to debug. So I'm here seeking your generous help. I'll appreciate any possible hint.