SBC SetUp 김성두
개념: Remote PC Setting에서 언급한 TurtleRobot를 server로 구성합니다. UBUNTU Group에서는 Raspberry Pi가 IoT의 지원목록에 포함됩니다. 리모토 컴에서 빌드하여 업로드하면 TurtleBotPi의 카메라와 Laser 거리측정기가 스스로 지도를 작성하고 네비게이션을 할 수 있도록 하며, Manipulation이 가능합니다. 우리 학교에서 탐구할 로봇에는 Raspberry Pi 3 B+ 이 장착되어 있습니다.
1. Ubuntu Server 설치 1-1) Server 이미지 다운로드 https://ubuntu.com/download/raspberry-pi ubuntu-20.04.1-preinstalled-server-arm64+raspi.img 를 sd카드에 구워서 raspi에 설치합니다. 위 그림에서 나오는 것과 같이 HDMI 케이블, USB 키보드 마우스를 연결합니다.
1-2) network 셋팅
TurtleBot 과 와이파이로 연결되어야 통신과 로봇의 이동이 편리하므로, 한 공유기 아래 함께 두고 Remote PC 와 마찬가지로 아래와 같이 처리합니다.
#nano /etc/netplan/50~ (컴따라 파일명이 다름) #netplan generate #reboot 작동안되면 아래 순서 진행 lan선으로 접속해서 apt로 update 등 실행 또한 networkmanager설치 apt-get network-manager wifi 사용위해서 (재부팅 ) #nmcli d #nmcli r wifi on #nmcli d wifi list #nmcli d wifi connect buntu password 12351235 ( 참고: 서버보다 공유기가 IP배분의 우선권을 가지므로 raspi에서 설정해도 무시됩니다.)
2. Raspberry Pi 와 Desktop 의 연결 Raspberry Pi 를 Server, Desktop를 Client로 합니다.
(순서) - 공유기에 접속하여 Raspberry Pi 와 Desktop 의 아이피를 확인합니다. - Client 에서 터미널 또는 원격접속 툴을 이용하여 서버에 접속합니다. 터미널: $ssh ( 서버 아이디)@ Raspi주소 (예, $ssh ubuntu@127.63.24.23 ) 위 그림처럼 password 입력창이 나오면 클라이언트 와 서버로 연결된것입니다. (초기 id: ubuntu password: ubuntu)
3. Swap Space 구성하기 라즈베리파이3 의 메모리가 1기가로 부족하여 swapfile을 2G로 구성합니다. - SBC ( 서버)의 터미널에
4. Ros2 Raspberry에 설치 https://github.com/ROBOTIS-GIT/turtlebot3 Foxy + Ubuntu Focal 패키지를 설치합니다. GitHub 사용합니다.
(세계적인 로봇개발자들이 만든 코드를 보며 내용을 분석합니다.) -------- $ sudo apt install python3-argcomplete python3-colcon-common-extensions libboost-system-dev build-essential $ sudo apt install ros-foxy-hls-lfcd-lds-driver $ sudo apt install ros-foxy-turtlebot3-msgs $ sudo apt install ros-foxy-dynamixel-sdk $ mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/src $ git clone -b foxy-devel https://github.com/ROBOTIS-GIT/turtlebot3.git $ cd ~/turtlebot3_ws/src/turtlebot3 $ rm -r turtlebot3_cartographer turtlebot3_navigation2 $ cd ~/turtlebot3_ws/ $ echo 'source /opt/ros/foxy/setup.bash' >> ~/.bashrc (nano로 .bashrc에 넣어라) $ source ~/.bashrc $ colcon build --symlink-install
$ echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc (.bashrc에 넣기) $ source ~/.bashrc
6. 환경설정 $ echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc $ echo 'export LDS_MODEL=LDS-01' >> ~/.bashrc $ source ~/.bashrc 도메인을 달리해야하는 경우 REMOTE와 동일하게 맞추어야 합니다.
|