RaspberryPI(Ubuntu 20.04 LTS server) 에서 raspi-config 설치 및 카메라 사용 방법

2021. 4. 14. 21:48공부/라즈베리파이

테스트 환경

  • 라즈베리파이: Raspberry pi 4B Model B 4GB
  • 카메라 모듈: Raspberry pi Camera V2
  • OS: Ubuntu 20.04 LTS server

라즈베리파이 디바이스 세팅

  • raspi-config 설치

    wget https://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20160527_all.deb -P /tmp
    apt-get install libnewt0.52 whiptail parted triggerhappy lua5.1 alsa-utils -y
    apt-get install -fy
    dpkg -i /tmp/raspi-config_20160527_all.deb
  • boot 설정파일 수정 (라즈베리파이 카메라 연결이 어려운 이유)

    /boot/firmware/config.txt 파일 맨 밑에 start_x=1 추가


ROS2 camera node 설치

  1. 관련 패키지 설치

     git clone --branch ros2 https://github.com/ros-perception/image_common.git
     git clone --branch ros2 https://github.com/ros-perception/vision_opencv.git
     git clone --branch ros2 https://github.com/ros-perception/image_transport_plugins.git
     git clone --branch foxy https://gitlab.com/boldhearts/ros2_v4l2_camera.git src/v4l2_camera
  2. 의존성 패키지 설치

     sudo apt install ros-foxy-cv-bridge
  3. 빌드

     cd ~/colcon_ws && colcon build --symlink-install && source ~/.bashrccolcon build --symlink-install
     source ~/.bashrc
    • 빌드가 에러가 난다면 패키지 업데이트&업그레이드

      sudo apt update
      sudo apt upgrade
    • 또는 rosdep 실행

      sudo apt-get install python3-rosdep
      sudo rosdep init
      rosdep update
      rosdep install --from-paths src --ignore-src -r -y
  4. 카메라 노드 실행

     ros2 run v4l2_camera v4l2_camera_node
  5. 이미지 확인

     rqt
    • rqt Plugins -> Visualization -> Image View : image_raw 토픽 확인

'공부 > 라즈베리파이' 카테고리의 다른 글

RaspberryPi에 Ubuntu 20.04 LTS server 설치  (0) 2022.06.26
라즈베리파이 IP 설정  (0) 2021.04.17