0
$\begingroup$

Rosanswers logo

Thanks all for reading and helping.

I'm attempting to install and use Humble on a fresh 22.04 install on a Raspberry Pi reTerminal (CM4) with 4G RAM. Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1015-raspi aarch64). I've followed the instructions here (https://docs.ros.org/en/humble/index.html) using the apt install binaries.

jon@adventure:~$ env | grep ROS
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_LOCALHOST_ONLY=0
ROS_DISTRO=humble

jon@adventure:~$ gcc --version
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0

Everything appears to be installed without error, however when I go to build the demo in the 'Build Workspace' tutorial the system freezes running the command colcon build --symlink-install. I let it run for about 30 minutes before cancelling the process. It appeared to run smoothly other than the surprise warnings up to about 50% where it sat for majority of the time. I executed the commands from an SSH shell, and noted my direct linked monitor was frozen during the pause as well.

This is the output from running the commands from here:

jon@adventure:~/ros2_ws$ git clone https://github.com/ros2/examples src/examples -b humble
Cloning into 'src/examples'...
remote: Enumerating objects: 6690, done.
remote: Counting objects: 100% (1569/1569), done.
remote: Compressing objects: 100% (453/453), done.
remote: Total 6690 (delta 1170), reused 1430 (delta 1080), pack-reused 5121
Receiving objects: 100% (6690/6690), 1.06 MiB | 1.31 MiB/s, done.
Resolving deltas: 100% (4689/4689), done.

jon@adventure:~/ros2_ws$ colcon build --symlink-install
[2.626s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
    'examples_rclcpp_minimal_service' is in: /opt/ros/humble
    'examples_rclpy_minimal_action_server' is in: /opt/ros/humble
    'examples_rclcpp_multithreaded_executor' is in: /opt/ros/humble
    'examples_rclcpp_minimal_composition' is in: /opt/ros/humble
    'examples_rclpy_minimal_subscriber' is in: /opt/ros/humble
    'examples_rclcpp_minimal_publisher' is in: /opt/ros/humble
    'examples_rclcpp_minimal_client' is in: /opt/ros/humble
    'examples_rclcpp_minimal_action_server' is in: /opt/ros/humble
    'examples_rclcpp_minimal_timer' is in: /opt/ros/humble
    'examples_rclpy_minimal_service' is in: /opt/ros/humble
    'examples_rclpy_minimal_publisher' is in: /opt/ros/humble
    'examples_rclpy_executors' is in: /opt/ros/humble
    'examples_rclpy_minimal_action_client' is in: /opt/ros/humble
    'examples_rclpy_minimal_client' is in: /opt/ros/humble
    'examples_rclcpp_minimal_action_client' is in: /opt/ros/humble
    'examples_rclcpp_minimal_subscriber' is in: /opt/ros/humble
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
    --allow-overriding examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server examples_rclcpp_minimal_client examples_rclcpp_minimal_composition examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber examples_rclcpp_minimal_timer examples_rclcpp_multithreaded_executor examples_rclpy_executors examples_rclpy_minimal_action_client examples_rclpy_minimal_action_server examples_rclpy_minimal_client examples_rclpy_minimal_publisher examples_rclpy_minimal_service examples_rclpy_minimal_subscriber

This may be promoted to an error in a future release of colcon-override-check.
Starting >>> examples_rclcpp_async_client
Starting >>> examples_rclcpp_cbg_executor
Starting >>> examples_rclcpp_minimal_action_client
Starting >>> examples_rclcpp_minimal_action_server
[Processing: examples_rclcpp_async_client, examples_rclcpp_cbg_executor, examples_rclcpp_minimal_action_client, examples_rclcpp_minimal_action_server]
[Processing: examples_rclcpp_async_client, examples_rclcpp_cbg_executor, examples_rclcpp_minimal_action_client, examples_rclcpp_minimal_action_server]
[Processing: examples_rclcpp_async_client, examples_rclcpp_cbg_executor, examples_rclcpp_minimal_action_client, examples_rclcpp_minimal_action_server]
                                                                                                                                                           ..
Summary: 0 packages finished [27min 53s]
  4 packages had stderr output: examples_rclcpp_async_client examples_rclcpp_cbg_executor examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server
  22 packages not processed

Note: I'm attempting to do this from a completely clean install, because I encountered this the first time I tried to install Humble. At that time, I thought it may have been an issue with tutorial package so I moved to other tutorials in the series. I got stuck with those because of an ImportError: cannot import name 'generate_py' from 'rosidl_generator_py'. In that case when I went to the folder there was no rosidl_generator.py. I thought I'd messed something up by having a non-standard install (pyenv, Seeed Studio, etc.), so I wiped the computer and started fresh. Unfortunately, stuck here again.


Originally posted by solo on ROS Answers with karma: 3 on 2022-10-07

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

By default, the colcon processes/compiles packages parallel to speed up the compilation time. However, we need to remember that Raspberry Pi has limited resources and can not handle so much parallelism. This is why it freezes after sometime.

You should make use of --parallel-workers and/or --executor sequential to limit the parallel compilation. For more info. please see #q368249

On a side note, the examples are pre-installed . This is why the colcon reports Some selected packages are already built in one or more underlay workspaces. If you want to override, please make use of --allow-overriding as reported by colon. See below, please:

colcon build --symlink-install --allow-overriding examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server examples_rclcpp_minimal_client examples_rclcpp_minimal_composition examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber examples_rclcpp_minimal_timer examples_rclcpp_multithreaded_executor examples_rclpy_executors examples_rclpy_minimal_action_client examples_rclpy_minimal_action_server examples_rclpy_minimal_client examples_rclpy_minimal_publisher examples_rclpy_minimal_service examples_rclpy_minimal_subscriber

Originally posted by ravijoshi with karma: 1744 on 2022-10-11

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by solo on 2022-10-13:
@ravijoshi you rock!

Thank you for taking the time to respond. I was very stuck. I used --executor sequential and it worked. Note for others, the example code has deprecated calls and other warnings but it compiles fine.

SOLUTION SUMMARY : run colcon build --symlink-install --executor sequential, optionally add the --allow-overridding provided above.

Comment by ravijoshi on 2022-10-14:
Thanks. I am glad you made it work!

$\endgroup$
1
$\begingroup$

If colcon build --symlink-install --executor sequential also didn't solve your problem either, you can try the commands below:

export MAKEFLAGS="-j 1"

colcon build --executor sequential

The -j option allows you to specify the number of jobs which run in parallel. Each job can be run on a separate CPU core, which can significantly speed up the build process on multi-core systems.

Note: You can change the variable, it doesn't need to be 1.

Be aware that you will increase the chance of freezing every time you increase the variable but in the other hands, building time will be increase every time you decrease the variable. You can see the effect of building the project on your system with htop command in another terminal.

$\endgroup$

Your Answer

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