4

I am trying to install ROS Noetic on a Raspberry Pi 4 and I came across this error while executing this command from the official guide:

userk@dopamine:~/development/ros_catkin_ws $ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
[...]
File "~/development/ros_catkin_ws/build_isolated/rosbash/catkin_generated/generate_cached_setup.py", line 12, in <module>
    from catkin.environment_cache import generate_environment_script
ModuleNotFoundError: No module named 'catkin'

Ros Noetic supports Ubuntu Focal and Debian Buster.

userk@dopamine:~/development/ros_catkin_ws $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:    10
Codename:   buster

Do you have any advice?

UserK
  • 884
  • 3
  • 17
  • 40
  • 1
    Do you have to use an OS that doesn't natively support apt install'ing ROS? I know it doesn't technically answer your question, but ROS is usually finicky & critical enough that we conform the OS to ROS, not ROS to the OS. – JWCS May 26 '20 at 21:33
  • Also, I see 2 different `ros_catkin_ws` folders: `~/ros_catkin_ws` and `~/development/ros_catkin_ws`. Are you sure you didn't mix them up? – JWCS May 26 '20 at 21:35
  • 1
    Also, check if you have successfully gotten all the files into your src/ directory after the vcs import; catkin should be there. If it's not, then the following rosdep install cmd would also fail. – JWCS May 26 '20 at 21:37
  • I am trying different combinations of operative systems and ros versions for the rpi4. Fixed the ~/development/ros_catkin_ws typos. Manually modified the path while writing the question – UserK May 26 '20 at 21:40
  • The catkin folder is present in src/. Which Operative system do you recommend for Ros Noetic? Ubuntu 20.04? – UserK May 26 '20 at 21:46
  • Yeah. It was just released a few days ago as well! Still strongly recommend against compiling it yourself if you don't know what you're doing, when installing via apt on a supported ubuntu is far easier. – JWCS May 26 '20 at 22:14

2 Answers2

6

I had this error too and solved it. It came for me from a mixup between python2 and python3 during build. Use ROS_PYTHON_VERSION environment variable to force build with a specific version of python.

Debian Buster IS a supported OS for noetic, though not the main one which is Ubuntu Buster. OP does not need to be told "Noetic should not be installed on this OS", he/she needs help to solve his/her issue. Solving a problem is better than just eluding it, in my opinion.

My setup is a bit more tricky:

  • hardware: Raspberry Pi 4
  • OS: raspbian buster
  • Installing ROS noetic (currently 1.15.7) in a docker image which guest OS is raspbian buster too, so it should be the same as installing it directly on host OS.
  • Using python3 to install ROS

Instructions below. I hope it will help.

mkdir ~/catkin_ws && cd ~/catkin_ws
export ROS_DISTRO="noetic"
# I very strongly advise to set Python version used by ROS
# otherwise the packages will mix up python2 and python3 during build
# finally leading to the error you encountered (just like me before)
export ROS_PYTHON_VERSION="3"
# disable languages that I don't need
export ROS_LANG_DISABLE="geneus:genlisp:gennodejs"
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu buster main" > /etc/apt/sources.list.d/ros-latest.list'
apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
apt-get update
apt-get install python3-rosdep python3-rosinstall-generator python3-vcstool build-essential
apt-get install -y ca-certificates && rosdep init && rosdep update
# Remove/add packages to get an installation covering your needs.
rosinstall_generator --rosdistro noetic --deps --tar \
        ros_comm             \
        actionlib            \
        sensor_msgs          \
        image_common         \
        vision_opencv        \
        > noetic-computervision.rosinstall
mkdir ./src && vcs import --input noetic-computervision.rosinstall ./src
rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro noetic -y
python3 ./src/catkin/bin/catkin_make_isolated --install --install-space /opt/ros/noetic -DCMAKE_BUILD_TYPE=Release
Inti
  • 61
  • 1
  • Thanks for the answer! I ll setup Raspbian Buster and try to install Noetic. – UserK Jun 19 '20 at 20:45
  • Nice work, +1. Especially as Noetic is the first/only ros to support/use python3, the mixups _ought_ to be less common... FTR, I find most ros install questions tend to be users creating needless problems for themselves, accidentally. It's a difficult enough learning curve, without the pain of not being able to install it. – JWCS Jun 21 '20 at 03:35
-2

I think your question is a more meta-misunderstanding of ROS. ROS (sofar) is strongly linked to the Ubuntu version. If you have Ubuntu 20 installed, I strongly recommend installing ROS Noetic via apt. If you want to use ROS on the Pi, you should stick to a Ubuntu LTS version (16/18/20) for maximal support.

JWCS
  • 1,120
  • 1
  • 7
  • 17
  • I continue to think this is a reasonable answer, because I frequently witness installation issues for novices to ROS become days of effort or hacky work arounds, that could've been most quickly & simply resolved with re-installing a different OS. In my answers for the vast majority of people asking this question, switching the OS is the quickest & least repercussive solution for inexperienced learners / beginners. If you're wasting more than an hour on a non-apt based installation please cut your losses and change your OS. _Otherwise_, I like the answer above, but know what you're doing. – JWCS Sep 20 '21 at 18:03