Compiling LIO-SAM (ROS 2 Humble) inside the ros2_sims_ws

As part of the following:

cd /home/simulations/ros2_sims_ws/src/drones_ROS2/gtsam/
mkdir build
cd build
cmake …
make -j4
sudo make install
cd /home/simulations/ros2_sims_ws
colcon build --symlink-install
source install/setup.bash

While compiling LIO-SAM (ROS 2 Humble) inside the ros2_sims_ws provided in the simulation environment, the build consistently fails at mapOptimization.cpp with:

c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
gmake[2]: *** [CMakeFiles/lio_sam_mapOptimization.dir/src/mapOptmization.cpp.o] Error 1

Hi @yousefyaseen, are you working on a rosject or a course?

I don’t recommend working with the provided ros2_sims_ws. If it breaks for any reason, you will not be able to run the simulation anymore. Please work on your own ros2_ws

As for the error, it is a message that tells you that the system ran out of memory trying to compile that program, so that’s a limitation of the system. You can try to either:

  • Install the package through apt if available. (Note you have to do sudo apt update before so it works)
  • Build trying to save memory with: colcon build --executor sequential --cmake-args -j1 -l1

Hi, this issue is part of a ROSject (Premium), and I’m unable to continue because of it. I’ve tried multiple approaches but haven’t succeeded. Since some files are hidden, I cannot deploy the same setup on my own machine.

I kindly ask The Construct team to consider addressing this point by keeping these Premium ROSjects updated, or remove them if they cannot be maintained. Thank you.

Hi, what is the reason to run the cmake command previous to colcon build?

What is the reason to try and recompile packages in ros2_sims_ws? Those packages are already recompiled to prevent these issues.

You can use tar to compress it and place in /home/user, like a normal linux machine:

tar -czf /home/user/src.tar.gz -C /home/ros2_sims_ws src/

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.