🚇
EduRobotAILab
  • ☑️Welcome to EduRobotAILab
  • SlamPiBot Overview
    • ☑️Overview
    • ☑️Specifications
    • ☑️Components
  • slampibot sw setup
    • ☑️Raspberry Pi 4B for foxy
    • ☑️Raspberry Pi 4B for humble
    • ☑️Raspberry Pi Pico
    • ☑️Remote PC for foxy
    • ☑️Remote PC for humble
    • ☑️~/.bashrc for foxy
    • ☑️~/.bashrc for humble
  • Slampibot hw setup
    • ☑️SlamPiBot Body
    • ☑️Joystick
  • Use Cases
    • ☑️Simulation
    • ☑️SLAM
Powered by GitBook
On this page
  • Step 1 - Micro SD Card Specification
  • Step 2 - Micro SD Card Setup Overview
  • Step 3 - Flash Ubuntu Server 22.04 LTS
  • Step 4 - Network Configuration
  • Step 5 - Connecting to RPi4B using SSH
  • Step 6 - Installing desktop environment
  • Step 7 - Remote Desktop Connection
  • Step 8 - Install ROS2 humble
  • Step 9 - Install SlamPiBot-humble
  1. slampibot sw setup

Raspberry Pi 4B for humble

Raspberry Pi 4B (4GB 또는 8GB)는 Raspberry Pi 전문 매장에서 별도 구매 바랍니다. Micro SD 카드는 32GB 구매를 추천 드립니다.

PreviousRaspberry Pi 4B for foxyNextRaspberry Pi Pico

Last updated 11 months ago

Step 1 - Micro SD Card Specification

Items
Specifications

Type

microSDHC

Capacity

32GB (16 ~ 64GB)

Interface

UHS-I

Speed Class

Class 10

Step 2 - Micro SD Card Setup Overview

원격 접속이 가능한 Headless setup을 추천 드립니다. 아래 Github 사이트를 참고 하시어 아래 단계에 따라 설치 바랍니다. 또는 네이버 카페 게시판 참고 바랍니다.

Step 3 - Flash Ubuntu Server 22.04 LTS

SD 카드에 Ubuntu Server 22.04 LTS를 Flash 하기 위해서는 balenaEtcher 또는 Raspberry Pi Imager를 주로 사용합니다. 여기에서는 Raspberry Pi Imager를 사용하여 Flash 하는 방법을 알려 드립니다. Raspberry Pi Imager는 아래 사이트에서 다운로드 할 수 있습니다.

Raspberry Pi Imager를 실행 합니다.

운영체재 선택을 클릭하여 Other general-purpose OS를 선택 합니다.

Ubuntu를 선택합니다.

Ubuntu Server 22.04.x LTS (64-bit)를 선택합니다.

운영체재가 선택되었으면 저장소에서 컴퓨터에 삽입한 SD 카드를 선택합니다.

최종적으로 쓰기를 선택하면 Flashing 진행 됩니다. 시간이 좀 걸립니다.

Flashing이 완료되면 SD 카드를 컴퓨터에서 제거 합니다.

Flashing 속도가 너무 느리면 별도로 Ubuntu Server 22.04.x LTS (64-bit) 파일을 다운로드 받습니다. Raspberry Pi Imager 운영체제에서 사용자 정의 사용으로 다운로드한 이미지 파일을 선택하면 빠른 속도로 Flashing을진행 할 수 있습니다.

Step 4 - Network Configuration

SD 카드를 컴퓨터에 재 연결합니다.

SD 카드 32GB 용량 전체 활용을 위하여 우분투 유틸리티 GParted 사용하여 할당 용량을 확인합니다.

SD 카드 system-boot 아래 network-config 파일을 열고 아래와 같이 입력하여 저장합니다. 사용하고 있는 Wifi SSID와 Password를 입력합니다. #(comment) 은 지우고 입력해야 합니다.

# Some additional examples are commented out below

version: 2
ethernets:
  eth0:
    dhcp4: true
    optional: true
wifis:
  wlan0:
    dhcp4: true
    optional: true
    access-points:
      Your-Wifi-SSID:
        password: "Your-Wifi-PSSWD"
#      myworkwifi:
#        password: "correct battery horse staple"
#      workssid:
#        auth:
#          key-management: eap
#          method: peap
#          identity: "me@example.com"
#          password: "passw0rd"
#          ca-certificate: /etc/my_ca.pem

SD 카드 system-boot 아래 config.txt 파일을 열고 아래와 같이 입력하여 저장합니다. Raspberry Camera 설치를 위하여 start_x=1, gpu_mem=128 입력하고 저장합니다.

# Autoload overlays for any recognized cameras or displays that are attached
# to the CSI/DSI ports. Please note this is for libcamera support, *not* for
# the legacy camera stack

# setup RPI PiCamera
# camera_auto_detect=1
start_x=1
gpu_mem=128
display_auto_detect=1

# Config settings specific to arm64
arm_64bit=1
dtoverlay=dwc2

[cm4]
# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into
# such a board)
dtoverlay=dwc2,dr_mode=host

Step 5 - Connecting to RPi4B using SSH

SD 카드를 RPi에 삽입하고 부팅을 합니다.

