在Raspberry Pi 4上的Raspbian(Buster)上安装Ros Noetic



>我正在尝试在树莓派 4 上安装 ROS Noetic,但在执行官方指南中的此命令时遇到了此错误:

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 支持 Ubuntu Focal 和 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

你有什么建议吗?

我也遇到了这个错误并解决了它。它来自构建过程中 python2 和 python3 之间的混淆。使用ROS_PYTHON_VERSION环境变量强制使用特定版本的 python 进行构建。

Debian Buster 是 noetic 支持的操作系统,尽管不是主要的 Ubuntu Buster。OP不需要被告知"Noetic不应该安装在这个操作系统上",他/她需要帮助来解决他/她的问题。在我看来,解决问题比逃避它要好。

我的设置有点棘手:

  • 硬件:树莓派4
  • 操作系统:覆盆子破坏者
  • 在来宾操作系统也是 raspbian buster 的 docker 映像中安装 ROS noetic(当前为 1.15.7(,因此它应该与直接在主机操作系统上安装它相同。
  • 使用 python3 安装 ROS

说明如下。我希望它会有所帮助。

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

我认为你的问题是对 ROS 的更元误解。ROS(到目前为止(与Ubuntu版本密切相关。如果你安装了 Ubuntu 20,我强烈建议你通过 apt 安装 ROS Noetic。如果你想在Pi上使用ROS,你应该坚持使用Ubuntu LTS版本(16/18/20(以获得最大的支持。

最新更新