This week, as part of my work on the Ubuntu Robotics team, I headed up to Slippery Rock University in northwestern PA to meet with Dr. Sam Thangiah and to introduce students to the Robot Operating System (ROS). New semester, lots of new opportunities for learning!
We started with a really simple robot environment. Check out this build! This Raspberry Pi runs an Ubuntu 18.04 image which gives it all the built-in LTS security advantages. It’s mounted on piece of plexiglass with two motors and a motor controller board from the PiHut. We worked through about 75 lines of sample python code which hooked the RPi.GPIO library to control the general purpose I/O pins, and we created an abstract Motor class. This got our two-wheeled robot up and running…running right off the table. Oops.
Getting moving was just the beginning. With a robot active in the physical world, we identified plenty of new problems to solve. One motor ran a bit faster than the other and the robot drifted right. Sometimes one of the wheels lost traction so the robot didn’t go where we sent it. But probably the most important problem yet to solve was to keep it from running into things… and from running off the table
Many of these problems are solved by the Robotics Operating System (ROS), the evolving product of a very active and innovative open source robotics community. With ROS installed on the Pi, another 25 lines of python code created a ROS node listening for commands on the “/move” topic. Devices on the network were able to send motion commands directly to the robot, and we opened the door on the immense library of tools available within ROS.
Robotics can be an outstanding learning tool where the digital realm meets the physical realm. It’s a place where a student’s code makes real, observable actions and where they can experiment with their environment. In just over an hour, our conversations wandered over everything from basic electrical theory to mechanical engineering, including a touch of kinematics, some mathematics, and a few lines of python code to solve our problems. If you’d like to learn more about building your own two-wheeled robot, see the “Your first robot” blog and video series by Kyle Fazzari, Canonical’s lead engineer in robotics.
Now that they’ve been given the basic building blocks, it’ll be exciting to see what a room full of motivated students can produce this semester!