ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

colcon build freeze a Raspberry Pi

asked 2022-10-07 10:04:02 -0500

solo gravatar image

updated 2022-10-11 01:54:13 -0500

ravijoshi gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-10-11 02:00:53 -0500

ravijoshi gravatar image

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
edit flag offensive delete link more

Comments

@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.

solo gravatar image solo  ( 2022-10-13 21:29:25 -0500 )edit

Thanks. I am glad you made it work!

ravijoshi gravatar image ravijoshi  ( 2022-10-14 02:32:05 -0500 )edit

Question Tools

Stats

Asked: 2022-10-07 10:04:02 -0500

Seen: 1,949 times

Last updated: Oct 11 '22