When you think about the types of jobs you can get as a Python developer,
you probably weigh the differences between data science and web development.
But did you consider programming robots in Python? And not just toys, but serious productive
machines. It turns out there's a gap in the industry where we could use more Python developers
in robotics. That's why I'm happy to have Ricardo Telles here to give us an overview of the software
development side of robotics programming with Python. This is Talk Python to Me, episode 232,
recorded September 11th, 2019.
Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem,
and the personalities. This is your host, Michael Kennedy. Follow me on Twitter where I'm @mkennedy.
Keep up with the show and listen to past episodes at talkpython.fm.
And follow the show on Twitter via at talkpython.
This episode is brought to you by Linode and Tidelift. Please check out what they're offering
during their segments. It really helps support the show.
Ricardo, welcome to Talk Python to Me.
Thank you very much. It's my pleasure.
Yeah, it's great to have you here. It has been way too long since we've talked about robotics
and Python on the podcast. We were just talking, and I think it's been at least four years since the
last time we've talked about this. And the world is, of course, changing so much in technology and
Python and robotics as well. So I'm really excited to have you on the show to talk about that.
Yeah, it's my pleasure. I think that is, was the time to start, to continue talking about robotics
in Python. Yeah.
Absolutely. Absolutely. Now, before we get to that, let's start with your personal story. How'd you get
into programming in Python?
Well, I started programming in Python when I was doing my PhD, but there was just kind of,
you know, for only for making this small experiment work. So it was actually, it was not programming
Python, just copy pasting.
And what was your PhD in?
It's in artificial intelligence. I was using neural networks to move robots,
to make them learn how to move and so on.
Super cool. Okay.
That was just the beginning. But then after that, then I started working to a company that
is called Power Robotics about, we were building their humanoid robots. And then there is where I
started to program more things in Python, especially when we started to use ROS, the robot operating
system. So at that point in time, because ROS provides you this interface with Python,
and it was quite useful. So that's when I really started to program in Python.
Sure. What were you programming before you started using Python significantly?
Oh, and C++.
C++.
Basically C++, yeah.
It's for the company in robotics. C++ is very important because usually you need to have
very fast products. So, I mean, your robot has to deliver very fast, for example, let's say,
face recognition, a speech recognition, control of the movement. So that requires as much as
possible. And for that, then it's C++.
Yeah, absolutely. You think about the performance of Python, and I think it's a really interesting
story because pure Python, the performance is not amazing. But a lot of times what you're doing
with Python is either you're talking to some package that has like a lot of the behaviors
in C or C++, or you're talking to other systems that themselves are running in C or some other
language like that, like a database or whatever. All right. So I do think it's really interesting.
Do you see people mixing Python and C++ or even things like Cython?
In robotics?
Yeah, yeah. In robotics.
Definitely. Especially if you are using ROS. So with ROS, that is perfectly created. This
integration, you can have slow nodes, for example, that are like a kind of behavior changing nodes
or changing the behavior of the robot based on some pattern recognition or something. So the pattern
recognition system will run in C++ because it needs to move very fast. But this behavior system
doesn't need to be to go to the millisecond, you know, it could be half a second in order to change
the behavior. So that could be running in Python. And then it simplifies a lot your work and your
maintenance of the code.
Absolutely. And even controlling stuff, probably, right? Like if I'm going to orchestrate,
hey, C++ layer, get this image, tell me whether you recognize a thing, and then let me decide in Python
what to do and kind of orchestrate the lower levels. I think that might also be common. Yeah,
exactly. That's exactly the case. That what you mentioned is exactly the case. And by using ROS,
you don't actually care what one program is written in another, they can talk transparently. So they don't
know if the other one is written, and they interchange the information transparently.
Yeah, that sounds really cool. We're going to dig into more of that for sure. But let's just really quickly tell folks what you do
day to day so they know your perspective, where you're coming from, your experience.
Okay, so I was working on that company, Park Robotics, for building the humanoid robots. But then I decided to build my own
startup. It's about developing programs for robots based on ROS. So we have a platform online
where you can develop those programs, create your programs in ROS, either C++ or Python,
and then you test on the same platform by using simulations of the actual real robots. So you've
already provided this, so the integration is very, very simple. You don't need to install anything in
your computer and you operate directly with the web browser. You create the programs there with the
environment that we provide and you test it on the simulation. And once you have this running,
then you can switch the code into, you can deploy the code into the real robot. Actually, you can test,
you can switch your code running from the simulation and then now let's click and switch to the real
robot until everything works perfectly.
That sounds like a really fun job actually to be working on. What's the name of the company? How
do people find this place?
Okay. Well, our company is called The Construct. So many people ask us, why is this name? So
basically, The Construct, we wanted to build this place where robots can learn because there is a
simulated world where they can play and they can try and so on. And then that's a construct concept that is
in the movie of The Matrix. You know, The Matrix, when they get in, the world is built by the construct.
And actually, our logo is one of the sofas of the chairs where Morpheus is explaining to the Neo that,
hey, that's the construct and so on.
The famous red pill, blue pill scene.
Yeah, that chair. Exactly.
Oh, cool. Yeah. I see it now. And it's the constructsim.com. I'll be sure to link to it in the show notes for
people. That's really cool. Yeah. So that sounds like a really fun project to be working on. And I
think this idea of having a simulation definitely has to democratize robotics, right?
It's one thing to be able to write a little code, to look at an image and do something. It's a whole
nother to put a humanoid creature together and do that.
Yes, exactly. And that's a problem for the people who want to be a developer. Most of the audience of
your podcast are developers. They're people that they are interested in developing programs. But what I
found is that they usually are not interested in hardware issues. Usually. That's why they decided to
become software developers in the first place. So that makes perfect sense. But there is a lack,
there is a huge lack of developers in robotics. So at present, it's just us, the roboticists,
that we are creating the programs. But I mean, the quality of that, I think it could be hugely
improved if we have the help of real developers. And then the problem is this hardware thing,
you know, and interacting. So with the simulations, we can provide this environment where the developers
don't have to deal with the hardware. They test the programs, the simulation in the same way as
developing applications for an iPhone. You can use those simulators, you know?
So you said I could go to my web browser and like actually code up a simulation there.
Is that in Python? Or is that in C++? And what's the experience like?
Okay, so you have a typical IDE, so an integrated development environment, and typical that you have
autocomplete and so on. And then you can program. So you create the control programs, the programs that
make the robot understand the sentences or decide which direction to move or actually move the robot.
Everything that could be written in Python or C++. But then there's the simulation itself,
the simulation itself. In case that you don't want to use the ones that we provide,
you can create your own. Of course, we use a program, an engine for simulation that is called
gazebo. That is open source. So anybody can download it also. And then you have to create a simulation for
that engine. And that is created by using format that is called URDF. That is basically an XML file.
Cool. So you can create your own little world. What kind of simulations do you provide? Like,
what kind of robots could I make? Could I do self-driving cars, humanoid things, delivery robots?
You have all types of robots. We have even humanoid robots, human-sized humanoid robots,
including the controllers for walking. So you don't have to make that robot work because it's already
provided, all the controllers. You have drones, you have cars. In order to make self-driving,
you have to build a program. Okay. And then we have what is called mobile manipulators. The mobile
manipulators are robots that are intended to be in the warehouses, for example. And let's imagine,
an Amazon warehouse. And then this robot has to be able to move on that warehouse to go to the
shelf that is where is the product and then grab the product. So that's a mobile because it moves,
a manipulator because it can manipulate the objects. Right. It's got an arm or something. Yeah.
They do exist, the robots, but the problem is the software. Again, so the problem is the software. So
the hardware is there. You can buy these kinds of robots, but they are not able to grab the thing.
And it's a problem of software.
Yeah. Well, it sounds like you're solving a really interesting problem. Now, before we get into the
topic more broadly, I just want to talk about really quickly, you also have a podcast that people might be
familiar with called the Ross Developers Podcast. And I'll link to that as well. You know, I just tell
people who maybe want to listen to a whole bunch of stuff about Ross as well after this show about your
podcast. Yes, yes, definitely. So in this podcast, what we do is to interview people that are experts
in Ross and especially about how to program robots with Ross. And then they explain to us how you can do
this, how they have done to create, make a robot, create a map. So they teach which packages they
have used, where to download the code already there. And we try to have fun also there.
Yeah. It sounds like a good show. I enjoyed listening to an episode or two. Now let's just talk real
broadly. When I think about the Python developer space, at least, maybe I have this wrong, but I see it
broken up into a couple of areas. I see there's a big chunk of web developers writing Flask, Django,
Pyramid apps, talking to databases, worrying about scalability, uptime, Docker, et cetera.
There's another significant group doing data science with NumPy, Pandas, Jupyter, Lab, et cetera. And
they're doing their thing. And then I see the world is kind of like other. And that other is super,
super diverse, right? It could be physicists, it could be biologists, it could be financial folk,
right? DevOps. There's just so many things. So I guess one of the areas that, you know,
seems really interesting is this area of becoming a robotics developer. So is this like a growing area
that people might look into? Is this a popular area for Python? It sounds like it is. What's the story
around there? Yes, definitely. So I think that becoming a robotics developer is now the moment
to start thinking about it. It's I think of robotics developers, like when we were thinking about data
scientists, some years ago, let's say 10 years ago. Yeah, like 2011, 2012, 2013, when they were all sort of
switching to into Python and more programming oriented stuff rather than say, or something that's more
statistical based, right? Yes, or deep learning. Also, in deep learning, 10 years ago, there were
just a few of them. And now it's completely full. It's feel, sorry, it's completely filled of people,
everybody's doing data scientists. And then now the situation for becoming a robotics developer is a very
good one. Because as I mentioned, there are just a few people. And also, mainly, we are roboticists,
mainly of the people is just roboticists, or very hardware oriented people. And then if you are a
developer, you have a chance there. Because you know the skills better than anyone. And that is
programming. And the tools sound like they're tools that people would maybe already be familiar with,
or very similar to stuff they've already done. And it's probably not a huge field, you know, millions and
millions of people building robots necessarily in terms of developers. But it's probably good jobs,
interesting jobs, you know, you probably get to move around and do cool stuff and not just sit in a
cubicle, right? And work on like optimizing marketing conversions or whatever.
The thing is that this robotics market is exploding. And actually, I have here some provision,
some forecasting for 2024, for example, is now a present, specifically only for development with Ross,
it's the market is about 312 millions, 312 millions, but it is expected in 2024 to be about 500
millions, the market. So it's almost doubling, almost doubling, yeah, yeah. And then I can tell you,
for example, that recently, Amazon has entered last year, Amazon entered into the game, and they have
the robotics division. And NVIDIA also entered into the game some years ago, and Google is going to
enter this year. And Microsoft also, Microsoft has entered last year, also presenting their own Ross
version in Windows. So very, very big players are getting into there. And you know that big players,
they don't go there just because they are bored, it's because they are feeling that there is
something there to get.
All right, they want to ride the wave.
Yes.
Yeah.
That's why I think it's a very good possibility. Also, there is a very famous conference, it's called
the RossCon, is the Ross Conference official. And it's actually, it's in two months, it's going to be
the next edition. And there, all the companies that show, we are hiring, we are hiring, we are hiring,
we are hiring. There is a demand for software developers in robotics.
This portion of Talk Python to me is brought to you by Linode. Are you looking for hosting
that's fast, simple, and incredibly affordable? Well, look past that bookstore and check out
Linode at talkpython.fm/Linode. That's L-I-N-O-D-E. Plans start at just $5 a month for
a dedicated server with a gig of RAM. They have 10 data centers across the globe. So no matter
where you are or where your users are, there's a data center for you. Whether you want to run
a Python web app, host a private Git server, or just a file server, you'll get native SSDs
on all the machines, a newly upgraded 200 gigabit network, 24 seven friendly support, even on
holidays, and a seven day money back guarantee. Need a little help with your infrastructure?
They even offer professional services to help you with architecture, migrations and more.
Do you want a dedicated server for free for the next four months? Just visit talkpython.fm
slash Linode. I think a lot of people grew up dreaming of working with robots and all these
things. And then, you know, you, you realize that it's hard. The hardware is tricky. And, you know,
maybe the jobs aren't there, but it's, it sounds like maybe that's becoming a reality. That's cool.
Yes, definitely. And the main problem that they can face maybe is about dealing with the hardware.
But as I mentioned before, then dealing with hardware can be kind of substitute by using
the simulation. So you can replace a lot of work with hardware by using the simulation. And then
also by using ROS API. That's the combination of the both things.
Yeah. So tell us a little bit more about that. I mean, your company has this virtual world sort of
integrated online space for doing these. Does ROS itself have like capabilities for running in a
simulation mode or something like that? Yes. Together with ROS, when you install ROS, it's open source.
So anybody, listeners there, you can download right now if you want. And together with ROS,
you are installing the official simulator that is called Gazebo, like a Gazebo. Yeah.
And then this allows you to simulate your robot. Actually, there are a lot of simulations already there.
And then you can download also in your computer and execute. Then having said that, good luck.
Okay. Because well, so you download, you know what happens. You download that then it shows this effect
that I call it works on my machine, you know? Yeah. Have you seen the certification program?
There's an official, it works on my machine. Okay. No.
It's really hilarious. I'll definitely put a link in the show. So there's somebody made a joke about this
at some point and did a blog post. And so let's see, to officially become certified is you compile
your application, assuming it's a compile language. Getting the latest from recent code changes out of
source control is totally optional. You launch the application or website. You cause one code path
to be executed. The preferred way to do this is with ad hoc testing. admitting the step is fine.
If, five lines have changed and then you check in your code and now you're, you're certified to get
the badge. I'll open it. Certified.
Isn't that great. You get it, the simulation set up on your machine and then, you know, it's,
it's tricky to, to deploy this or share it. Is that what you're saying?
Yes. It's tricky because there are a lot of versions. The versions are changing constantly.
And also there are a lot of requirements from other libraries that they are changing also again.
So you get this effect, you know, that multiplies. And of course, I'm not telling that developers,
the listeners of the podcast, they cannot do it. No, I'm not telling this. Okay. I'm talking about
efficiency. So many of the people we talk to about our product, they say, no, so why would I pay you
if I can do it? And it's completely fair because they can do it. But most of our clients, they can
also do it. It's not that they cannot, but they don't want to. Yeah. That's the, yeah, it's,
they want to focus on the core problem they're trying to solve and not all the stuff around it.
Right. Exactly. Okay, cool.
It's another point here is about working into teams or, or for example, where system is very useful and
used actually by, for example, by universities, because the teacher can create a demonstration,
simulation with a code that makes the robot grasp something. And then it can share with the older
students, 200, 300, 1000, whatever. It will work in the exact, exact same way as for the teacher. So
the teacher knows that this is going to work for this guy and they don't have to prepare anything.
Yeah. It's not like, well, you've got an old version of macOS and it has the wrong dependency here.
So it won't work or you don't have the right permissions or all that stuff. I mean,
it sounds a little bit like the problem that Jupyter Notebooks solve for teaching data science and other
types of courses where you can just say, here's a URL. You just go use this and it's all set up just the
way we need it to be. Right. Exactly. Actually in our product, we use Jupyter Notebooks for the
documentation and demonstration. I will send you one example. When we call a ROSJ. The ROSJ is a ROS project,
which contains everything. It contains the simulation, the code, the documentation and
data sets. And so it's a simple link. And then I will send you one example to you so you can have a
look and maybe share with the audience. Yeah. Yeah. I'll put it in the show notes.
You will see that it opens the Jupyter Notebook and then it says the Jupyter Notebook, oh, do this. And
then the robot will do that. And then you can see that it actually works. That sounds really fun. Yeah.
Definitely share that with everyone. That'll be fun to play with. Now let's talk a little bit about the
different types of robots. So I have a robot in my house and it looks about the size of a plate and it
drives around and it gets stuck in my furniture. When it's not stuck in my furniture, it's trying to vacuum up
stuff around the house. Okay. So we have vacuums and actually those are pretty cool. Even some of
those like Roomba and stuff, there's some that are programmable, right? Many things to say about
this. You can stop me anytime, okay? Because I have a lot of things to say. So first thing I would like
to say is vacuums is, I would say that is the only real robotics business that has been successful.
I think, I don't know the numbers, okay, of all the robotics companies, but I mean in the case of
service robots. So the vacuum cleaner is called a service robot. Consumer level robots, right? Yeah.
Exactly. So those are robots that are working. They are doing their work in environments where there is
people around. They have to figure out how to manage changes in the environment, not industrial robots.
Okay. I'm not talking about those, but about service robots. I think that the vacuum cleaners,
the iRobot or any other brand, those are the only ones, robotic companies that have been successful and
made a business. The rest of the ones, they are living on investment, you know, on rounds of VCs and so on.
Yeah. It's all future valuation and VC money and hope.
Yeah. And hope. Exactly. So that's the first thing I wanted to say about the vacuum cleaners,
because they deserve all the respect.
They actually are a success story, right? In a sense.
Exactly. A success story. And then the other thing you mentioned about programming,
the version of iRobot is called Roomba. There is a version, I don't remember exactly its name,
but it's programmable. So you can programmable. Then some of the guys of the developers of the
ROS, some of the guys decided to use it as the base for creating a simple robot that all the ROS
students, they can use it and they can buy for a low amount of time and then start performing tests
with ROS and so on. It's called the Tartelbot. So the Tartelbot in the inside has a Roomba,
a programmable Roomba that is called, oh yeah, I remember. It's called Kabuki. Kabuki.
Yeah. Kabuki. Okay. That's pretty awesome. They should just leave it vacuuming just so wherever
the robot works, it's just super clean. I had no idea they did that. That's really interesting.
I knew you could program. I didn't know that it was being like repurposed for this, these other areas.
Another area where I think robotics, I don't even, you tell me if this is the right word,
but certainly machines operating autonomously in the world seems to have taken hold somewhat,
maybe not mainstream commercial success, but kind of crazy success for how complicated it is,
is cars, right? Like Tesla, even just the Teslas are unbelievable in how that they can interact with
their environment. And then you've got cruise automation, you've got Google, you've got NVIDIA,
Uber actually building truly autonomous cars. But, you know, even going for a ride in a Tesla on a city
street is a very weird experience.
It's amazing, but they still haven't reached the level five of autonomy. So it means that they can't go by the,
yeah, not yet, not yet. And it's going to be very difficult to reach that. They are expected to release very,
very soon this system. But personally, I don't believe it that it's going to be very soon because it's very,
very complex. It's very complex here.
The edge cases seem so hard, right? You get 95% perfect, but the consequence of failure is so high.
Yeah.
If you run over a person one every hundred thousand times, that's still a really big problem.
Exactly. That is a point. That is a point. For the main thing, it works. It works. So I have been
with some people from other companies that they are building this and they gave me a ride and the
experience is amazing. So it's in a very good condition, but for all the conditions,
for all the types of people, the types of clothes, the types of materials, that's not working. It's not
not working yet.
Yeah. Yeah. Yeah. Not yet. I'll share a really quick story with folks. We rented for four or five days,
a model three Tesla, and we were driving and my wife was, I rented it for my wife to try it out. And
we were driving down the street and she really wanted to try the self-driving. So she turned it
on and it was fine, but it got to a place where the stripes on the road were faded or it's the Tesla
became uncertain of the environment. And it told her to put her hands on the wheel and take control of it
because it needed her to be ready because it was getting into this uncertainty zone. And she puts her
hands near it, but not physically touching the wheel. So it didn't know she was holding on or ready to
hold on. And it got really mad. It told her to do it again. And then after a couple of times of saying,
do this now, it's just said no more self-driving for you. And it pulled over and stopped.
It just said, if you're not going to take the wheel, we're done self-driving, no more self-driving
this entire drive until you shut the car off for a while, then you can self-drive again.
No way.
Isn't that funny? She's like,
it got mad to me and we won't drive anymore. I'm like, we said to hang on. She's like,
I was hanging on. Like you were almost hanging on. It didn't know.
So now we are going to have fights with a partner and with a car.
Exactly. The car got mad at me. So I, you know, I mean, these are the ways they can deal with it
now, but it's going to be real. I do think though, that cars have come surprisingly far in robotics.
As far as I thought, I thought this problem is just too hard for cars. They were actually quite
close to this level five. They're not there for the problems we already talked about, but they're way
farther than I would have guessed 10 years ago.
Yeah. Yeah. Yes. That's right. That also was a surprise for all of us. So it was like,
there was nothing. And then suddenly, boom, then it started the development. I think that it was,
everything started with the DARPA challenge. I don't remember exactly the name. That was one of the
first. They have to cross a desert. And then the first edition, there was nobody. And the second
edition, there was the team from Sebastian Thrun, who is the founder of Udacity. Sebastian Thrun.
And then he made it. And then on the next one, there's so many other cars. They did it. But that's when it started. Then from that point, that's it. Then they created a company. This company was bought by Google. And then when Google started to do that, then it's kind of like it explode. It explode.
So now there's companies, drivers, driverless cars, companies, many, many around the world.
It's really amazing. There's a super good documentary by Nova, which is this like public broadcasting
organization in the US or series called The Great Robot Race. And I'll link to it. And it takes you,
it's like an hour and a half deep techie dive into this DARPA challenge that you talked about. And it's really amazing.
Okay. Taking note to watch it.
It's super cool. I'll put a link in the show notes.
This portion of Talk Python to Me is brought to you by Tidelift. Tidelift is the first managed open source subscription,
giving you commercial support and maintenance for the open source dependencies you use to build your applications.
And with Tidelift, you not only get more dependable software, but you pay the maintainers of the exact packages you're using,
which means your software will keep getting better. The Tidelift subscription covers millions of open source projects
across Python, JavaScript, Java, PHP, Ruby, .NET, and more.
And the subscription includes security updates, licensing, verification, and indemnification,
maintenance and code improvements, package selection and version guidance, roadmap input,
and tooling and cloud integration. The bottom line is you get the capabilities you'd expect and require
from commercial software. But now for all the key open source software you depend upon,
just visit talkpython.fm/Tidelift to get started today.
So let's bring it back to Python a little bit. Now you talked earlier,
about this back and forth between Python and C++. And sometimes maybe you prototype in Python and then write in C++,
or maybe there's an orchestration or something. I don't know, where would you get started?
If I wanted to get started as a developer in robotics, would I start with Python?
Would I be limited by doing that? What's the story there?
This is my personal opinion based on my experience.
So besides this development environment, we teach people about how to become a robotics developer.
In our academy, that is also an online academy, uses the same engine as the development system.
So it's everything online, you see simulations of robots, and then you learn.
So what we teach there is that if you don't know anything about C++ or Python,
then you should start with Python.
So you start learning Python, and then you start learning ROS with Python.
So how to program in ROS by using Python.
If you know Python already, then okay, then still start by learning ROS with Python.
And the only option for starting with C++ is because, I don't know, it's your only option for getting a job.
You are very, very stressed, and that's the only option that you have to leave.
But if you want to optimize your path, then start always by learning Python.
Then ROS with Python.
And once you know the basics of ROS with Python,
then you can decide whether to go back and learn ROS with C++.
Again, and why is that?
Because ROS with Python is hiding, not many, but a bunch of details.
Important details, yeah.
Yeah, very complex to understand when you are new there.
So it's easier for you to understand really how ROS works
and how you make a robot based on ROS to do a task, to finish a task.
So you can master that with Python a lot faster.
Then in order to go back and relearn with C++, you have to reconsider
if you are going to dedicate yourself for working, programming robots for industry, for companies,
or you are going to dedicate to program robots for research.
That is also a big space where developers can dedicate.
It's a big space where you are going to be able to do a job.
So you have to learn new things or discover new things with robotics.
In that case, Python is a lot better because in this case, what is vital is to present the results as fast as possible.
And for that, I mean, Python is the winner.
It's always the winner in that case.
So even if execution is slower, it's good enough to record the video and present the paper.
And that's what is required in research.
Yeah, absolutely.
That's really interesting.
When you think about performance between Python and C++, if you're going to run some code just a couple of times or something,
and you factor in from the time I start working on the idea until I have the answer,
maybe C++ runs five times faster.
But it takes you a day in Python and a week in C++, right?
Which language is faster, right?
Like that's an interesting question as well.
Exactly.
Yeah.
Python, definitely.
Yeah, for sure.
So one of the dramas, challenges, I guess, success stories coming up, but it's been a long journey these days,
is legacy Python versus modern Python or Python 2 versus Python 3, right?
What's the Python 2, 3 story around robotics?
It's a pain.
I mean, so I'm talking here always about programming robots with ROS.
Okay, so what's the problem with ROS?
That ROS works with Python 2.7.
Up to now, the latest version of ROS still works with 2.7.
Then ROS has started 10 years ago.
And so now it has matured for 10 years.
But it became clear that this structure of the current ROS was not going to be sufficient for real robot applications,
for companies to adopt ROS into their products massively.
Because of that, they decided, the organizing committee of ROS decided to create a new version of ROS that is called ROS 2.
And then when they decided this, they started like three or four years ago to develop, to start development,
and they decided to do it in Python 3.7.
So if you are going to jump into ROS now, then if you are going to jump into ROS 2, then you are saved.
Okay, because you are going to learn Python.
You are going to use Python 3.7.
So it's a future.
It's everything.
Well, yeah.
You can use all the new libraries, TensorFlow, NumPy, whatever, the latest version of all the good things.
Even there are other libraries that we use in robotics, like the ones created by OpenAI.
OpenAI, you know about that company?
Yeah, tell us about it.
Okay.
It actually was founded by Elon Musk, the founder of Tesla.
So the CEO of Tesla.
And they are concentrated on creating very good reinforcement learning algorithms using Python.
They use Python only.
And they use Python 3, of course.
So that's very cool because we use those.
Then you can use it in ROS 2.
But if you are going to jump into ROS 1 because it's the current standard,
so most of the places you are going to use ROS 1 yet,
then that's based on 2.7, Python 2.7.
And you're kind of stuck in that world, right?
Yes.
Well, the next version, the next distribution of ROS 1 that is going to appear in 2020,
it's going to be based on Python 3 already.
Okay.
Well, that's a pretty positive story.
That's going to be a festival.
I mean, it's going to be a big party among everyone because imagine everyone already changing their code
into that other version.
So it's going to be crazy.
Yeah, that'll be wild.
No, but that's really good.
Now, maybe there is some code.
I've prototyped in Python and it's working well, but I need to move it into production.
I want to put it onto a real robot.
Maybe that robot has limited computation power or whatever.
And I want to make it go faster.
What steps do I need to take?
Do I rewrite part of that code in C++?
Have people use Cython on parts of their Python code to make it go faster or other things like that?
What's the productizing my robot story?
I don't know about this Cy...
How do you call it?
Cython?
It's like CPython without the P.
So what you get to do is you get to take a small portion of Python, put type annotations on it,
and then compile it to native code as if it were C, through a C compiler.
And it goes many, many times faster.
So if you've got a Python program and there's some tight loop or some one module that's 200 lines long or something,
you need that to go fast.
You could hit that with Cython, rename it to...
I think it's CPY.
I forgot the extension.
But rename it.
I don't think that's right.
But anyway, you rename it to a different file and you hit it with CPython.
And then it just becomes like a C module that gets imported by your other Python code.
Okay.
So that's the first time that I heard about that.
So I cannot tell you what is the difference between that.
But usually what we do in those situations, in those situations is usually is first one, rewriting C++.
So that's the, I mean, that's a straight, rewriting C++.
Or another thing that is done is also to put a bigger computer.
So you put a more powerful computer in the robot and that's it.
If you cannot do that, also you can run in an external computer because ROS is how it is built.
It doesn't care in which computer you are running the different programs in ROS.
And they can communicate and transfer information transparently.
For them, it's like if they were in a single big computer.
So that's another option.
Like kind of a distributed computing environment type of thing.
Okay.
Is it common to have kind of microservice architecture where I've got a robot and it's doing stuff,
rather than it's making calls over the network to get more information or resolve information, things like this?
It's actually for products.
For robotics products, it's very, very common.
Because they want to ship into the hardware as less as possible.
And also they want to make you kind of trapped into their system.
So you need that.
But there is a very famous case.
Pay the $4.99 for the continuous service monthly, right?
Or whatever the price is.
Exactly.
There's a very famous case that just died a couple of months ago.
It's called Cosmo.
Cosmo Robot.
You know that robot?
No, I don't know this robot.
A small robot that you can have on your desktop.
It was amazing.
It looked like, you know, this movie about the robot of Disney.
Yes.
The kind of big, fluffy, rounded white.
Yeah.
I know.
Oh, man.
I forgot to.
That was a great show.
Hero 5 or something like this?
No, no.
No, I'm talking about that.
About this other movie that is a robot that stays on the planet.
It's cleaning all the mess.
Oh, yeah.
WALL-E.
Exactly.
WALL-E.
Exactly.
Also a great movie.
That one's a sad movie, actually.
Yeah.
Anyway, sorry.
Go ahead.
So it looked like WALL-E?
No, like the other one.
The character.
The female robot.
White.
So the face of this Cosmo, it was engineered by using graphic designers and developers of cartoons in this sense.
So it was a super cool robot.
It was.
But, unfortunately, it was not a success in business terms.
So they have to close the company.
And now this robot is useless.
So you cannot even use it because it requires the network in order to understand your vocal commands.
Oh, I see.
That's a problem.
Yeah.
Because once the company goes out, then the services die.
And if they lean on the services too much, then it becomes a useless chunk.
Exactly.
Yeah.
That's a bummer.
There is a famous, even more famous example that is called Jibo.
Do you know Jibo?
Did you hear about Jibo?
No.
That was first site of the Time magazine.
This robot was there.
And it was closed last year, the company.
And then it was also the same problem.
It was the same problem because it was not successful in terms of business.
And so they couldn't maintain.
And so everybody that bought this, they can just throw it out because it's useless now.
Oh, no.
That's such a bummer.
Yeah.
I've had that happen.
I had a Pebble smartwatch.
It was beautiful.
But they went out of business.
And, you know, like almost everything about it.
It's still kind of cool, but it's way less than it was because the services are gone.
So we're talking about putting some sort of computation unit on these little robots.
Maybe talk about what those computers look like, what those operating systems look like.
Because we could have a very small little robot, you know, the size of your hand.
And maybe it has MicroPython on a $5 chip in it.
Maybe we have a robot that's like a vacuum and it's got, I don't know, a Raspberry Pi running Linux.
Or maybe we have a car that's got, you know, a core i9 CPU that's like, you know, the top of the line Intel CPU or something like.
What's the spectrum of computing you put into these robots and operating systems and all that?
Yeah, exactly what you mentioned.
So we can do a small robot that only require maybe even an Arduino.
Only with Arduino, you can make it work.
You can make the robot perform the task that you wanted.
Then you have a Raspberry Pi and the like.
Then you have also the computer, the typical PC computer.
For example, there was one very famous that is called the Intel NUC.
That is a square, like a cube is small like this.
Now the ones that are getting a lot of traction and a very big success are the Jetson from NVIDIA.
Because they include some GPUs and then they allow you to do some deep learning inside the boards already there.
Right.
So in case that you want to use the data from a point cloud device.
A point cloud is, for example, a Kinect device.
So you can recognize objects or people.
I hadn't heard of this Jetson thing.
This is really cool.
And it's...
Yeah.
NVIDIA Jetson.
They're very small and they look like they don't even have fans.
They just have really big heat sinks.
I don't know.
Yes.
How big...
What is it?
Like 10 centimeters by 10 centimeters?
Something like that?
Maybe?
Yeah, yeah, yeah.
So it's very, very small.
Yeah.
A hundred dollars for Jetson Nano.
That's pretty awesome.
Yes.
And the power that they have is very cool.
There is the Jetson Nano.
And then there is another version.
It's the Jetson whatever.
And then there is another one that is more powerful.
That is called the Xavier.
Yeah.
Xavier.
And...
And it's even more powerful.
These are pretty...
These are pretty intense.
They've got some really cool ones.
Yeah.
And some of you have the GPU looking things.
Yes.
So that's another thing.
Maybe if you need more power, if you have...
Maybe you want to...
You talked about some of the machine learning stuff.
And of course, your background is in this area as well.
GPUs probably play an important role for certain types of robots, I would guess.
Yes, exactly.
Especially, for example, it makes sense in the image recognition.
Whenever you need your robot to recognize where it is, the location or the people or the objects by using a camera, then that's one of the cases.
Also in the speech recognition.
Also.
And then also, they use a lot the GPU for training, for launching reinforcement learning algorithms that make the robot learn.
But those usually are used in the simulation.
Okay.
Because in the real robot, it's very difficult to train the robot.
Because in order to train a robot, you need to put it into certain conditions, then make them take some actions.
And when they fail, you say, hey, wrong.
And then you have to put it back.
Yes.
It's like teaching a kid or something.
Yeah.
Teaching a child.
Yeah.
I see.
A child.
Exactly.
And then you say, yeah, very good.
Very good.
And then the robot gets excited.
Oh, yeah.
Super cool.
And then you have to have somebody to put it back to the original position.
And also, all the environment get started.
So, that's not a good approach to do it with a real robot.
And usually, this is done in the simulator.
And once you are in the realm of the simulator, you have the cloud computers that they have whatever you want.
Related to the operating systems that we use there, usually, we install Linux, Ubuntu specifically.
And then on top of that is where we install ROS.
Because ROS, even if it stands for robot operating system, it's not an operating system.
It's a framework for programming inside an Ubuntu system.
I see.
So, maybe it's an operating system for the robot, but it needs its own computational operating system, which is Linux.
Yeah?
Exactly.
That's it.
Okay.
That's it.
And now, Microsoft has started to create a version of ROS for Windows also.
So, you can install Windows instead of Ubuntu.
But it's still not finished.
So, it's still very early stage.
Yeah.
That'll probably bring in a lot more developers as well, though.
You know, Windows is still a big platform that people develop on in a lot of places.
So, having ROS there sounds like a good idea.
Yeah.
They are putting a lot of effort into that.
Cool.
Yes.
I see robotics as an interesting way to bring young people into programming as well, right?
Like, as you get older, you're willing to just plow through the things.
Okay.
I have to learn the for loop.
And then I learn the class.
And I learn the functions.
And eventually, I'll do something interesting.
But kids, they don't care.
They're like, this is boring.
I'm out of here after five minutes, right?
But if they could see a robot.
You know, my daughter is in sixth grade, my youngest one.
And she had one of her electives in the morning is robotics.
Actually, she just started this week.
I'm not really sure what they're doing.
But, you know, that's, it's really, I think, a good way to teach kids.
And I think that might be the Microsoft angle as well, to some degree.
Okay.
That's strange for me.
From my point of view of a roboticist, for me, I mean, it's very clear to use Linux.
I mean, I would never go to Windows to program robots.
For me, it's like, what?
Yeah, of course.
I mean, all this big thing that you don't need, that you don't need, because you only need to have the terminal and the commands there.
And then everything works.
You have full control of everything.
Well, I just, I think there's these environments where, you know, kids are already sitting in front of a Windows PC, and they're going to use it.
Or, you know, they're also, Microsoft's also working on, like, Edge IoT computing stuff.
And I think it kind of fits into that realm.
And I think that even they have some embedded Linux stuff that they're doing over there, which is kind of ironic and funny.
Okay.
I didn't know about that.
Can't remember exactly.
I think, I can't remember what, it's like, something sphere.
It's at the edge of my knowledge.
I should stop talking about it.
But I do believe they had some embedded Linux somewhere.
If I find it, I'll put a link in the show notes afterwards.
Oh, you mean Red Hat?
No, no, not Red Hat.
There's something from...
Red Hat?
They bought the Red Hat version, isn't it?
Didn't they?
It's called Azure Sphere.
That's what it is.
Yeah.
So it's Azure Sphere.
And it's basically a hardened...
I think it's Linux.
Let me see.
I'm not sure.
But it's a hardened IoT device that basically has automatic over-the-air updates and a whole bunch of various security stuff and so on.
But yeah, I got to look into it to make sure that it's Linux.
But I think so.
Anyway, the world is getting confusing, right?
Like, it didn't used to look like that.
Yes.
It's getting confused.
And related to what you mentioned about for the kids, yes, definitely.
The more graphical, the better.
So there is this...
That is called...
With programming for robots using blocks.
That is called Blockly.
Yeah.
Okay.
Blockly is one of them.
But this is based on another one made by MIT.
Basically, it's programming robots...
Scratch, maybe?
Blocks.
Scratch.
Yeah, that's it.
Scratch.
Okay.
So there exists also a version of Scratch in ROS.
So actually, you can...
If you are interested, Andrin.
Oh, okay.
So you could get started really early.
I see.
Okay.
That's super cool.
Exactly.
So for that, in that case, for kids and for people with lower level of knowledge in terms
of mathematics, physics...
Maybe they're not typing really well yet or something like that.
Yeah.
Or programming a skill.
Yeah, exactly.
So that makes sense.
Yeah, very cool.
All right.
Just to wrap up this Linux thing.
Azure Sphere is a Linux-based operating system created by Microsoft for the Internet of Things
applications.
It's the first time Microsoft has publicly released an operating system running the Linux
kernel.
All right.
So very interesting.
The world is confusing and very mixed.
Yeah.
It's a fun time.
All right.
So let's wrap up this conversation, Ricardo, by talking about how people can learn ROS and
programming robots with Python.
We kicked it off by saying it's a good time to be a robot developer.
Python's a good language to do it.
What do people want to get into it?
What do they do?
In that case, there are several ways of learning.
And then that depends.
It's always the same.
You want to invest more time or more money.
So that's the situation.
So let me give you the options that I usually provide.
The one is going to the official wiki of ROS.
So ROS is a present being created and developed by now is a company.
It's called Open Robotics.
And they release it for free.
It's open source.
You can do whatever you want with it.
And then at the same time, they are releasing a wiki with some tutorials with a lot of information
there about how to learn ROS.
So that's the official wiki of ROS.
That would be the first place.
It's a little bit dry.
As a first step, it's a little bit dry.
But I learned by using this.
So I learned using this because there was nothing else at that time.
Then the other option, yeah, so we begin very early.
Coming early, you got to just go through the docs and figure it out.
But I have to say that for the time, those documents were amazing.
The documentation, they put a lot of effort into the documentation because they knew that
that was a very good point to attract people.
So at that time, that was like, wow, that's amazing.
I mean, it's dry, but it's amazing.
Now, some years afterwards, so it's a little bit more complicated.
But you have other options.
For example, books.
There are a lot of books.
In Amazon, if you go, you will see a lot of books.
We have our own series of books that teach the basics of ROS or how to use it for navigation.
But there are many, many other books already available.
Use the books.
They're very nice.
Then another way is to use the YouTube videos.
So in YouTube, you will find a lot of videos.
A lot of videos.
We also provide these videos in our channel of our company.
And actually, we do a ROS live class on YouTube every Tuesday at 6 CET.
Oh, cool.
Yeah, you just cover some.
It's like a live stream.
You just cover something different each time.
And people can just drop in.
Yes, it's a different subject.
It's a different particular, very concrete problem.
Something you can do in an hour, right?
Exactly.
What did you do last time?
Yeah.
So what is interesting is that the participants that connect, they are programming at the same
time with me.
So I provide to them on this live class with a ROSJECT that they get directly into the
class.
And then they start automatically into the browser with all the environment, the simulations
and the instructions.
So we are doing together.
So I'm explaining, do this.
You see here, do that.
Do that.
And then the guys, they are doing and then asking questions and so on.
So and then last time, what we did was about making several robots create a map of an environment.
So several robots, not only one robot, but several, they were moving around and creating the map.
That's a concept in robotics.
Yeah, that's super cool.
Well, that is another of the options using the YouTube videos.
And I'm telling you about those.
Of course, I would say, I will tell you that you go to our academy.
It's the Robot Ignite Academy, but that's a paying one.
So the previous one, the official wiki is for free.
The books is the price of the books.
The YouTube videos are for free.
So everything is free.
You've got to watch an ad maybe, but other than that, it's free.
Oh, yeah.
Because of YouTube, right?
Right, exactly.
That's just YouTube itself.
Yeah, yeah, exactly.
That is right.
Yeah, then you have your academy.
Yeah, the academy is online and then it's not based on videos.
It's based on practice.
So you have to practice and do the things because whatever you read there, if you don't practice, it's not useful at all.
And especially in RAWs, you need to see when you do this, what the robot does.
And this is the system that we have implemented in our platform, in our academy.
It's a system that where you get the instruction.
So now you are learning this, then very quickly do this exercise.
So you practice and you do this.
So that's more practice focus, but it has a cost.
It has a cost.
And I think that those are the main options that they have for this.
Of course, you have conferences.
Sure.
Yeah.
Around the world.
Summer schools.
Yeah.
Podcasts.
Now, that's more awareness, I would say, not total straight on learning.
It sounds like you can use the simulators, either your online one or the Gazebo one or something like that.
And you don't necessarily have to start with hardware.
Is that right?
Exactly.
That is right.
Actually, our online simulator is Gazebo.
So we have created a version of Gazebo.
In the inside, in our server, is Gazebo running?
And then we have a front end in web development for that.
So it's exactly the same thing that you will run in your own computer.
And then that makes you be separated from the hardware.
That's a great way to learn.
Okay.
A lot of options, it sounds like, and a lot of interesting possibilities out there.
So cool.
Well, thanks for sharing that.
Now, before you get out of here, I have to ask you the final two questions.
If you're going to write some robotics code in Python, what editors do you use?
What I used to use before it was Sublime.
Sublime was very good.
Also, I used Qt Creator.
But Qt Creator was more for C++.
And then I was doing kind of a hack for Python.
But then Sublime was the best.
And now at present, I'm using a web editor IDE, which is called Taya or Taya.
I don't know how to pronounce it.
Yeah, something like that.
And that's the one that I'm using.
Very, very cool.
It has also complete.
You can jump into the functions.
You can see the documentation.
And so it's very cool.
Oh, very interesting.
All right.
I'll put that in the show notes so people can check that out.
That's interesting.
It's open source.
You can download, install in your computer or in your web server and program into a server.
It's very cool.
Nice.
And then notable PyPI packages.
You know, what's the important stuff that people should know in this world?
I mentioned already, the open AI reinforcement learning algorithms.
That's very cool.
The gym system is a gym system for learning about reinforcement learning, not only for robotics, but for making, for example, programs play Atari games.
That's cool.
Use games as their world.
Exactly.
And then they learn to play those games.
The Pac-Man, the Tetris.
So that's OpenAI gym.
Okay.
OpenAI gym.
Nice.
And then another one that I like very much is Scikit.
Scikit is a set of Python libraries for many, many, many different techniques of artificial intelligence, not only for reinforcement learning, but many others.
And supervised learning, supervised learning, and even genetic algorithm.
So I will recommend you those and some other two that are very commonly used in robotics are OpenCV, that probably all the people already know, and TensorFlow, of course, for deep learning.
Very cool.
Those are great.
OpenAI gym looks awesome.
I put a link to that as well.
That's a really nice option.
All right.
Ricardo, final call to action.
People want to become robotics developers.
What do you tell them?
So we need you because, I mean, we need programmers that can program really, really well.
And the robotics field is lacking this.
Actually, there is a very cool video.
It's a super cool video.
It's a video where a person is showing how a robot is an ARM-based robot is a mobile manipulator.
This robot is cleaning a room from all the mess.
So you can see that the robot is grasping all the books, putting there on the place, then taking all the clothes from the ground, putting it into a basket, taking the basket, bringing it there.
So you can see this speed plus 20 or something.
Okay.
Very slow.
But it can do everything, everything.
Then at the end, the guy of the video says, yeah, so I've shown you that this robot can do that.
But the thing that I didn't show you is that I was controlling the robot.
Ah.
So it was teleoperating the robot.
But what's the conclusion here?
The conclusion here is that the hardware is already there in order to have a robot that can clean the mess of a room.
The only important part that is missing is the software.
It's the head of the robot that makes it.
So that's why we need developers that can build those programs.
Awesome.
That's a problem.
Yeah.
Well, it sounds like a lot of interesting stuff to work on.
Thanks for sharing the story and giving us a look inside the robotics world.
My pleasure.
Really.
It was very fun.
As I mentioned to you, that's the first time that somebody has interviewed me on a podcast.
And it was an amazing experience.
Thank you very much, Michael.
You're welcome.
Thanks for being on the show.
This has been another episode of Talk Python to Me.
Our guest on this episode was Ricardo Telles.
And it's been brought to you by Linode and Tidelift.
Linode is your go-to hosting for whatever you're building with Python.
Get four months free at talkpython.fm/linode.
That's L-I-N-O-D-E.
If you run an open source project, Tidelift wants to help you get paid for keeping it going strong.
Just visit talkpython.fm/Tidelift, search for your package, and get started today.
Want to level up your Python?
If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
Or if you're looking for something more advanced, check out our new async course that digs into all the different types of async programming you can do in Python.
And of course, if you're interested in more than one of these, be sure to check out our Everything Bundle.
It's like a subscription that never expires.
Be sure to subscribe to the show.
Open your favorite podcatcher and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I'll see you next time.