PROJECT: ROS SLAM Navigation Robot with Mecanum Wheels - Yahboom ROSMASTER X3
I have been dabbling with various ROS robots over the years. Recently, I have been looking for a ROS2 Robot kit (so I don’t have to build a robot from scratch) with mecanum wheels that I can tinker and learn more about the SLAM navigation capabilities in the ROS2. Of course, I needed this thing to be over engineered by adding a cheap Lidar, depth camera, run from various processors including Jetson Nano and Raspberry Pi4B as well as being small form factored. Oh, also good documentation and lots of example codes so I don’t have to start from scratch.
Well.. to my surprise, I found one that was exactly what I was looking for!
Yahboom ROS Master X3
Robot Repo here - http://www.yahboom.net/study/ROSMASTER-X3
Over view video here - https://www.youtube.com/watch?v=_fsbd6Urcek
Installation video here - https://www.youtube.com/watch?v=JVqzgYPJW0M
Example Training Video (ROS Basic in Chinese with English subtitle) - https://www.youtube.com/watch?v=YcU-VxIWSkE
Following are some of the key capabilities that stood out for me:
Multiple Processor Support - Although the Jetson TX2-NX is recommended as the best cost per performance option, Jetson Nano or Raspberry Pi 4B is also supported. Unlike many people who is looking for the best performance option, I needed it to be at the edge of failure to really test and push the behavior of the algorithms at its peak. It seems like I can swap between the Jetson TX2-NX and RaspPi4B to compare the difference in performance as the RaspPi peaks its limit. Also note that the some components are different between which processor kit you buy - you can purchase the separate components at the Yahboom site.
Small Form Factor with Lots of Capabilities - This kit seems to include just about everything you need to get started with ROS2 for SLAM navigation. It includes mecanum wheels for omni-directional movement, lidar and a depth camera used for 3D point crude and SLAM mapping navigation, voice interactive module, Computer Vision support, 9 axis attitude sensor, and most importantly ROS2 support.
Good Documentation for Learning - Good English documentation and code examples. They also have training videos available (the videos are in Chinese with English subtitle). It is very important to remember that such kit is at the end of the day, a toy that is designed to help learning. This means it will fail to work more times than it works like in the video - a key part of learning to be a great engineer is to overcome the failure and keep moving forward! (or at least, I try to tell myself that so I don’t go crazy with too much frustration).
My ultimate object for this mecanum wheel rover robot project is to build 3 to 4 full size robots (3x3 feet or 1x1 meters) that will navigate on the factory floor to be able to conduct navigation and work cooperatively in a group. It seems like this robot already does the things I needed in a full size robot, so this will be a nice learning tool that I can tote around helping me learn the capabilities of the ROS2 navigation, use of simulation tools, and the software codes that I can further develop which will be transferable over to the full size robot. I am sure there will be plenty of unexpected surprises and hidden pitfalls that will crush my will - as always this engineering and it is never easy. However, this is a good start for me & may be a good educational robot for people to jump start.
Planned Next Steps
Well.. this is a ROS2 learning project for me. I will capture lessons learned, configuration tips and tricks that will help me in a full robot. Also collection of codes that I collect and build along the way.
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
PROJECT: ROS2 Using Neato BotVac D5 Connected Robot & 8GB Raspberry Pi4
The blog post on Technology x2 details a project involving ROS2 (Robot Operating System version 2) and its application in a robotics project using the Neato BotVac D5 Connected Robot and a Raspberry Pi4 with 8GB RAM. The author discusses the advantages of ROS2, including improved module communication, Python3 support, and enhanced security. The project aims to enhance human-robot interaction with a focus on mobility, safety, and diverse communication methods. It involves customizing the Neato BotVac to house the Raspberry Pi4 and Arduino Mega, and setting up Linux Ubuntu with ROS2 on the Raspberry Pi4. The post also covers challenges and learning experiences encountered during the installation of ROS2 on the Raspberry Pi. For a detailed read, you can view the blog post [here](https://www.technologyx2.com/blog_hightech/2021/6/6/project-ros2-using-neato-botvac-d5-connected-robot-amp-raspberry-pi4-8bg).
Okay, after dabbling with the ROS2 (Robot OS version 2), I’ve decided to finally go all in with the ROS2. Although there are many benefits of using ROS, it is not a true Robot Operating System under the meaning of OS/Operating System. However, ROS now have a large and very active community behind it which is a big plus for the open source technology. Also, there are many reusable tools and libraries that are built on the ROS, which can significantly save time and especially if you or your engineering team lack the expertise in certain area. As for me, ROS (original ROS) helped me get started with some of my research projects by utilizing tools that were already developed and tested by the community without having me develop all the components and softwares myself. This allowed me to jump straight in to the area of my research without having to spend months building the robot and the base softwares.
As for the ROS2, it brings significant advantages such as how the modules (aka ROS nodes) communicate, support of Python3, and enhanced security. However, the difference between the ROS and ROS2 is significant enough where people who are proficient in the ROS or currently have an active ROS1 project was hesitant to change over. To me, this is somewhat like the time when the tipping finally happened with the Python3 and the remaining Python2 users had to bite the bullet. I see 2021 a year when the tipping is clear and majority of the ROS users will finally start making the move over especially with their new projects.
Unless I am pursuing a project simply to play around and test the technology, I normally try to envision where I want to go with the project and set the short-term and longer-term goals. Unlike many of my other robotics projects where I start from bare metal, I plan to use my ROS2 project purposefully designed to be shared with the ROS community and utilize the components and modules that are widely available. Also, the type of robots I want to focus during the next few years using the ROS2 will be largely on the “Human and Robot interaction”. This means the robot will have to be 1) Mobile in and/or outside the house, 2) Must be safe for human, animal, and properties, and 3) Need variety of ways to communicate and interact with human, animal, and household goods.
Keeping with this vision, I’ve picked up a used “Neato BotVac D5 Connect”. The Neato BotVac has the dirt bin that can be used to house my Raspberry Pi4 and MCU (for the micro controller unit, I will be using a good old Arduino Mega, but I may eventually jump over to the Teensy 4.1 due to it’s small size and the built in logging capability). The RPi4 is the model with maximum 8GB memory as I am almost certain that it will be a struggle trying to run ROS2 for SLAM and various other applications. RPi4 is housed in the “Armor case with fan” (reference my research page Here). The customized dirt-bin cover (metallic silver colored) was given to me by a good friend and a mentor. I would have been stuck without a cover after removing the dirt-bin.
Although the unit was in a very good shape, I did a through cleanup and removed all the vacuum parts that are not needed. As such, the space where the roller used to be is a nice empty space that is in the front and is open to the ground. It will be a great place to house various sensors and electronics.
Well.. a very good start as I have all the hardware for the ROS2 robot without having to build anything! Next step will be to install the 64-bit Linux Ubuntu + ROS2 on a SD card for the RPi4. I will also have to setup an old Dell laptop with a Linux + ROS2 to use as a controller system by SSH (remotely connect) into the robot’s Linux/ROS.
Planned Next Steps - Quickly get to a SLAM capable ROS2 Robot Platform
Download & burn Raspberry Pi4 image to a SD card - 64-bit Linux Server 20.04 - Done
I used 32gb class 10 SD card - perhaps I may move to 64gb later, but I like 32 as I can make a quick copy of the card (usually under 30min & retrieval is under 15min)
Configure Ubuntu 64-bit Linux Server - Done
Default Ubuntu ID & PW: ubuntu
Install instructions
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).
Install ROS2 on the Linux image & test - WIP
I followed the github repo here: https://github.com/cpeavy2/botvac_node
other resources for reference: https://github.com/SV-ROS/intro_to_ros
Ran into an issue while trying to install a required packages: ros-foxy-xacro
sudo apt install ros-foxy-xacro <— unable to locate package error
Googling did not provide and answer, so the next step is to brute-force by installing the package manually
location for the xacro package - http://packages.ros.org/ros2/ubuntu/pool/main/r/ros-foxy-xacro/
*arm64.deb file can be downloaded to Linux (using curl -O command) & installed manually (I used gdebi as it automatically resolves dependencies) - https://linuxhint.com/manual_install_deb_package_cli_ubuntu/
As usual, nothing about computers are easy. I had to trace down and manually install a few additional packages.
first I needed ros-foxy-ament-index-python
which needed ros-foxy-ros-workspace
I used gdebi to install, ros-foxy-ros-workspace which satisfied the need for the ros-foxy-ament-index-python, which satisfied the need for the ros-foxy-xacro. You really don’t appreciate the automatic package install unless you have to manually do it yourself.
as I went down the manual installation route, I fell into the rabbit hole and started running into a bunch more package issues
we call this a Regression in the computer science when a previous state calls for another state and continues on - well, except in this case, it was the computer giving orders and I was the one who had to do the work
manually installed python3-colcon-package-selection, which was required by python3-colcon-parallel-executor, which was required by python3-colcon-powershell, which was required by python3-colcon-python-setup-py, which was required by python3-colcon-recursive-crawl, which was required by python3-catkin-pkg-modules……..
time to press the [Control] and [C] key and break out of this mess
while I was starting to get frustrated, a friend told me about the ROS GPG Key Expiration incident that happened about a week ago (see below).
ROS GPG Key Expiration Incident - ROS Discourse link HERE
to make the long story short, a mistake happened and it caused service outage on build.ros.org, build.ros2.org, ROS infrastructure, ROS buildfarm, ROS distro, packages.ros.org, and the Ubuntu key server.
Certainly I am impacted by this and to fix this issue, I need to update the public key used for ROS apt repositories using this command for ROS2
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
As this simple exercise of getting the ROS2 installed on a Raspberry Pi, I am going to break this off into a separate posting. This way I can keep it updated and reference as I will surely fall back in the same trap in the future. Below is a few items for my own lessons learned
Nothing about computers are ever easy. Nothing about underpowered Raspberry Pi is easy. Needless to say, trying to put a 64bit Linux and a ROS2 (both rather new) on an underpowered RPi computer on a SD card is going to be troublesome.
Remember the Murphy’s Law! If it can go wrong, it will certainly go wrong ‘exponentially’. Bummer.
Choosing between the ROS 1 and ROS 2 - For Dummies Guide for choosing Robot OS
Once you decide to learn ROS (Robot Operating System), next step is to choose between the ROS 1 or ROS 2. There are many resources on the internet that highlights the difference between the ROS1 and ROS2. Following is an excellent article that compares the difference between the two using infographics. As you can see in the article, both ROS1 and ROS2 serves as an excellent platform which contains re-usable tools that will help you develop your robotics projects. They are both backed by a very active and passionate community of roboticists all over the world.
“ROS 2 vs. ROS 1 Which One Is Better For Me?” - https://www.theconstructsim.com/infographic-ros-1-vs-ros-2-one-better-2/
Before we continue, let me make it clear that the ROS2 is not simply a next version of ROS1 - ROS2 is very different than ROS1. Even thought I would agree that the ROS2 includes very important improvements over ROS1, the difference between the two often feels like they are two different OS like Windows OS vs Mac OS. At times, your experiences in ROS1 will hinder your learning of the ROS2. So, the important question is should you start with the ROS1 or ROS2 as a newcomer to the RobotOS. The natural tendency is to start with the later version which is the ROS2 simply because you want to avoid having to learn an older platform which will be deprecated soon. The decision is not that simple.
Consideration for starting with the ROS2 - Engineering is hard and the robotics is harder. While pursuing a robotics project, there will be many times that you will run into problems that you need to research on the internet for and even seek help from the ROS community. As of this writing, mid 2020, the resources and code examples in ROS2 is still rare compared to the more established ROS1. Also, receiving help from the ROS community maybe limited to certain popular topics due to the people in the ROS community still new to the ROS2. The viable reason to start with the ROS2 first is, if it offers the key functionality that you must have in your project such as security requirement, language or platform support, and number of communication nodes required etc. Keep in mind, the road to the ROS2 will give you more capabilities at the end, but the road will certainly be slower and tougher at least for now.
Consideration for starting with the ROS1 - Many people who have some experience in the ROS1 and have dabbled on the ROS2 will likely recommend starting with the ROS1. This is due to the vast amount of resources that you can easily find and reference for your project. You will also be able to find learning materials like books, on-line courses, tutorial much easily and cheaper with the ROS1 (please reference my other post on the ROS for a free ebook by Mr. Jason M. O’Kane - https://www.chibots.org/content-how-to-advanced/getting-started-with-the-ros-robotos ). Although starting out with the ROS1 will provide less painful start, you will soon find yourself envious of the capabilities of the ROS2 and regret not starting with the ROS2.
The key to your success is Getting Started - The more you wait and the more you search, you will just end up with more contradicting recommendations. To add to your confusion and frustration, my recommendation is to start with the ROS1 if your objective is to learn ROS. You will enjoy vast amount of free resources on the internet and the support from the ROS community. If you are pursuing a robotics project that must have the capabilities offered by the ROS2, start with the plan in mind that you will have a lot of learning and R&D along the way. Just like the old saying, there is really no secret and the key is to get started and find out the answer yourself. After all, the reality is that you will end up having to learn both, realizing that there was no shortcut.
I will end my post by sharing my previous journey of learning Python back in 2012ish. Coming from the old C/C++ language, everyone said picking up Python was going to be really easy. When I got started, the Python 2 was the old and more established version and the Python 3 was the new and radically improved version very similar to the ROS1 vs. ROS2 today. Thinking that I can skip the Python2, by going straight to the Python3, I got started by buying an only book at the bookstore on Python3 that costed more than my computer (well at least it felt like it). Unlike what I have expected, learning Python for me took much longer than I have initially thought. Also, whenever I try to push my project beyond the basics of the book’s tutorial, I found myself constantly getting stuck with not being able to find much on the internet (also, online communities like StackOverflow was still very new at the time). Also, because of many open source projects were predominantly written in Python2, I found myself spending more time on Python2 rather than Python3 unless it was for my own project written in 3. Needless to say, I eventually got pretty good on Python, but perhaps the time and pain would have been less if I focused on Python2 first rather than having to learn both Python2 and 3 unintentionally in parallel. As in life, I think there is no shortcut in technology. The key is to get started - You will eventually become a master as long as you don’t give up! I promise.
Getting Started with the ROS (Robot OS)
Among the roboticists, both hobbyists and professionals alike, the ROS (Robot Operating System, https://www.ros.org/) is rapidly becoming one of the major robotics platform for building and driving robots. Some people will argue that the ROS is not exactly an Operating System, as it is a platform or a collection of tools that runs on a Linux OS. Despite of how you categorize it, the true power of ROS comes from the active ROS community and the community developed open-source softwares and middle-wares that are re-usable.
Before the ROS, a roboticist would spend countless hours reinventing the wheel each time they start a new project. One of my biggest frustration coming from the software engineering, is the lack of standardized conventions for driving hardware functionalities. To build a simple 5 axis manipulator aka Robot Arm, I find myself spending considerable amount of time and effort learning about the individual hardware components and its embedded softwares. As the robotics require advanced skills in multiple domains including mechanical engineering, electrical engineering, and software engineering (and nowadays Machine Learning, Computer Vision etc.), it is most likely that a robotics project will get stalled before you get to the point where you start thinking about programming the robot to move. Needless to say, that the small research project involving inverse kinematics of a robot arm, is not a small project due to the hidden obstacles and barriers coming from the multiple domains of expertise that are beyond most of us.
ROS as a meta-operating system provides process management and hardware abstraction. This means, you can re-use the thousands of hardware and software components that are already built by the ROS community and focus in the area of your expertise. Think of it as getting access to various Arduino libraries that extends the functionalities of your sensors without have to write it yourself. ROS is especially helpful for driving advanced components and/or very specific use cases. I think the ROS provides the best opportunity to leverage what other have already built and to share what you have built with the others.
There are lots of resources available on the internet and the bookstores. One of the resources I would recommend starting out is the “A Gentle Introduction to ROS” by Mr. Jason M. O’Kane - https://www.cse.sc.edu/~jokane/agitr/ . The book is free for individual use and is highly recommended by the ROS community. Why not give ROS a try? It will certainly be a great tool to have in your robotics toolkit.