PROJECT: Neato BotVac Robot - How to install ROS2 Foxy + 64bit Linux Server on a Raspberry Pi4 (and not cry)
As I started the ROS2 project, my objective was to quickly install the ROS2 and get to learning to tools. However, with the various obstacles, I’ve decided to write out the steps and things that will certainly stall me in the future. Following are some of the instructions that I found that explains steps to install the ROS2 on RPi4.
Following are the steps that I have used to install 64bit Linux Ubuntu Server 20.04 + ROS2 on a Raspberry Pi4 8gb model - for use with the Neato BotVac D5 Connect Robot
Download & burn Raspberry Pi4 image to a SD card - 64-bit Linux Server 20.04 - Done
Images are here - https://ubuntu.com/download/raspberry-pi
I used 32gb class 10 SD card - perhaps I may move to 64gb later, but I like 32gb as I can make a quick backup copy of the card or retrieve from a backup around 30min.
Install instructions
Configure Ubuntu 64-bit Linux Server - Done
Default Ubuntu ID & PW: ubuntu
Setup wifi on Ubuntu/RPi4: https://itsfoss.com/connect-wifi-terminal-ubuntu/
caution: when you nano to modify yaml fie, make sure you use 4 spacebar (using tab key will cause error).
only thing I had to do was to modify the yaml file. In my case I had to do the “sudo netplan generate” & “sudo netplan generate” after I added the wifi info on the yaml file.
Tested and made sure I can just power up the RPi4 and remote in headless from my laptop - a good place to make a backup image of the SD card
command used from my Mac - ssh ubuntu@192.168.1.xxx (192.168.1.xxx is the IP address of your RPi4)
if you are retrieving from a backup image and try to connect headless, you may get “warning: remote host identification has changed” message. Use the command here to reset
ssh-keygen -R 192.168.1.xxx <— IP address of the RPi4
Install ROS2 and required packages on the Linux image - Done
Referenced following resources
You may have to run the script below. To learn more about the ROS GPG Key Expiration Incident - ROS Discourse link HERE
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
Update and Setup Locale
sudo apt update && sudo apt install locales
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
sudo curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
Install ROS2 Core Packages - base package includes many other packages
sudo apt update
sudo apt install ros-foxy-ros-base
Install Colcon (Build Tool)
sudo apt install python3-colcon-common-extensions
Auto-completion for ROS2 command line tools (optional, but recommended)
sudo apt install python3-argcomplete
Configure Your Environment for ROS2 & Build Test - Done
Add instruction to source your ROS2 environment on the bashrc file
echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc
To conduct a build test, we are creating a workspace folder called “robot_ws”. You can change it to any folder name you want. Following commands test and confirm the install - you will see following folders created: build, install, log, src
Note: your current directory/pwd is /home/ubuntu.
mkdir -p ~/robot_ws/src
cd ~/robot_ws/
colcon build --symlink-install
Install and Configure the BotVac - Done
Install required packages
sudo apt install build-essential
sudo apt install ros-foxy-xacro
sudo apt install python3-rosdep2
Clone packages for the BotVac & Build
cd ~/robot_ws/src
git clone https://github.com/jnugen/botvac_node.git
git clone https://github.com/jnugen/neato_robot.git
git clone https://github.com/kobuki-base/cmd_vel_mux.git
git clone https://github.com/kobuki-base/velocity_smoother.git
git clone -b foxy-devel https://github.com/ros-planning/navigation2.git
cd ..
rosdep update
rosdep install --from-paths src --ignore-src -r -y
colcon build (note: the build time for me was around 49min)
source install/setup.bash
Launch ROS2 on RPi4 (Note: RPi4 will have to be connected to the BotVac via micro USB) - DONE
ros2 launch botvac_node botvac_base_only.launch.py
If you see a screen like below with no error, you are good to go. Congrats!
Troubleshooting ideas
If you are like me, things will certainly not go right the first time or the second or the third time. Following are some of the issues I had and the way I fixed it.
This is really more to help me reference as I run into issue in the future when I reinstall ROS2. Hopefully, some of workaround here can help you troubleshoot your issue as well.
ISSUE: RPi4/ROS2 is not seeing the BotVac robot - if you see the error similar to the screenshot above (Error: “Could not access serial port: /dev/ttyACM0” and/or “Could not connect to Botvac”)
When the Neato robot is properly connected, it will show up as “ttyACM0” in the /dev directory. If it does not show up, try the following
Unplug the micro usb cable and plug back in to see if it will appear. You can also try rebooting the RPi as well.
Try to change the micro usb cable. Some of the cheap cables are rates for charging only (no support for data transmission) so make sure you are using a proper cable.
This is the one that bit me. I used the shortest cable I had, but that caused the problem.
ISSUE: The Linux OS installed fine, but start getting bunch of error message while trying to install ROS2.
There is a known issue that was due to ROS GPG key. Reference HERE. Use the short script they have provided for ROS2. In my case, that fixed the majority of the issues while trying to install ROS2.
ISSUE: Every thing worked and tested fine. However, a few days later, I start receiving error when trying to launch the ROS2/Neato script - ros2 launch botvac_node botvac_base_only.launch.py
Try reinstalling the steps in Step #5 - Clone packages for the BotVac & Build.
I had to do this a few times. I suspect it has to do with how I ended the session on the previous day. I am not sure yet what I am doing wrong, but running the steps from the Clone packages on the #5 seems to fix the problem.
Planned Next Steps
Test drive the robot headless (remotely) from a separate ROS2 computer. Since I only installed the most essential applications on the RPi, I will have to use the laptop/PC with full suite of ROS2 to use navigation functions. Since I am new to these tools in ROS2, I am going to take time learning all about the tool and get started.
Also, I have to learn about the robot both mechanically as well as its software APIs. All the information I gather will be included in the next project update.
This is for my personal use - Reference material while I am studying ROS2.
Neato BotVac
For reference
Neato D5 Review - https://smartrobotreviews.com/buying-guide/neato-botvac-d5-connected.html
Neato Pi Hack - https://www.robotshop.com/community/robots/show/neato-robot-with-raspberry-pi-hack
Hackaday - https://hackaday.com/tag/neato/
Servo Magazine - https://www.servomagazine.com/magazine/article/neato-ros-robot-navigation
questions & discussions: http://www.robotreviews.com/
Nav2 - https://roscon.ros.org/2019/talks/roscon2019_navigation2_overview_final.pdf
——-
research workaround
https://www.youtube.com/watch?v=fxRWY0j3p_U
https://www.youtube.com/watch?v=AmuLiA840fA