colcon build --symlink-install crashes raspberry pi
I am trying to install ros on a raspberry pi 4 2GB with Ubuntu 20.04. I am going through the tutorial step by step. I started trying with rolling (for no real good reason) and had colcon crash. So I went to humble with the same result. By crash, I mean the installation is going along just fine and the system just stops: the mouse stops responding, I can't open a new ssh session, nothing. The only thing that I can do is reboot the pi.
The following screen dump shows the progress of the command. The number at the bottom is the timer. The number isn't the same each time I run but it's close. The second dump shows the results of running the "colon build" a second time.
I believe that this is basically the last step before I can start writing code for my actual little robot so any kind of fix or work around would be much appreciated.
wjr
wjr@ros:~/ros2_ws$ colcon build --symlink-install [3.018s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
'examples_rclpy_minimal_action_server' is in: /opt/ros/humble
'examples_rclcpp_minimal_publisher' is in: /opt/ros/humble
'examples_rclcpp_minimal_client' is in: /opt/ros/humble
'examples_rclpy_minimal_subscriber' is in: /opt/ros/humble
'examples_rclpy_minimal_service' is in: /opt/ros/humble
'examples_rclcpp_multithreaded_executor' is in: /opt/ros/humble
'examples_rclcpp_minimal_service' is in: /opt/ros/humble
'examples_rclpy_minimal_publisher' is in: /opt/ros/humble
'examples_rclcpp_minimal_subscriber' is in: /opt/ros/humble
'examples_rclpy_minimal_action_client' is in: /opt/ros/humble
'examples_rclcpp_minimal_action_server' is in: /opt/ros/humble
'examples_rclpy_executors' 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_composition' is in: /opt/ros/humble
'examples_rclcpp_minimal_timer' 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 undefinedbehavior 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]
[53.1s] [0/22 complete] [4 ongoing] [examples_rclcpp_async_client:build 50% - 51.7s] ...
wjr@ros:/usr/bin$ colcon build --symlink-install
Traceback (most recent call last):
File "/usr/bin/colcon", line 11, in <module>
load_entry_point('colcon-core==0.10.0','console_scripts', 'colcon')()
File "/usr/lib/python3/dist-packages/colcon_core/command.py", line 118, in main
return _main(command_name=command_name, argv=argv)
File "/usr/lib/python3/dist-packages/colcon_core/command.py", line 185, in _main
create_log_path(args.verb_name)
File "/usr/lib/python3/dist-packages/colcon_core/location.py", line 186, in create_log_path
os.makedirs(str(path))
File "/usr/lib/python3.10/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/lib/python3.10/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: 'log'
Asked by wjr on 2022-11-15 03:35:07 UTC
Answers
Hello,
I think you need to give root access to your colcon build as your colcon build want to create a log foldor and because of insufficent permision. You are getting this below error.
PermissionError: [Errno 13] Permission denied: 'log'
sudo su
Use sudo su and give password for raspberry pi and then try to build it agin.
Asked by Ranjit Kathiriya on 2022-11-17 10:21:11 UTC
Comments
Good thought but it didn't help.
Asked by wjr on 2022-11-18 01:02:36 UTC
Having gone through the colcon docs, I decided to build each package separately. All but minimal subscriber built successfully, albeit slowly. Minimal subscriber is causing some sort of loop. Every minute or two it's putting out a "[Processing: examples_rclcpp_minimal_subscriber]" line. I let it run over 30 minutes and it's still going. The system is still locked up; it refuses ssh connections.
Asked by wjr on 2022-11-19 00:47:53 UTC
Add that to your solution to answer and tick your answer so it can help others.
Asked by Ranjit Kathiriya on 2022-11-21 05:54:39 UTC
I'm not sure what you are saying. I still have the build problem, it's just somewhat localized. So I don't know what you want me to tick.
I am waiting on a new orange pi to see if 4GB makes a difference since all my other pi's are 2 GB and 4 GB RPi's are impossible to get right now. My project is based upon an old MMP5 so I have to have a small, battery-powered SBC. I started trying to install ROS on my bigger machines but they are all Windows which makes installation so much different that I don't think it's worth the time. Another post, colcon build - number of threads, talks about a crashing RPi but that suggestion didn't help either.
Asked by wjr on 2022-11-22 01:11:53 UTC
Apparently compiling the cpp code just takes too much memory. After I deleted the rclcpp directory (I know, I could have just told it to ignore it) the build worked fine on a 2GB RPi 4. As noted above, I did need to sudo it to make the symlinks but I hadn't been getting to that point. The build software should fail gracefully instead of crashing the system but that is probably on somebody's todo list. There should be a minimum system requirements that specifies 4GB for Raspberry Pi's because the RPi is an excellent choice for small, mobile robots.
Asked by wjr on 2022-11-28 01:52:27 UTC
Comments
have the same issue on a RPI4 4Gb also what is left to build if you remove the rclcpp folder ?
Asked by phil123456 on 2023-07-27 15:54:19 UTC
Comments