RDP 023: Using ROS to Teach Foundations of Robotics With Ross Knepper

RDP 023- ROS to Teach Foundations of Robotics With Ross Knepper

Written by Ricardo Tellez


In this episode, Prof. Ross explains how he uses ROS to teach foundations in robotics. He tells about how he synchronizes the teaching of ROS with the teaching of robotics subjects, as well as his use of simulations and the importance of debugging tools for ROS. He also explains why he doesn’t use the ROS navigation stack or MoveIt! with his students.

“On my second lecture on ROS I introduce the Drunk Turtle where I introduce deliverate errors, so students can see what happens when you have different categories of errors.”

Ross Knepper

Ross Knepper teaching ROS to students

Ricardo Tellez: Hi, ROS developers. And welcome again to the ROS developers podcast. Today, we are interviewing Prof. Ross Knepper. Ross is the assistant professor of the department of computer science at Cornell university. There, Ross has been teaching foundations of robotics and human robot interaction and robotic manipulation. Today, he will explain us how is he using ROS for teaching all those robotic subjects. Welcome to the podcast, Ross!

Ross Knepper: Hey Ricardo, thank you for having me on. 

Ricardo Tellez: Our pleasure of course :). I would like to go straight to the first question. Why are you teaching ROS? 

Ross Knepper: Sure. So as you mentioned, I teach a course called the foundations of robotics and it was actually a student request. First, I wasn’t teaching ROS and a lot of students were asking me, can we please learn ROS? It seems like an important job skill. And so I decided, well, it fits naturally in the course and I’d be happy to integrate it. 

Ricardo Tellez: Okay. And then you are teaching this as a separate subject or its included into another subject, or the ones that you are teaching as a part. 

Ross Knepper: So the class, as I mentioned, it’s about the foundations of robotics, kinematics, navigation control, uncertainty and for the project component of the course, when the students do their implementation, they use ROS in that. So at the beginning of the semester, the first project is basically all about learning ROS so that the students can use it later on when they work in their robots and simulation. 

Ricardo Tellez: Okay. And which version of ROS are you using? 

Ross Knepper: We are using the latest ROS, Melodic

Ricardo Tellez: Melodic. Why that one? Why not another one? Why don’t you use another version, like Lunar?

Ross Knepper: I think ROS is pretty stable right now. There don’t to be a lot of changes, at least that impact most users. And so it seems pretty invariant to version, honestly. So I want the students to come away knowing the broad foundations of ROS and how to build projects in ROS. I’m not really so concerned with the particulars of one version versus another one. 

Ricardo Tellez: That’s a very good comment! Because I actually also agrees with you that the version of ROS is not really so important in most of the cases. I mean, except when they change from a ROS catkin for example. Apart from that, ROS versions are more or less, they share the same core that is the same. And it’s very stable. And we’ve got this question asked many times because we have an Academy for teaching ROS, and they ask:”But which ROS version are you teaching?”. And then we say: “Well, you mentioned it’s not so important because the core is maybe just for a specific packages.”

Are you using any specific package that requires a specific version of ROS?

Ross Knepper: No, we’re not. I mean, honestly, my philosophy for ROS is that what it’s really good at is interposes communication and it provides a type system which is robotics relevant. So we have the students build their own projects. Each assignment is its own separate project, which is its own package. We don’t really use a lot of the existing ROS package infrastructure beyond the real basics. Because there’s a lot of stuff out there varying quality. Some of it is robot specific. In the early days of ROS, there was a tremendous amount of software on the PR2 stack. And if you have a PR2, it was amazing. You could do so many things with it. But as soon as you tried to run it on some other kind of robot, your mileage would vary considerably. So I’d rather have the students be prepared for whatever robots they wind up using in their future work, rather than thinking they know more than they do, just because it happened to work on one model.

Ricardo Tellez: I see. But I presume that you are using, for example, the Navigation Stack or the movelt package?

Ross Knepper: No, not even those. We use those in research. But this is really, as the class’s name, it’s the foundations of robotics. So the students create their own controller, which operates at a lower level below the Navigation Stack. Similarly they’re learning to do inverse kinematics. They’re learning to control the robot arm and move it. It’s a great tool when what you want is to not worry about how those things work.  But you don’t want students going out thinking they know everything about robotics, and then they realize they don’t actually know how to control an arm because it was done for them. That’s really the level at which we’re teaching this. And when they discover these packages later, there’ll be very pleased.

Ricardo Tellez: Afterwards. Yeah, exactly. Yeah. It’s like teaching people to add and do root squares, but then afterwards they can do it with a calculator and then, yeah. 

Ross Knepper: That’s it, that’s a very apt analogy! Because the course that I teach is actually basically a math course. It’s a lot of linear algebra, a lot of differential equations with robotics applications, of course. But the foundations of robotics is really fairly mathematical. And so we teach this sort of broad range of concepts with applications on the robot and then they go and actually implement the math, using num PI, using ROS, make things work and they see the robot move and that’s a very powerful reward. And I think also the math is much more intuitive if you have an application for it. It’s one thing to learn how to multiply matrices, but to understand what a rotation matrix actually is doing to a rigid body and to see it on the screen is very powerful.

Ricardo Tellez: Which level of education are you teaching? I mean, it’s undergraduate or graduates?

Ross Knepper: It’s an elective at the undergraduate level. I do get grad students taking it as well, so masters and some PhDs take it. It’s a great way to catch up. Maybe you had a little bit of robotics research in undergrad, or maybe you had some informal experience through extracurriculars, like first robotics. You might have a lot of intuition, but not be up to speed with all of the foundational concepts. So it’s really to get everybody to a level playing field.

Ricardo Tellez: Okay. And how do you structure that teaching? I mean, you mentioned before that you were doing some projects and the first project was to learn ROS. So how are you teaching this?

Ross Knepper: That’s right. So all of the projects are done in simulation. We use the turtlesim for the first one and then once they’ve learned ROS, we’re using the V-REP simulator for the remaining four project. So they do for example, in project two, they’re going to learn motion models for different types of mobile robots. So they learn differential drive, Ackerman steering, they learn how to convert between the two. So if they want to achieve a certain linear and angular velocity what is the math behind that conversion? And then they’ll see robots moving on the screen and try to follow lines and so on, on the screen. Project three then is going to be about arm kinematics. Just these basic concepts.

Ricardo Tellez: And at that point they already know ROS. At that point they can apply what they are seeing on the theoretical classes and then apply. 

Ross Knepper: That’s right. So for the first project, maybe it seems a little silly they’re using turtlesim to draw a flower on the screen. So it’s just a pretty picture, but you introduce all of the important concepts. So you’re publishing and subscribing, you’re using a service, you’re using a rate to control the speed at which it sends commands. You’re setting and getting ROS parameters. So all the basic ROS tools are in there and then they learn the command line tools as well. Especially for debugging. So, my wait for service is not returning, why would that be? Well you can run ROS service list and see like, is it running, Oh, I forgot to run the server. That kind of thing.

Ricardo Tellez: Yeah. And then you mentioned that, so you are using simulations for that, are you using any real robot at the end or at some point in time?

Ross Knepper: Well, for this particular course, no, it’s entirely in simulation. We actually have a server farm in the basement of our building that’s running 150 virtual machines. We have 150 students in the class, and we give them all identical configuration so that they don’t have to worry about installing all the right packages and running Ubuntu and all of that stuff. It’s all given to them and they can focus on just learning ROS, just learning robotics.

Ricardo Tellez: Great. And why are you using the V-REP simulator instead of using, Gazebo for example, that is the one that comes with ROS.

Ross Knepper: Yeah. So I know that Gazebo has a lot of fans. We benchmarked a few different simulators and we found that Gazebo is very resource hungry. So eats up a lot of memory and a lot of CPU and it seemed like to get decent performance, say 20 frames per second, you need four cores. Whereas V-REP seems to run very comfortably in one or two cores. So I don’t know much about under the hood what’s going on, but we found that in our server farm, we could get away with half the cores by switching to V-REP.

Ricardo Tellez: Yeah. And I think that both of them, they use the ODE [12:05 inaudible] extension. So that’s strange. Maybe it’s something related to the visualization, that’s different, maybe, could it be instead of the physics?

Ross Knepper: Yeah. Another aspect is that Gazebo has this client server model, so it’s running separate processes and that may, it’s a nice abstraction because it means that you can run the client and server on different hosts, but it may also introduce some overhead as well.

Ricardo Tellez: Okay. So how much time are you dedicating to teach ROS?

Ross Knepper: So it’s sort of a lightening introduction to ROS. So I do one lecture that covers a lot of the basics, client server model, published, subscribe, nodes. I give them some examples and some basic readings. I have them do readings from a book called a gentle introduction to ROS by Jason M. O’Kane, which is a great book.

And I think there’s only so much listening to somebody talk about ROS that’s useful. So beyond that, I think it’s actually much more valuable to learn by doing. And so I want to get the students to dive in early and just start playing with it and see what they can do. So, project one actually goes out on the first day of the class. They have a couple of weeks, so we’re actually just coming up on the end of the first two weeks of class right now. And the students are learning a lot through trial and error, through course staff assistance. And it is sort of like learning to swim by being shoved into the deep end of the pool, for a lot of the students and it feels very intimidating because the course, it’s a big mix of disciplines. Although I’m in computer science, a majority of the course is from engineering. Mechanical engineering, electrical and computer engineering and so on. And all these different backgrounds, many of them are not as confident at programming in Python. So there’s a lot of these factors that make it intimidating. And I think it’s important to get past that intimidation and just say, I’m just going to try, I’m going to dive in, do my best. And inevitably they learn a lot and they come out much more aware than they went in. And of course they will continue learning ROS throughout the semester. There’s going to be things they didn’t quite pick up in the first one. And, really, it’s by talking with friends, we actually encourage them to collaborate. Although they have to submit their own solution, we tell the students, please work together, talk to each other. I think it’s much easier to learn from your peers sometimes than to learn from a professor.

Ricardo Tellez: Do you know the learning ROS is not an easy thing that usually students say they struggle like doing this. So can they cope with all that knowledge? Don’t they have any problem on learning ROS, and they get afterwards later in the semester, they get a star because they are missing some learning of ROS, some knowledge of ROS.

Ross Knepper: Well, the projects are designed to make sure that they do have a little of the basics and when students appear to be struggling with a particular thing, we reach out and make sure that they’re getting the help that they need.

Ricardo Tellez: So they have your full support.

Ross Knepper: Exactly. So, I mean, part of the point of this project is just to see where everybody is. So they submit their code and maybe parts of it aren’t working quite the way they should. And that is a diagnostic tool for us to be able to reach out to them and say, it looks like you could use a little additional help. 

Ricardo Tellez: How many students are we talking about?

Ross Knepper: It’s 150 students in the class. And for Cornell computer science, that’s a small undergraduate class. A lot of our courses are 600, 700 students now. Cause you know computer science has become a very popular major. 

Ricardo Tellez: That’s very good! And which language are you using for programming the robot? You mentioned pipeline before?

Ross Knepper: Many of the students have learned MATLAB and there is a MATLAB bridge to ROS. We’ve had in the past; we’ve had sort of mixed results with that. I think it’s gotten a lot better, but we decided that it’s much easier to teach it in one language. And I think Python, if you know MATLAB and we give enough pointers, it’s pretty easy to Python. So Python with numb PI, you get most of the functionality. 

Ricardo Tellez: That’s right. We interviewed with one of the designers of the ROS packages for MATLAB in a previous podcast. And then they show us very interesting things and they are for example, creating, generating from MATLAB code generating ROS nodes. So you can actually execute that too afterwards inside the robot and quite interesting. Just to let you know, in case that you want to have a look afterwards. 

Ross Knepper: Absolutely. 

Ricardo Tellez: So yeah, I wanted to ask you about, you were explaining about the different projects you were teaching, and the question is, do you have any notes online about that, slide or something that, so that the listeners to the podcast can have access and use it for their own learning of ROS for example?

Ross Knepper: Oh, I see. Actually, I do all of my teaching on the Blackboard, so I don’t have any slides or anything to share.

Ricardo Tellez: Wow, impressive. So how could you know this structure? Do you have some notes for you, but a paper or something like that?

Ross Knepper: I do. I think my notes wouldn’t make a lot of sense to other people, but I mean, I learned a lot of this the hard way. I started using ROS when it was in its infancy and a lot of things were broken or didn’t work the way they were advertised. And so it was really learning, like shoved into the deep end of the pool and I mean that afforded me a certain opportunity to organize information in a more effective way. And there’s been a tremendous amount from the community of tutorials and books and just all kinds of resources since then. So I think it’s much easier for students to learn now than it was in the old days. If they’re willing to put in the time.

Ricardo Tellez: That’s the only thing. But yeah, fortunately it’s like that now, we’re improving. And then let me ask you one question. So based on your experience, what is the biggest problem that you are facing when teaching ROS?

Ross Knepper: Debugging, I think. It’s a hard skill to learn and I try to explain to the students. I mean, the engineers have had sort of an intro to programming course and they’ve done some basic debugging. But it is somewhat of an art form. I mean, I explained to them, it’s like being a detective. Imagine that you’re Sherlock Holmes and it’s the deductive reasoning. It’s the asking, what if, it’s being experimental and sort of changing things in a deliberate way and seeing what happens. But you really have to have somewhat of an understanding of the whole system and how the pieces connect together to do that effectively. And when you’re new to everything, it can be hard to understand what are the right experiments to run or what are the right things to check for.

Ricardo Tellez: Yeah. So let me ask, can I check if this topic is running or should I, I do mention before, should I do a list of the services that are running? Maybe something stupid like that. 

Ross Knepper: Exactly. So something that I think is a wonderful idea is there’s this command ROS WTF and the idea is it just looks around and it says, aha, here’s some things that might be wrong.  But this command is designed for people who are proficient at ROS already. And I think that there’s an opportunity to create a version of this command for ROS newbies. So, trying to spot elementary mistakes. So for example, if you have the same topic name, but one is in the root and one is a namespace, or maybe there’s a typo in a topic name. So two very similar looking names. If, what’s a good example? 

Ricardo Tellez: You launch two nodes that have the process, images from different cameras for example.

Ross Knepper: Yeah. So there’s I think an opportunity because the task is fairly circumscribed, there’s an opportunity for a process like ROS WTF to come in and kind of look around and give friendly feedback sort of. So, if I were to say, what’s one thing that’s missing right now, it’d be sort of more newbie friendly ROS WTF. 

Ricardo Tellez: Okay. That would be a very interesting project to do, practical ROS, what the command that actually suggest you, where to look at. 

Ross Knepper: Where’s the failure is I believe what it stands for. 

Ricardo Tellez: Where is the failure. From now on I’m going to take that, those words to ask to talk about that command.

Based on your experience, how would you recommend other teachers to attach the ROS teaching?

Ross Knepper: Yeah, that’s a great question. I think there’s a lot of enthusiasm among the students. They understand that this is becoming sort of an industry standard thing. Some employers are looking for this, so there’s a lot of eagerness to learn it, but they also coming in, they don’t really understand what that means. So the challenge in education is to help them stay motivated while they’re learning it and not get burnt out. So having, exciting real projects to try. I mean I use the full immersion approach. I think there’s probably a more incremental version if you wanted to focus more on ROS as its own thing. And maybe just add new functionality with each project. But yeah, I think keeping the applications feeling relevant and exciting because it’s hard to imagine, like if I just tell you, okay, there’s this thing called a ROS node and it can subscribe to messages and there’s a callback right in the callback gets called whenever a topic gets published. It’s very hard to imagine, like, why do I care about all of this? Exactly. So as soon as you start plugging in motors and cameras and suddenly there’s data on these topics and the data has some meaning and you start looking at the data and maybe it’s a laser range finder and you start thinking about, well, how do I interpret depth as data? That’s actually a hard thing. You need to know where you are, you need to register it to some map. And so it actually motivates a lot of the important robotics problems that we teach in a whole new way if the student can get their hands dirty and just start playing with the concepts themselves.

Ricardo Tellez: I do agree on that. Basically I think that ROS and robotics has to be taught from the inside to the outside. So instead of teaching what is a node, I believe in my opinion, is that it has to be okay, I want to move the robot and then you need a program that connects to the topics, or I need to read the data from a sensor and I need to process for detecting people and the same sensor for detecting, I don’t know how to do that , but it’s the same sensor. So now that makes sense to have a topic because every program can connect to the same amounts of data or something like that. So from that inside, I need this and to understand why nodes, why topics…

So okay, thank you. So then I’m running here out of questions. So my question, it’s about to finish. What do you think about the future of ROS? Do you think that is something that is going to stay for research and education, or do you think it’s going to become more for commercial use for industry and products?

Ross Knepper: I think there’s an appeal to use it in industry, because it’s a standard that people know coming in and it works. And so at least for the basics, it seems very effective at what it does. I think the challenge for ROS is really the ecosystem of the stacks and packages that are contributed by the community. We see in the early days, Willow Garage created this wonderful stack for the PR2, and did amazing things with it. Meanwhile, a lot of academics were creating their own hierarchy. And what would happen is the PhD student would create a ROS package on their code. It would work on their robot and maybe not on any other robot. And then they graduate, and it’s not maintained. So I think there was this explosion of packages, which was exciting to see, but a lot of them were fairly low quality. And if somebody else wanted to use it, it was a significant amount of extra work. So this is still an improvement on what came before, because we have this foundation of interprocess communication and types. That’s sort of the clearly useful stuff in ROS, which everybody uses. And so the question is how do we go from there to higher level of functionality? And you mentioned a couple of examples, the navigation stack in [28:28 inaudible]. These are things that do appear to translate from one robot to another pretty well. But I think right now these are the exception more than the rule, I guess another one would be gmapping seems to be pretty good with slam. 

Ricardo Tellez: [28:46 inaudible] is also quite nice.

Ross Knepper: Yeah. No, absolutely. These are good packages. I mean, these are the ones that my grad students need some functionality. I’m going to tell them, use movement, use navigation. Why reinvent the wheel? But it’s quite hard to build software that is robust, keep it well-maintained, make it portable. So that’s really the big challenge right now. And I think there’s a lot of corporate interest in this because if they’re solid stacks that they can pick up and use on their robot, that makes it instantly accessible because everybody’s code will work on their robot. So there’s actually a lot of corporate interest in improving the quality of these higher-level capabilities. And I think the struggle is going to be well, do we want to follow the Microsoft model and make everything proprietary or do we want to do sort of the open source model and we can just release the code for a robot. It runs for us and you can do whatever you want on top of it. And I think that in the long-term is going to win out.

Ricardo Tellez: That’s a very good point. I didn’t think about that in this way.  But that’s a very good point. Obviously, what happens with those packages that people [30:09 inaudible] they are going to stay as open source or as proprietary. As far as I know for the projects I’ve been following, they look like, they are going to stay as open source.

Ross Knepper: Sorry, Ricardo, you cut out there.

Ricardo Tellez: Oh yeah. Sorry. Yeah. Well, I was just saying that I think that it’s going to be open source cause it’s what the current packages that I’m following, and they look like, but we’ll see the future. Finally, one last question. So any tool that you would recommend to the listeners that may be useful for ROS programming or learning or any projects that you have developed for that purpose?

Ross Knepper: Yeah. I think for people who are learning ROS, it seems like often the focus is on the sort of in code stuff, creating subscribers and callbacks and all of that. And I tell my students about all of these command line tools, and it seems hard to remember to use them. And a lot of them are special purpose. ROS service is exactly for one thing. But there’s a few other tools out there, rviz, there’s a few tools that are broad that help you to visualize a lot of what’s going on in your ROS installation. And I think once you have a little more clue about what’s going on, these things and really propel you forward in your debugging and in your just understanding of your system as you’re developing. 

Ricardo Tellez: Are you [32:00 inaudible] useful things like rqt cloud, [32:03 inaudible] the branch of utilities on rqt. 

Ross Knepper: And these are intimidating if you’re a newbie because rqt, you get this empty screen when you start it out, what am I supposed to do with this?

Ricardo Tellez: And when do you start adding some new visualizations [32:24 inaudible] and how do you connect to make them show you useful information.

Ross Knepper: Exactly. Exactly. So it’s sort of a second tier after you’ve learned the basics, but I think it’s really important to remember that these things exist and use them wisely. 

Ricardo Tellez: And also it goes on the line that you mentioned before about the debugging. Learning how to debug. I want to tell you about the value [32:49 inaudible] we are publishing some videos, teaching how to do something in ROS.  And then we publish them and then everything goes okay and everybody’s happy, but then what happens is one day somebody else is watching the video. Again, they are trying to work with ROS at home and something failed because of course it’s not the same configuration, many, many things can happen. So what they are missing, some people is telling us, Hey, please can you do some videos, you get mistakes. And then you try to solve them, [33:25 inaudible] we can see what is your deductive procedure for detecting where the error is. So that goes also [33:32 inaudible] of debugging.

Ross Knepper: Yes. In fact, I told you, I do one lecture on ROS. The first half of it is just the dry, nodes and services. The second half is exactly what you said. So I do a live coding example called drunk turtle, and I introduce deliberate errors. And so the students get to see what happens when you make different categories of mistakes. So for example, running in the wrong namespace is a big one because things just, nothing happens. And then, well, what do I do? And nothing happens. You have to use tools to debug. Another example, which I think a lot of students can spend a lot of time on. In Python, If you forget the line at the top, the hash bang user [34:26 inaudible] if you forget that line, the error that you get is really confusing because it will try to run it, I think, as a bash script. And it gets surprisingly far before it errors out. And it gives an error on line 10 about some parenthesis that it wasn’t expected.

Ricardo Tellez: That makes completely no sense about what is actually happening.

Ross Knepper: I guess my newbie version of Russ WTF would look for things like this too. But I think it’s important for the students to see what these mistakes look like and what is the thought process that one goes through. And so even though it’s a really silly example of just a turtle drunkenly wandering on the screen, we drag it out to about 20 minutes just with the debugging and the trial and error. And so I think it’s actually pretty effective. And then I post all the code on Piatsa for my students to run through it themselves and see what went wrong and they reproduce it and get the same errors. And so on.

Ricardo Tellez: That’s a cool idea. I think that we are going to use this idea with your permission. And also these things, introduce errors in our videos and in our lessons that we do around there. Okay. So Ross, thank you very much. It’s been a pleasure to chat with you and to learn about your teaching about robotics and especially about how you teach ROS. And thank you very much!

Ross Knepper: Thank you. It was my pleasure. And by the way, yes, people do make a lot of jokes about Ross and ROS. 

Ricardo Tellez: Okay. I didn’t want to do it here, because it’s funny, but in your case is Ross with s, is super Ross. Thank you very much Ross. 

Ross Knepper: Thanks so much. Have a nice day. 

Ricardo Tellez: Thank you. And to all the listeners, thank you very much for listening to this podcast. Remember that we’ll have another podcast in the next week, and also remember that we, the company that is producing this podcast, it’s called The Construct that we have an Academy, an online Academy called the Robot Ignite Academy, where you can learn ROS in an online environment without having to install anything. So it’s quite easy, just open a web browser and you are in starting learning ROS with beautiful lessons that we have prepared. So thank you very much to the listeners and see you next week.


Related links:

Subscribe to the podcast using any of the following methods

For teachers

A Full ROS & Robotics Teaching Solution

Trusted by hundreds of universities

Discover How to Equip Your Teams with ROS Skills Fast

The Construct For Enterprise

Check Out These Related Posts



  1. Teaching Robotics With ROS | The Construct - […] for teaching robotics. For example, professor Ross Knepper from Cornell University explained to me on Using ROS to teach…

Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This