일정 시간(5분이상 필요) 지나면 RPi는 Wifi에 자동으로 접속 됩니다.

IP Address를 검색하여 ubuntu RPi IP Address를 확인합니다. IP 확인에 시간이 오래 걸리면 RPI 재부팅을 하고 재 검색해 봅니다.

Ubuntu 터미널에서 ssh ubuntu@192.168. xx.xxx (Wifi에접속된 RPi IP Address) 입력하여 RPi에 접속합니다.

ssh ubuntu@192.168.xx.xxx

Ubuntu server 22.04를 설치하면 default user ID는 ubuntu 입니다. default password는 ubuntu 입니다. 처음 접속하면 password를 변경하라고 합니다. 원하는 password로 변경합니다.

설정한 패스워드를 사용하여 ssh ubuntu@192.168.xx.xxx 다시 접속합니다.

제대로 설치가 완료 되었는지 아래 명령어를 입력하여 확인 합니다.

lsb_release -a

Step 6 - Installing desktop environment

desktop 환경을 아래와 같이 설치합니다.

sudo apt update && sudo apt -y upgrade
sudo apt install ubuntu-desktop-minimal

VNC 서버를 아래와 같이 설치합니다.

sudo apt install -y xrdp
sudo apt install -y tightvncserver

Step 7 - Remote Desktop Connection

RPi를 재부팅 합니다.

RPi IP Address를 이용하여 원격 접속 합니다. 우분투에서는 Remmina Remote Desktop Client를 이용합니다. Windows에서는 원격 데스크톱을 이용합니다.

기본 터미널을 열어서 아래와 같이 Terminator를 설치합니다. 자주 사용하기 위해서는 즐겨찾기로 설정합니다.

sudo apt install terminator

date를 입력하여 현재 날짜와 시간을 확인 합니다.

시간을 현지 시간으로 아래와 같이 설정합니다.

sudo apt install htpdate
timedatectl set-timezone Asia/Seoul

Step 8 - Install ROS2 humble

아래 사이트를 참조하여 ROS2 foxy를 설치 합니다.

아래와 같이 필요한 소프트웨어 추가 설치 합니다.

sudo apt install ~nros-humble-rqt*
sudo apt install ros-humble-tf-transformations ros-humble-tf2-tools
sudo apt install python3-pip
python3 -m pip install -U pyserial
pip3 install numpy==1.26.4
pip3 install opencv-python
sudo apt install ros-humble-joint-state-publisher-gui
sudo apt install ros-humble-cartographer-ros
sudo apt install ros-humble-xacro
sudo apt install ros-humble-nav2-bringup

Step 9 - Install SlamPiBot-humble

spb_ws/src 디렉토리를 생성합니다. colcon build all 실행을 해봅니다.

mkdir -p ~/spb_ws/src
cd ~/spb_ws
colcon build --symlink-install

~/spb_ws/src 아래에 SlamPiBot-humble, Ydlidar-SDK, Ydlidar-ros2 소스 코드를 다운로드 합니다.

cd ~/spb_ws/src
git clone https://github.com/edurobotailab/slampibot-humble-v7.git
git clone https://github.com/YDLIDAR/YDLidar-SDK.git
git clone https://github.com/edurobotailab/ydlidar_ros2.git

YdLidar 드라이버 설치를 위하여 YdLidar-SDK를 먼저 설치 합니다.

cd ~/spb_ws/src/YDLidar-SDK
mkdir build
cd build
cmake ..
make
sudo make install

YdLidar ros2 드라이버를 설치 합니다.

cd ~/spb_ws
colcon build --symlink-install --packages-select ydlidar
chmod 777 src/ydlidar_ros2/startup/*
sudo sh src/ydlidar_ros2/startup/initenv.sh

SPB-V7 빌드 하기 전에 dependencies를 먼저 설치 합니다.

cd ~/spb_ws
sudo rosdep init
rosdep update
rosdep install -i --from-path src --rosdistro humble -y

SPB-V7을 설치 합니다.

전체 설치를 합니다.

cd ~/spb_ws
colcon build --symlink-install

패키지 별로 설치하고자 할 때 아래와 같이 설치합니다.

cd ~/spb_ws
colcon build --symlink-install --packages-select slampibot_bringup
colcon build --symlink-install --packages-select slampibot_camera
colcon build --symlink-install --packages-select slampibot_cartographer
colcon build --symlink-install --packages-select slampibot_description
colcon build --symlink-install --packages-select slampibot_gazebo
colcon build --symlink-install --packages-select slampibot_navigation2
colcon build --symlink-install --packages-select slampibot_slamtoolbox
colcon build --symlink-install --packages-select slampibot_teleop
colcon build --symlink-install --packages-select slampibot
☑️
Buy a Raspberry Pi 4 Model B – Raspberry PiRaspberry Pi
GitHub - Combinacijus/RPi4-ROS2-Headless-Tutorial: Tutorial on how to setup Raspberry Pi 4 headless for ROS2 over Wi-Fi. Ubuntu 20.04, VNCGitHub
Raspberry Pi OS – Raspberry PiRaspberry Pi
Install Ubuntu on a Raspberry Pi | UbuntuUbuntu
Ubuntu (Debian) — ROS 2 Documentation: Humble documentation
Logo
Logo
Logo