Skip to content

Instantly share code, notes, and snippets.

@HemaZ
Last active June 19, 2024 01:51
Show Gist options
  • Save HemaZ/fb1a144a20ace1fbf9429aaedaf919f0 to your computer and use it in GitHub Desktop.
Save HemaZ/fb1a144a20ace1fbf9429aaedaf919f0 to your computer and use it in GitHub Desktop.

FreePalestine.Dev

Installing ROS Noetic on Raspberry Pi 4

Hello Everyone. I've been trying to install ROS Noetic on Raspbian GNU/Linux 10 (buster) from source but it was like a nightmare. Finally, I was able to install it and I want to share it with you.

Steps:

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
$ sudo apt-get update
$ sudo apt-get upgrade

Install Bootstrap Dependencies

$ sudo apt install -y python3-rosdep python3-rosinstall-generator python3-wstool python3-rosinstall build-essential cmake

These Dependencies are also required

sudo apt install python3-catkin python3-catkin-lint python3-catkin-pkg python3-catkin-pkg-modules python3-catkin-tools

Initializing rosdep

$ sudo rosdep init
$ rosdep update

Create a catkin Workspace

$ mkdir -p ~/ros_catkin_ws
$ cd ~/ros_catkin_ws

Fetch ROS pacakges

$ rosinstall_generator ros_comm --rosdistro noetic --deps --wet-only --tar > noetic-ros_comm-wet.rosinstall
$ wstool init src noetic-ros_comm-wet.rosinstall

replace ros_comm with desktop if you wish to install GUI tools like Rviz, Rqt, and robot-generic libraries.

Resolve Dependencies

$ cd ~/ros_catkin_ws
$ rosdep install -y --from-paths src --ignore-src --rosdistro noetic -r --os=debian:buster

Install messages generation libraries manually

We need to manually install these Python3 packages from src folder

  1. gencpp
  2. geneus
  3. genlisp
  4. genmsg
  5. gennodejs
  6. genpy

The following command loops through each directory and install the python package

$ cd src && for d in genmsg genpy gencpp geneus gennodejs genlisp ; do (cd "$d" && sudo pip3 install -e .); done && cd ..

Building the catkin Workspace

sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/noetic -j4

Now ROS should be installed! Remember to source the new installation:

$ echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
@BloodyHellcat
Copy link

$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
doesn't work for me

Output:
Executing: /tmp/apt-key-gpghome.h3tCqTbFga/gpg.1.sh --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
gpg: keyserver receive failed: No name

@tocococa
Copy link

@BloodyHellcat this should work sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

@blackpearl006
Copy link

I'm on raspbian OS bullseye, will the same work for the updated version

@HemaZ
Copy link
Author

HemaZ commented Jan 9, 2023

I'm on raspbian OS bullseye, will the same work for the updated version

No idea really, I have not tried it.

@fwanderlingh
Copy link

Thanks a lot for this guide, saved my day! Just a couple of things more I had to do to make it work:

  • Install wstool from pip since the apt installed one was giving "command not found": sudo pip install --force-reinstall -U wstool
  • Install some more python packages to be able to compile the ros workspace: sudo apt-get install python-empy python-nose python-catkin-pkg

@kaifanzheng
Copy link

it works prefect for me, thank you. one side note, if rosdep update doesn't run properly, try to install python 2.7, it fixed my issue

@vrbadev
Copy link

vrbadev commented May 23, 2023

Thanks! I successfully built and installed the ROS Noetic on Raspberry Pi 3A+ with Legacy OS Lite (buster based raspbian).
Another missing dependency that should be installed is: sudo apt-get install python3-pip. I also had to explicitly add -DPYTHON_EXECUTABLE=/usr/bin/python3 when building ROS otherwise the python 2.7 is selected by default.
On 3A+ with only 512MB RAM, it is also necessary to increase swap size from default 100MB to e.g. 1024MB (see this tutorial).

@Edikscrmp
Copy link

Wow! Thanks! Its finaly working! I successfully installed on RPI Zero 2 with Raspbian buster

@LucasIvankio
Copy link

I could successfully install ros noetic desktop from this tutorial.
Nevertheless, now I can't install any other packages, like move-base, navigation, etc...
Any hint?

@Williamvdb
Copy link

Thanks a lot for this guide, saved my day! Just a couple of things more I had to do to make it work:

  • Install wstool from pip since the apt installed one was giving "command not found": sudo pip install --force-reinstall -U wstool
  • Install some more python packages to be able to compile the ros workspace: sudo apt-get install python-empy python-nose python-catkin-pkg

Pip was having issues for me when installing wstool. I fixed the same issue by sudo apt-get install python-wstool

@thanhtruongphan
Copy link

it save my day.
many thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment