Intermezzo: Robot Operating System

In my original post, I referenced the simplicity of the PR2, the robot I’m working with. Since robotics is one of the main technologies used in my thesis, I decided to expand on it by explaining how the PR2 works in a bit more detail.

I sketched a robot I made myself, in its simplest representation, as follows:

Conceptual sketch of a single computer ROS robot for computer vision purposes

Conceptual sketch of a single computer ROS robot for computer vision purposes, own work.

Central in this image is a computer with an operating system. Thinking of ‘a computer’ and ‘an operating system’, is a good starting point if you would like to imagine what kind of robot you could make. According to the encyclopedia Britannica, a robot is “any automatically operated machine that replaces human effort, though it may not resemble human beings in appearance or perform functions in a human-like manner”. What would be the purpose of your machine, where would it operate, and what computers would be around by default (or are most likely to be around) in that setting? These days, it’s quite likely you’d come up with smartphones, tablets etc., and with stricter embedded systems (like the electronics in a car).

Below the computer, I grouped the input and output devices (I/O). Some devices can connect as is, or may be part of the computer, other might require some electronics to interface with. Just with that, a spare half an hour and some duct tape, you could make this 500$ telepresence robot:

In robotics research, this kind of setup has some problems. Consider for instance an autonomously driving car (recurring example, but it’s a good one to think about…). You could kinda make it from scratch like with the above robot, by taking the car, some computer, and just writing software to make the two work together. Considering the complexity of cars however, and the complex tasks we would want the autonomous car to perform, this software would end up being very complex and require many specialists in a large amount of engineering disciplines. Plus, at the end of it, such custom software might also be very hard to transfer to even another version of the same basic model of that car.

To me, this is where the Robot Operating System (ROS) comes in. To be clear, ROS is actually a meta-operating system. That means it is conceptually similar to an OS, but practically is not at all an OS (personally, I wish one of the creators’ wives or boyfriends or something would’ve told them that naming it an OS is simply a stupid idea). Most people just call it a robotics framework… There are many other robotics frameworks available, but ROS specifically is designed for large-scale, complex systems in a way that makes them easily expandable and transferable as well.

One of the nicer characteristics, is that it follows a peer-to-peer philosophy. The single computer in the first figure can actually just as well be 10 computers, all running the ROS framework, communicating over a network. The ROS framework would tie it all together, and these ten computers would be supporting a single virtual entity, which is what you would call ‘the robot’. This way, the ‘computer’ in a robot with ROS is not usually a single computer, but rather would look like this:

A typical ROS network configuration

A typical ROS network configuration, Quigley et al.

As this image suggests, in the end it’s all about the network setup. 🙂 As we all know, adding a computer to a network as just clicking the name of a WiFi, or plugging in an Ethernet cable. This remains true in this setup. You, practically, can just as easily add another computer to such a network, and that computer can be anything from a single computer being added to extend the robot virtually, to an entirely new robot consisting of 100 computers. This is also how I would probably solve a problem that was asked about in the comments for that telepresence robot: what if you’re on the phone with your girlfriend, thus following her with the robot, and she goes up the stairs? Well, just put another one of those cheap robots (meaning the hardware) up there. Put the Skype on one specific computer, and just switch between the webcams of the physical robots by transferring the video using network streaming. The virtual single entity that, in the end, is the robot, is not impeded by the physical limitations and can switch between the hardware at any time. Nor is there really a limit on what kind of hardware you’d be using.

Robotnik Automation Modular Arm

Robotnik Automation Modular Arm

AscTec Quadrotor

AscTec Quadrotor

These two images and dozens more of examples of robots you can use with ROS, on their website.

I’ll leave you with one final image. Without knowing what these discs are doing, they might be controlled as completely individual robots, all at the same time as one robot, or they might be individual robots working together as an actual team (it looks like that is actually what they’re doing). At this point, I hope that makes sense, and that you see the possibilities as well. 🙂

A team of iRobot Create robots

A team of iRobot Create robots at the Human-Automation Systems Lab, Georgia Institute of Technology,


