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

Revision history [back]

click to hide/show revision 1
initial version

Success!! I eventually managed to get ROS2 to build on a Pi3B. It took me 8 hours of trial and error yesterday and may not be the most efficient way but it worked for me. I based it on the approach here https://medium.com/swlh/raspberry-pi-ros-2-camera-eef8f8b94304 up to the camera install. The previous link depends heavily on https://docs.ros.org/en/foxy/Installation/Linux-Development-Setup.html The main issue is kswapd0 keeps kicking in to manage the swap. Following are the extra steps / changes I made.

  1. Edit /etc/sysctl.conf as root to add " vm.swappiness = 0". This stops swapping except when completely out of memory. Reboot to activate the changes
  2. I got a warning about missing paths when installing the build pre-requisites so I added these to my PATH
  3. I amended ~/.colcon/defaults.yaml to remove the last line selecting the compiler and added " - -DBUILD_TESTING=OFF" to reduce the load.
  4. I still had kswapd0 cutting in regularly so I limited the C compiler to one instance per thread and only used 2 threads. This made my command line :-

MAKEFLAGS="-j1 -l1" colcon build --symlink-install --packages-skip-build-finished --continue-on-error --parallel-workers 2

This had the additional benefit that I could run "top -i" in another terminal to see what was going on. 5 Even so I still got kswapd0 grabbing a large chunk of processor every so often so I would abort the build (using Ctrl C or in extremis Ctrl Z), reboot the pi and set the build to continue. Eventually I got it all compiled with only one error - concerning ROS1 bridge which I don't need.

Query : I am not sure if I am allowed to close this or whether I need a moderator to do that. I will take action if this is still open at the end of the month.

Comment : I am now moving on the the camera where Raspbian seems to set up /dev/video10 onwards but ROS2 wants to use /dev/video0

Success!! I eventually managed to get ROS2 to build on a Pi3B. It took me 8 hours of trial and error yesterday and may not be the most efficient way but it worked for me. I based it on the approach here https://medium.com/swlh/raspberry-pi-ros-2-camera-eef8f8b94304 up to the camera install. The previous link depends heavily on https://docs.ros.org/en/foxy/Installation/Linux-Development-Setup.html The main issue is kswapd0 keeps kicking in to manage the swap. Following are the extra steps / changes I made.

  1. Edit /etc/sysctl.conf as root to add " vm.swappiness = 0". This stops swapping except when completely out of memory. Reboot to activate the changes
  2. I got a warning about missing paths when installing the build pre-requisites so I added these to my PATH
  3. I amended ~/.colcon/defaults.yaml to remove the last line selecting the compiler and added " - -DBUILD_TESTING=OFF" to reduce the load.
  4. I still had kswapd0 cutting in regularly so I limited the C compiler to one instance per thread and only used 2 threads. This made my command line :-

MAKEFLAGS="-j1 -l1" colcon build --symlink-install --packages-skip-build-finished --continue-on-error --parallel-workers 2

This had the additional benefit that I could run "top -i" in another terminal to see what was going on. on.

5 Even so I still got kswapd0 grabbing a large chunk of processor every so often so I would abort the build (using Ctrl C or in extremis Ctrl Z), reboot the pi and set the build to continue. Eventually I got it all compiled with only one error - concerning ROS1 bridge which I don't need.

Query : I am not sure if I am allowed to close this or whether I need a moderator to do that. I will take action if this is still open at the end of the month.

Comment : I am now moving on the the camera where Raspbian seems to set up /dev/video10 onwards but ROS2 wants to use /dev/video0

Success!! I eventually managed to get ROS2 to build on a Pi3B. It took me 8 hours of trial and error yesterday and may not be the most efficient way but it worked for me. I based it on the approach here https://medium.com/swlh/raspberry-pi-ros-2-camera-eef8f8b94304 up to the camera install. The previous link depends heavily on https://docs.ros.org/en/foxy/Installation/Linux-Development-Setup.html The main issue is kswapd0 keeps kicking in to manage the swap. Following are the extra steps / changes I made.

  1. Edit /etc/sysctl.conf as root to add " vm.swappiness = 0". This stops swapping except when completely out of memory. Reboot to activate the changes
  2. I got a warning about missing paths when installing the build pre-requisites so I added these to my PATHPATH. In my case this was achieved by "export PATH=$PATH:/home/brian/.local/bin"
  3. I amended ~/.colcon/defaults.yaml to remove the last line selecting the compiler and added " - -DBUILD_TESTING=OFF" to reduce the load.
  4. I still had kswapd0 cutting in regularly so I limited the C compiler to one instance per thread and only used 2 threads. This made my command line :-

MAKEFLAGS="-j1 -l1" colcon build --symlink-install --packages-skip-build-finished --continue-on-error --parallel-workers 2

