Creating a standalone ROS computer system
The brain of a robot is very important. In my case, YardBot is an excuse to learn the ins and outs of ROS, or Robot Operating System. ROS is a framework for allowing robot components to talk to each other with messages. It has a very large community that is growing all the time and is used by a surprising number of companies for their commercial products. It’s the logical solution to high level computing on YardBot.
Many robot users build their computing systems on top of laptops and netbooks that go with the robot on its journeys. I wanted to up the difficulty scale somewhat and use a dedicated Mini ITX board and case for the job. Use an SSD and this would have the added benefit of boosting the ruggedness of the system considerably.
Now that I have the system running an a basic state, here is the procedure I followed.
Mini ITX motherboard + CPU combo
Actual motherboard here is a personal choice, but the primary thing to keep in mind is power consumption. This board will be running off the main system battery so the less power you can use, the longer your runtime. I ended up with a Biostar unit from the local classifieds that has a 1.1GHz Celeron processor, with onboard fan. It’s not very powerful, but since it isn’t running a GUI, it should be sufficient for running multiple ROS nodes and is a great way to get familiar with ROS without spending a fortune.
SSD and memory
These are standard computer requirements so there’s not much else I need to say. I like the SSD for minimizing the number of moving parts and making the system more rugged. Memory also depends on the motherboard you choose and I filled mine out with 4GB.
Mini ITX case w/ power supply
This is completely personal preference once again, but keep in mind the environment the robot will be operating in. I chose the Morex 5677 for it’s rugged construction and airflow. It’s quite small and will fit on the top surface of YardBot quite nicely. It also includes a 60W 12V DC power supply which is perfect for splicing into the main electrical system.
Frankly hardware is the easy part, but now that it’s set up, the software components can go together.
ROS technically works with a variety of base platforms, but the OS with the largest community of robotics enthusiast is Ubuntu. It’s very easy to install new packages with Ubuntu thanks to aptitude and even easier to get support when things go wrong.
Follow the main Ubuntu server install tutorial and you should up and running in no time. Remember that we’re going for a minimal installation so the only server that should really be installed initially is OpenSSH.
The ROS wiki has fantastic documentation and tutorials so rather than go through every step, just follow the wiki page. Since the system itself is a server, you only need to install the ros-base bundle. Don’t worry about needing the desktop components because ROS’s networking design means you can use another system running the full ROS desktop to monitor and connect to the robot’s core.
This is where I am now, and where you’ll spend the bulk of the configuration time. Making ROS work in a self-contained manner requires additional setup but there are plenty of tutorials and information pages available online.
The main feature we’re trying to accomplish is to have the robot start Ubuntu normally, then start roscore and any other nodes that your robot requires. Initial info and design feedback was from this page that I modified as necessary. The final result is that I can SSH into the robot and view the screen session containing console output. In my case, I’m also using rosbridge to provide JSON access for my mobile phone, so that node is included too.
The above webpage at ariandy does a good job explaining the procedure, but I ran into multiple issues that I’ll add here.
Add sleep to the cron job before calling screen
This one took a while to finally diagnose and apparently it’s because screen doesn’t immediately initialize after @reboot runs. Add sleep 30; to the cron job so that screen can fully start. That makes the full cron script
@reboot sleep 30; /path/to/start/script.
Don’t put scripts in home directory
I read on the various Ubuntu forums that the /home directory isn’t mounted until after cron runs at boot, so scripts that you set here won’t be found. After moving my scripts to /usr/local/bin and using full path names, everything seemed to work.
Set 755 permissions
This is a reasonably standard one as far as Ubuntu scripts go, and I can’t even confirm if it was what fixed my setup problem, but after setting my scripts to 755, it all seemed to fall into place.
This is only the start of the total robot software configuration but after spending a few hours with it, I now have a working ROS install that starts when I boot the computer and I can now start writing and install nodes for it.