6 thoughts on “Intermezzo: Robot Operating System

  1. deckersbram says:

    So if I understand correctly it is wiser to use more computers in a network than one computer doing everything. If this is correct may I ask then how much computers you use for your robot?

    • jefhimself says:

      No, not exactly. It just depends on what you want to do. Your question reminds me though of the fact that I’ve been meaning to write an example using your thesis.

      Remember my video with a pancake being flipped? It was an illustration of how I was using geometry processing (pointclouds) to accurately determine the position and orientation of my pancake. Well, Lidars are also often used in robotics as a source for these pointclouds (on which geometry processing would then be applied), for instance for Simultaneous Localization And Mapping (SLAM). Take the following implementation. It uses the hardware equivalent (at least, so it seems, if they don’t it should still be possible) of a tablet pc or maybe a netbook. Not more than that. Using a Lidar, it can construct a map of it’s environment.

      Tie that onto a buoy, and you got yourself a Flidar. 🙂 Maybe you would want to map the Amazon river. If you’re very optimistic, or can loose some Flidars, you may just want to use a smartphone with 3G capabilities, and let the flidar send back its position whenever it can connect to a 3G network.

      On second thought, maybe take the Schelde for the example, I suspect 3G coverage is not awesome near the Amazon… In any case, there’s no point in making such a flidar to map the Schelde a complicated robot with multiple computers and a ‘complicated’ networking solution.

      You could be more adventurous. You might wake up wanting to map Antarctica, so you call the postal services (or the A-team, something in between I guess) and have em drop your flidar near Antarctica. Before you do that, I think most people would agree with this advice:

      Clearly, that flidar would have to be slightly more advanced. 😉 Comparable to the Mars rovers, I would guess, in the sense that that expensive flidar would be operating in a very hostile, remote, poorly understood environment. In this case, you would have the option to remote control this robot, and possibly to virtually expand the robot for some more computer intensive tasks.

      Or, you might require something in between. Maybe you could use flidars on boats instead of buoys. Like those robots in the final image of the post, those flidars could be working as a team to map a sandbank. For the same purpose, they might just as well be physical extensions of a single virtual robot. Or multiple virtual robots working as a team. 😉 I think the correct answer is: I don’t know. What’s the problem, how big are your sandbanks, where are they, what are the local conditions (might one flidar have to pull another free?),…? How many computers are appropriate, depends on how we define the specific problem we’re solving, and how we envision the solution. Before we do that, there’s definitely not a right answer. 🙂

      • deckersbram says:

        Thank you for this example, I get it now.

      • jefhimself says:

        Sweet! I had my doubts about writing this post, but I was glad I did after this comment. 🙂

        ps: late reply, because I couldn’t find a reply button…

  2. You say that the software can get easy too complex. But what is the other possibility when robots have to be like humans as good as possible? The perfect robot would be a self-learning but I don’t think that that is possible yet.

    • jefhimself says:

      That’s in reference to the example with the car, right? If so, I think you’re right: that software will be complex, and there’s not much you can do about it. That doesn’t mean you can’t make life a lot easier for yourself with a proper design and methodology though.

      I saw in one of your comments that you’re quite enthusiastic about smart grids. A smart grid happens to work quite well as an analogy (lucky me). 🙂

      One of the key characteristics I mentioned, is that ROS follows a peer-to-peer philosophy. This makes it modular, just like the (new) smart grid. Adding and removing power producers/ consumers (procumers) shouldn’t really require action from other participants of the grid. You could add or remove a ROS robot to the team just as easily.

      The technology being used by the procumers, ideally, is completely irrelevant to the rest of the grid. You need to know a procumer’s load characteristics and stuff, but not what technologies and devices are behind those characteristics. This as well is true in the way ROS is set up, if you use it correctly. I’m using a laserscanner to find the 3D position of my pancake right now, but it really doesn’t matter. I could just as well replace that scanner by a lidar, a kinect, a stereo camera,… For the lidar and the kinect, I’d literally only have to turn them on to use them as replacements.

      All functionality is also implemented in this peer-to-peer topology. Let’s say my robot is supposed to make pancakes non-stop, but I want it to start sounding an alarm if it’s made more then 20, and I didn’t take them away. Then I could just write that program, and launch it, without ever stopping the robot from what it’s doing. No need to go through the entire design either… From the moment I launch that program, the robot would have this new capability. If it would crash: that’s too bad, but it won’t stop the robot from baking unless I want it to.

      It goes further than that as well. Suppose I’m too lazy to write that program, and I ask someone else to do it. My own code is written in C++ and python, while most people we known would often only want to program in java. Even that would be fine though. If you can write a program for the new functionality in a language supported by ROS, then that program could be added as a part of the robot.

      So, in conclusion, if you adjust your design according to the philosophies that are applied in ROS, you gain a lot of freedom in design decisions that you wouldn’t have to make anymore. In general, you just ‘commit’ to a philosophy, by deciding on which framework to use.

      ps: you’re right about the last comment. I’m not working in this branch of AI you’re alluding to (which seems to be strong AI), but I feel pretty comfortable nonetheless to say that we’re nowhere near that. I can imagine however that if we get to that point, that designs like those using ROS might be able to start using those results, without having to change anything else in the design. Simply by adding ‘intelligence programs’, like you could add that alarm. 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: