반응형
https://emanual.robotis.com/docs/en/platform/turtlebot3/sbc_setup/#sbc-setup
WARNING
|
1. Prepare microSD Card and Reader
You need a micro SD card reader to burn the OS image on your PC or laptop.
- Download the ubuntu-18.04.4-preinstalled-server-arm64+raspi3.img.xz image on your PC.
- Unzip the downloaded image.
- Burn the image file(.img) to the microSD card.
- Use Restore Disk Image option in the Disks utility in Ubuntu.
- Run the utility and select the restore image, then burn to the selected micro SD card.
You can use various image burning tools.
For example, Raspberry Pi Imager or Linux Disks utility can be used.
Choose your preferred tool to burn the image to microSD.
■ Raspberry Pi Imager
Please refer to this article to find more information about Raspberry Pi Imager.
Download Raspberry Pi Imager from raspberrypi.org
- Click CHOOSE OS.
- Click Use custom and select the extracted .img file from local disk.
- Click CHOOSE STORAGE and select the microSD.
- Click WRITE to start burning the image.
■ Disks Utility
Disks utility is included in recent Ubuntu Desktop. Search for “Disks” and launch the app.
- Select the microSD card in the left panel.
- Select Restore Disk Image option.
- Open the .img file from local disk.
- Click Start Restoring... > Restore button.
2. Boot Up the Raspberry Pi
- Connect the HDMI cable of the monitor to the HDMI port of Raspberry Pi.
- Connect input devices to the USB port of Raspberry Pi
- Insert the microSD card.
- Connect the power (either with USB or OpenCR) to turn on the Raspberry Pi.
3. Configure the Raspberry Pi
- Log in with default username(ubuntu) and password(ubuntu). After logged in, system will ask you to change the password.
- Open automatic update setting file.
$ sudo nano /etc/apt/apt.conf.d/20auto-upgrades
- Edit to disable automatic update settings as below.
Save the file with Ctrl+S and exit with Ctrl+X.APT::Periodic::Update-Package-Lists "0"; APT::Periodic::Unattended-Upgrade "0";
- Enter below command to configure the WiFi network setting.
$ sudo nano /etc/netplan/50-cloud-init.yaml
- When the editor is opened, append below contents at the end of the file.
Replace the WIFI_SSID and WIFI_PASSWORD with your wifi SSID and password.
network: version: 2 renderer: networkd ethernets: eth0: dhcp4: yes dhcp6: yes optional: true wifis: wlan0: dhcp4: yes dhcp6: yes access-points: WIFI_SSID: password: WIFI_PASSWORD
Save the file with Ctrl+S and exit with Ctrl+X. - Apply all configuration for the renderers, and then reboot the Raspberry Pi.
$ sudo netplan apply $ reboot
- Set the systemd to prevent boot-up delay even if there is no network at startup. Run the command below to set mask the systemd process using the following command.
$ systemctl mask systemd-networkd-wait-online.service
- Disable Suspend and Hibernation
$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
- Install and enable the SSH
$ sudo apt install ssh $ sudo systemctl enable --now ssh $ reboot
- After rebooting the Raspberry Pi, if you wish to work from the Remote PC using SSH, use below command from the remote PC terminal. The default password is ubuntu.
* check IP$ ssh ubuntu@{IP Address of Raspberry PI}
wlan0의 inet에 해당하는 IP임을 알 수 있다.또한, DHCP로 인해 IP가 바뀌는 것을 방지하기 위해$ ifconfig eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 100 bytes 7784 (7.7 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 100 bytes 7784 (7.7 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.0.3 netmask 255.255.255.0 broadcast 192.168.0.255 inet6 xxxx::xxxx:xxxx:xxxx:xxxx prefixlen 64 scopeid 0x20<link> ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet) RX packets 324 bytes 315749 (315.7 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 289 bytes 40538 (40.5 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
공유기에서 ether에 해당하는 MAC주소를 사용하여
IP가 추후에 변경되지 않도록 하였다.
https://jstar0525.tistory.com/130
4. Add Swap Space
- Enter the command below to create 2GB swap space.
You can ignore below error when entering swapoff /swapfile command.$ sudo swapoff /swapfile
swapoff: /swapfile: swapoff failed: No such file or directory
$ sudo fallocate -l 2G /swapfile $ sudo chmod 600 /swapfile $ sudo mkswap /swapfile $ sudo swapon /swapfile $ sudo nano /etc/fstab
- When the editor opens the fstab file, append below contents at the end of the file.
/swapfile swap swap defaults 0 0
- Check if 2GB of swap space is correctly configured.
$ sudo free -h total used free shared buff/cache available Mem: 912M 97M 263M 4.4M 550M 795M Swap: 2.0G 0B 2.0G
Please refer to the Ubuntu Blog below for more useful information. |
5. Install ROS Dashing Diademata
- Open a terminal on SBC
- Update and upgrade your software
$ sudo apt update && sudo apt upgrade
- Setup locale
$ 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
- Setup sources
$ sudo apt update && sudo apt install curl gnupg2 lsb-release $ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - $ sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'
- Install ROS 2 packages
$ sudo apt update $ sudo apt install ros-dashing-ros-base
6. Install ROS Packages
$ sudo apt install python3-argcomplete python3-colcon-common-extensions libboost-system-dev build-essential
$ sudo apt install ros-dashing-hls-lfcd-lds-driver
$ sudo apt install ros-dashing-turtlebot3-msgs
$ sudo apt install ros-dashing-dynamixel-sdk
$ mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/src
$ git clone -b dashing-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/dashing/setup.bash' >> ~/.bashrc
$ source ~/.bashrc
$ colcon build --symlink-install --parallel-workers 1
$ echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc
$ source ~/.bashrc
7. Environment Setup (Domain ID Allocation)
In DDS communication, ROS_DOMAIN_ID must be matched between Remote PC and TurtleBot3 for wireless communication under the same network environment. Following commands shows how to assign a ROS_DOMAIN_ID to SBC in TurtleBot3.
- A default ID of TurtleBot3 is set as 0.
- To configure the ROS_DOMAIN_ID of Remote PC and SBC in TurtleBot3 to 30 is recommendable.
- Open a terminal on SBC
- Use the following commands.
$ echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc $ source ~/.bashrc
WARNING : Do not use an identical ROS_DOMAIN_ID with others in the same network. It will cause a conflict of communication between users under the same network environment. |
반응형