2025年12月10日 星期三

pi3 ubuntu 22.04 server install ros2 humble (basic planformat ) no gui

 Installing ROS 2 Humble on a Raspberry Pi 3 running Ubuntu 22.04 involves several steps, primarily through the use of apt package manager for binary installation.

1. Prepare your System:
  • Install Ubuntu 22.04 (64-bit) on your Raspberry Pi 3. Ensure it's the 64-bit version for optimal ROS 2 support (Tier 1).
  • Set your locale: Verify that your locale supports UTF-8. If not, set it using commands like:
程式碼
    sudo apt update && sudo apt install locales    sudo locale-gen en_US en_US.UTF-8    sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8    export LANG=en_US.UTF-8
Update and upgrade packages.
程式碼
    sudo apt update && sudo apt upgrade
Install essential tools.
程式碼
    sudo apt install software-properties-common curl
2. Add ROS 2 Repository:
Enable Ubuntu Universe repository.
程式碼
    sudo add-apt-repository universe
Add the ROS 2 GPG key.
程式碼
    sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
  • Add the ROS 2 repository to your sources list:
程式碼
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
3. Install ROS 2 Humble:
Update your package list again.
程式碼
    sudo apt update
  • Install ROS 2 Humble Desktop (recommended for GUI) or ROS-Base (bare bones):
程式碼
    # For Desktop install:    sudo apt install -y ros-humble-desktop    # For ROS-Base install:    sudo apt install -y ros-humble-ros-base
4. Environment Setup:
  • Source the ROS 2 setup script: To make ROS 2 commands available in your terminal, add this to your ~/.bashrc file:
程式碼
    echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc    source ~/.bashrc
5. (Optional) Install additional packages:
Install colcon build tools and rosdep.
程式碼
    sudo apt install -y python3-colcon-common-extensions python3-rosdep    sudo rosdep init    rosdep update
Install CycloneDDS (alternative RMW).
程式碼
    sudo apt install -y ros-humble-rmw-cyclonedds-cpp
  • Set default RMW (e.g., to CycloneDDS):
程式碼
    echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> ~/.bashrc    source ~/.bashrc
After these steps, you should have ROS 2 Humble installed and configured on your Raspberry Pi 3 running Ubuntu 22.04. You can then test it by running some basic ROS 2 commands, such as ros2 topic list.

沒有留言:

張貼留言