Raspberry Pi 3 Setup
WARNING:
- The contents in this chapter corresponds to the
Raspberry Pi 3
which will be the main computer of TurtleBot3 Burger and Waffle Pi. Do NOT apply this instruction to your Remote PC (your desktop PC or laptop). - Setup work requires Power and Time. So battery is not suitable. We recommend using SMPS (AC adapter) during this work.
NOTE: There are two ways to install Linux and ROS to Raspberry Pi 3.
- First method: If you prefer Ubuntu MATE, please take the first method
Install Linux (Ubuntu MATE)
below. This method should install the ROS and dependency packages after installing the Linux images. This instruction takes about 1 hours to install ROS and related packages for TurtleBot3. - Second method: We provide the Linux distro based on Raspbian. They are pre-installed with ROS and ROS-packages related TurtleBot3. It is available immediately without additional installation. If you want to use it, please take the second method
Install Linux based on Raspbian
below.
Install Linux (Ubuntu MATE)
1) Install Ubuntu MATE on TurtleBot PC
WARNING: Ubuntu Mate
does not correspond to Raspberry Pi 3 B +
at present. If you have it, please install Raspbian
instead.
WARNING: The microSD card should have at least 8 GB of empty space in order to install Linux (Ubuntu MATE) on Raspberry Pi 3.
[Remote PC] Download Ubuntu MATE 16.04
image for the Raspberry Pi 3 on your remote PC from the link below.
[Remote PC] In order to write an Ubuntu MATE image to microSD, it is recommended using GNOME Disks
with Restore Disk Image...
option, which natively supports XZ compressed image.
$ sudo apt-get install gnome-disk-utility
TIP: It is recommended using GNOME Disks
, but other applications such as ddrescue
on Linux can be used.
$ sudo apt-get install gddrescue xz-utils
$ unxz ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img.xz
$ sudo ddrescue -D --force ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img /dev/sdx
TIP: It is recommended using GNOME Disks
, but other applications such as Win32 Disk Imager
on Windows can be used. Win32 Disk Imager
2) Install ROS on TurtleBot PC
NOTE: This instruction takes about 1 hours to install ROS and related packages for TurtleBot3. Elapsed time may vary depending on network environment.
[TurtleBot] The following script will allow you to simplify the ROS installation procedure. Run the following command in a terminal window on TurtleBot PC. The terminal application can be found with the Ubuntu search icon on the top left corner of the screen. Shortcut key for terminal is Ctrl
-Alt
-T
. After install ROS, please reboot TurtleBot PC.
$ sudo apt-get update
$ sudo apt-get upgrade
$ wget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_kinetic_rp3.sh && chmod 755 ./install_ros_kinetic_rp3.sh && bash ./install_ros_kinetic_rp3.sh
NOTE: In order to check which packages are installed, please check this link out. install_ros_kinetic_rp3.sh
If you prefer manual installation, please following the link below.
3) Install Dependent Packages on TurtleBot PC
The next step is to install dependent packages for TurtleBot3 control.
[TurtleBot] Download packages from github
$ cd ~/catkin_ws/src
$ git clone https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver.git
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
NOTE: If you want to use Raspberry Pi Camera, please check related appendix for Raspberry Pi Camera
[TurtleBot] Delete some packages that are not needed in TurtleBot PC
$ cd ~/catkin_ws/src/turtlebot3
$ sudo rm -r turtlebot3_description/ turtlebot3_teleop/ turtlebot3_navigation/ turtlebot3_slam/ turtlebot3_example/
[TurtleBot] Install dependent packages
$ sudo apt-get install ros-kinetic-rosserial-python ros-kinetic-tf
[TurtleBot] After install packages, please reboot Raspberry Pi 3.
[TurtleBot] Build packages
$ source /opt/ros/kinetic/setup.bash
$ cd ~/catkin_ws && catkin_make -j1
If catkin_make
command is completed without any errors, the preparation for TurtleBot3 is done.
4) USB Settings
[TurtleBot] The following commands allow to use USB port for OpenCR without acquiring root permission.
$ rosrun turtlebot3_bringup create_udev_rules
5) Network Configuration
ROS requires IP addresses in order to communicate between TurtleBot PC and the remote PC. The remote PC and TurtleBot PC should be connected to the same wifi router.
Enter the below command on the terminal window of the TurtleBot PC to find out the IP address of TurtleBot.
$ ifconfig
Texts in the rectangle is the IP address of the TurtleBot PC
.
Enter the following command.
$ nano ~/.bashrc
Press alt+/
to end line of the file.
Replace the localhost
in the ROS_MASTER_URI
address with the Remote PC’s IP address acquired from Remote PC Network Configuration. Also replace the localhost
in the ROS_HOSTNAME
address with the IP address acquired from the above terminal window, which is the IP address of TurtleBot PC.
Then, source the bashrc with below command.
$ source ~/.bashrc
Install Linux based on Raspbian
WARNING: The SDcard should have at least 8 GB of empty space in order to install Linux on Raspberry Pi 3.
We provide the Linux distro image based on Raspbian. They are pre-installed with ROS and ROS-packages related TurtleBot3. It supports the TurtleBot3 Burger and Waffle Pi model. In this distro image, non-free software like Wolfram, Mathematica, Minecraft Pi and Oracle Java SE are removed.
Remote PC
- Download the Linux distro image based on Raspbian for TurtleBot3
- download link
- SHA256: 7a868c275169b1f02c04617cc0cce9654fd8222623c78b22d0a27c73a9609398
- After download, unzip the downloaded file.
- Guide to burn the image to SD card
- Visit etcher.io and download and install the Etcher SD card image utility.
- Run Etcher and select the Linux image you downloaded on your computer or laptop.
- Select the SD card drive.
- Click Burn to transfer the image to the SD card.
- (other methods to burn) You can use ‘dd’ command in Linux or use application ‘win32 Disk Imager’ in Windows. For a complete guide, take a look here (for Linux users) and here (for Windows users)
TurtleBot PC
-
After the installation, you can login with username pi and password turtlebot. In this case, you have to connect your Raspberry Pi to your monitor using an HDMI cable, and connect your keyboard and mouse to the Raspberry Pi.
- Expand filesystem to use a whole SD card.
sudo raspi-config (select 7 Advanced Options > A1 Expand Filesystem)
- Synchronize and set computers’ date and time by querying a Network Time Protocol (NTP) server
sudo apt-get install ntpdate sudo ntpdate ntp.ubuntu.com
- If you want to change the Password, Locale and Timezone setting (Optional):
- sudo raspi-config > 1 Change User Password
- sudo raspi-config > 4 Localisation Options > I1 Change Locale
- sudo raspi-config > 4 Localisation Options > I2 Change Timezone
- Network configuration for ROS (reference link)
nano ~/.bashrc (modify `localhost` to REMOTE_PC_IP and RASPBERRY_PI_3_IP) export ROS_MASTER_URI=http://REMOTE_PC_IP:11311 export ROS_HOSTNAME=RASPBERRY_PI_3_IP
source ~/.bashrc
Remote PC
- Once you’re done the wireless configuration, you can connect to Raspberry Pi via SSH from your desktop or laptop (reference link):
ssh pi@192.168.xxx.xxx (The IP 192.168.xxx.xxx is your Raspberry Pi's IP or hostname)
NOTE: Differences from the official Raspbian Stretch
- It based on Raspbian Stretch with desktop, the Raspbian based on Debian Stretch
- Removed non-free software like Wolfram, Mathematica, Minecraft Pi and Oracle Java SE
- Removed libreoffice to reduce image size
- Enabled SSH and Camera function using raspi-config
- Change the password: turtlebot
- Installed software for ROS and TurtleBot3
- ROS Kinetic Kame and dependency software
- raspicam_node package for Raspberry Pi Camera
- hls_lfcd_lds_driver package for Laser Distance Sensor
- turtlebot3 and turtlebot3_msgs packages for TutleBot3
- Installed ROS Packages (132 packages): actionlib, actionlib_msgs, angles, bond, bond_core, bondcpp, bondpy, camera_calibration_parsers, camera_info_manager, catkin, class_loader, cmake_modules, collada_parser, collada_urdf, common_msgs, compressed_image_transport, control_msgs, cpp_common, cv_bridge, diagnostic_aggregator, diagnostic_analysis, diagnostic_common_diagnostics, diagnostic_msgs, diagnostic_updater, diagnostics, dynamic_reconfigure, eigen_conversions, eigen_stl_containers, executive_smach, filters, gencpp, geneus, genlisp, genmsg, gennodejs, genpy, geometric_shapes, geometry, geometry_msgs, hls_lfcd_lds_driver, image_transport, joint_state_publisher, kdl_conversions, kdl_parser, message_filters, message_generation, message_runtime, mk, nav_msgs, nodelet, nodelet_core, nodelet_topic_tools, octomap (plain cmake), opencv3 (plain cmake), orocos_kdl (plain cmake), pluginlib, python_orocos_kdl (plain cmake), python_qt_binding, random_numbers, raspicam_node, resource_retriever, robot, robot_model, robot_state_publisher, ros, ros_base, ros_comm, ros_core, rosbag, rosbag_migration_rule, rosbag_storage, rosbash, rosboost_cfg, rosbuild, rosclean, rosconsole, rosconsole_bridge, roscpp, roscpp_core, roscpp_serialization, roscpp_traits, roscreate, rosgraph, rosgraph_msgs, roslang, roslaunch, roslib, roslint, roslisp, roslz4, rosmake, rosmaster, rosmsg, rosnode, rosout, rospack, rosparam, rospy, rosserial_msgs, rosserial_python, rosservice, rostest, rostime, rostopic, rosunit, roswtf, self_test, sensor_msgs, shape_msgs, smach, smach_msgs, smach_ros, smclib, std_msgs, std_srvs, stereo_msgs, tf, tf_conversions, tf2, tf2_kdl, tf2_msgs, tf2_py, tf2_ros, topic_tools, trajectory_msgs, turtlebot3_bringup, turtlebot3_msgs, urdf, urdf_parser_plugin, visualization_msgs, xacro, xmlrpcpp