This had the additional benefit that I could run "top -i" in another terminal to see what was going on.

5 Even so I still got kswapd0 grabbing a large chunk of processor every so often so I would abort the build (using Ctrl C or in extremis Ctrl Z), reboot the pi and set the build to continue. Eventually I got it all compiled with only one error - concerning ROS1 bridge which I don't need.

Query : I am not sure if I am allowed to close this or whether I need a moderator to do that. I will take action if this is still open at the end of the month.

Comment : I am now moving on the the camera where Raspbian seems to set up /dev/video10 onwards but ROS2 wants to use /dev/video0

Success!! I eventually managed to get ROS2 to build on a Pi3B. It took me 8 hours of trial and error yesterday and may not be the most efficient way but it worked for me. I based it on the approach here https://medium.com/swlh/raspberry-pi-ros-2-camera-eef8f8b94304 up to the camera install. The previous link depends heavily on https://docs.ros.org/en/foxy/Installation/Linux-Development-Setup.html The main issue is kswapd0 keeps kicking in to manage the swap. Following are the extra steps / changes I made.

  1. Edit /etc/sysctl.conf as root to add " vm.swappiness = 0". This stops swapping except when completely out of memory. Reboot to activate the changes
  2. I got a warning about missing paths when installing the build pre-requisites so I added these to my PATH. In my case this was achieved by "export PATH=$PATH:/home/brian/.local/bin"
  3. I amended ~/.colcon/defaults.yaml to remove the last line selecting the compiler and added " - -DBUILD_TESTING=OFF" to reduce the load.
  4. I still had kswapd0 cutting in regularly so I limited the C compiler to one instance per thread and only used 2 threads. This made my command line :-

MAKEFLAGS="-j1 -l1" colcon build --symlink-install --packages-skip-build-finished --continue-on-error --parallel-workers 2

This had the additional benefit that I could run "top -i" in another terminal to see what was going on.

5 Even so I still got kswapd0 grabbing a large chunk of processor every so often so I would abort the build (using Ctrl C or in extremis Ctrl Z), reboot the pi and set the build to continue. Eventually I got it all compiled with only one error - concerning ROS1 bridge which I don't need.

Query : I am not sure if I am allowed to close this or whether I need a moderator to do that. I will take action if this is still open at the end of the month.

Comment : I am now moving on the the camera where Raspbian seems to set up /dev/video10 onwards but ROS2 wants to use /dev/video0

/dev/video0 - Issue now fixed, just needed the camera activating. UPDATE - added missing PATH information. INFO UPDATE: An alternative might be the cross platform compiler https://github.com/ros-tooling/cross_compile

Success!! I eventually managed to get ROS2 to build on a Pi3B. It took me 8 hours of trial and error yesterday and may not be the most efficient way but it worked for me. I based it on the approach here https://medium.com/swlh/raspberry-pi-ros-2-camera-eef8f8b94304 up to the camera install. The previous link depends heavily on https://docs.ros.org/en/foxy/Installation/Linux-Development-Setup.html The main issue is kswapd0 keeps kicking in to manage the swap. Following are the extra steps / changes I made.

  1. Edit /etc/sysctl.conf as root to add " vm.swappiness = 0". This stops swapping except when completely out of memory. Reboot to activate the changes
  2. I got a warning about missing paths when installing the build pre-requisites so I added these to my PATH. In my case this was achieved by "export PATH=$PATH:/home/brian/.local/bin"
  3. I amended ~/.colcon/defaults.yaml to remove the last line selecting the compiler and added " - -DBUILD_TESTING=OFF" to reduce the load.
  4. I still had kswapd0 cutting in regularly so I limited the C compiler to one instance per thread and only used 2 threads. This made my command line :-

MAKEFLAGS="-j1 -l1" colcon build --symlink-install --packages-skip-build-finished --continue-on-error --parallel-workers 2

This had the additional benefit that I could run "top -i" in another terminal to see what was going on.

5 Even so I still got kswapd0 grabbing a large chunk of processor every so often so I would abort the build (using Ctrl C or in extremis Ctrl Z), reboot the pi and set the build to continue. Eventually I got it all compiled with only one error - concerning ROS1 bridge which I don't need.

Query : I am not sure if I am allowed to close this or whether I need a moderator to do that. I will take action if this is still open at the end of the month.

Comment : I am now moving on the the camera where Raspbian seems to set up /dev/video10 onwards but ROS2 wants to use /dev/video0 - Issue now fixed, just needed the camera activating. activating and the cable connecting the right way round (doh!)

UPDATE - added missing PATH information. information.

INFO UPDATE: An I had not come across the alternative might be the cross platform compiler https://github.com/ros-tooling/cross_compile

mentioned below