Hi, so the next talk, the next talk will be by Julia and she's going to talk about programming
Rustu with Rust. Please give her a warm welcome, thank you everyone. Welcome to the talk
or the presentation about how to program Rustu with Rust, maybe it's a bit different topic
because we have seen in this bedroom, but let's see, so sorry, so first of all, um, who am I?
I'm a robotic consultant and I've been working as a robotic super engineer for five years.
I've been working in different developing custom applications for different startups, but last year I was invited to the robotics
developers day organized by the construct because about how to program Rustu with Rust, it was a kind of new topic and
not much people was talking about this, so that's also why I'm here. So first of all, what do you
want to see? First of all, what is Rustu? Maybe some of you are most practical developers than
robot developers, so, um, yes, we're going to see this, we're still, we're still on four robotics,
why it's, we are using Rustu for robotics and so on right now, um, we're going to see together
how to make a pollution as a subscriber application, third we're going to start with a pollution,
then we're going to get into the subscriber and then we're going to see both pollution as a subscriber
in the same note and then we're going to look through some conclusions to work. So first of all,
what do you first do? If you want to look, here you have a tag, if you want to, um, get familiar with
Rustu, Rustu, it's, it's a robotic operating system, it's a framework that mostly
robotics, um, like people use, it's an open source framework and it's maintained by the
open source robotics condition and also lots of institutes and people does and develops lots of
code for this framework. So it has lots of different tools that you can use, it has visualization,
perception, robot control, you can move servers, you can also get data from the sensors,
and look through, uh, look through your, um, like, um, you can look through your computer and also
it has hardware drivers, um, AI machine learning, the blabbering applications also has been developed
to be also compatible with Rustu. Um, also debugging, um, there is, you can, like, save
bugs and then retrieve them in the future. For example, the robot has done something
unexpectedly, so you can see that, or so there is simulation, you don't need to have a real robot
in order to be able to, um, develop, yeah, you don't need to have a robot, so you can just
simulation, so you can develop code, you don't need it to have, uh, like, a robot, a robot,
or so there is computer vision, open CVs, those enter it, there are two, uh, motion planning,
there can do task planners, and use in your robots, and communication, there are different
like protocols that has been developed to be used with Rustu. So Rustu is based on the
DTS, the data distribution system network, and here in, in this, um, program will not
talk about the client. So until now, what mostly people were using is the Python and the C++
client, but now there is a possibility to be able to use Rust, in order to develop application
for robotics, um, to trust you. So what's the basic about Rustu? What's it so different and so
important? Rustu is based on topics. Topics are the channel where the service server gets or
makes a response to the client. So in this case, for example, we can have a robotics R that
wants to close this specific river, so what you can do is sending a request, the client can
send a request, please, I want to close the river, and then the robotics R will close the river,
and then it will, as a response, it will say, okay, it has been succeeded, but not.
So, why Rust and Rust for two for robotics? Um, when I, when I started working in robotics,
I finished five years ago, I didn't have, I didn't have, I was in the strategy, so I didn't
have a really good background in software. So as a software developer, you have to have a really
good language that it gives you really good performance, it has to be really fast, because what has
to go fast, and also you can may have a real time application, or so the safety has to be safe
system, um, priorities are important, the flexibility to be able to run different threads on different
applications at the same time, the reliability, to be able to run the robot, and every time you
run your robot, every time should work. So now we have to capability to use Rust, it's like
a language that it has been developed, working as a hyper performance, is a low level code,
so it has more efficiency, um, memory on type 60, because as it thinks about memory,
we are like getting rid of sometimes memory leaks, and also it's a type 60, because design
in order to think about type. So yeah, the concurrency being able to like run different threads
and as a concurring way, and also the ownership thing that has been developed in
vast in order to know who gets the ownership, I think that's a good thing, and as so as we
have talked about, we were fewer runtime crashes, it's a safer system. So this is the package,
this is the repository that we are going to talk about, it's an open-source repository, and
you can see that there are different packages, we are going to focus on the RCLRS,
that it's a Rust client like package, or create in this case. So here is the attack, if you
want to know, then start working with this, lots of people are contributing, right? So this is the,
now, so you don't need to don't load the package itself, or the repository, because the client
has been released as a great, so you can store it, and you don't need to don't load and compile.
So here you can access to the great itself, and it also contains a really good documentation.
So you can go through this, so I think that when you are starting, and when you're having a good
documentation, it's easier for you. So what we are going to see now, now we're going to see
three different applications to use this specific Rust client in a, in different like ways.
This is our friend, this is the go-to from, from a new tree, this is going to be our server,
this robot is going to provide us different topics that we are going to use in order to make
our custom applications. So first, we're going to see the publisher, the publisher,
what we want to see in the previous is how to send common bells to the robot, how to make the
robot move around through this simulation. Then what we're going to see is the subscriber,
we're going to get through this topic, the bell-line point topic, we're going to get the scan
or the points for this specific ladder that the robot contains. And finally, as a third application,
you're going to make using both pollution and subscriber getting the velocity, I'm sorry,
cooling into the velocity and getting the positions from the sensor, you're going to make together
an obstacle avoidance. So first, how to create a pollution? Normally,
intros, but we have this anode, the node contains application itself. So we are creating an in
node that's going to contain the application and it's called CMD bell pollution.
Then we're going to create the pollution, the topic, the channel where we're going to send a specific
velocity to the robot, the pollisher, it calls CMD bell, common bell, we're going to send
comments to the robot. In order to like to pull this to a topic, we need to feel or like we need
a message. The message is like the message is going to go through this topic and it's how we're
going to pull this on to the robot. So as it is a velocity, as we are command-belling and we are sending
velocity, we're going to feel this specific message and we're going to send or change this
velocity. So in this case, what we are doing is like changing the topic, sorry, the message,
and we are changing the velocity doing a pendulum movement because we don't want to like
lose the robot. We want to have the robots control and we are going to make the robot move around
but doing a pendulum movement. So after we are like feeling the message, then we're going to
print by terminal, a message. So that we are moving, for example, in linear, we are moving in
this velocity and angular, we are not going to rotate around, just moving in linear. So here,
we are polishing, we are going to make the robot polish and move around here and this is a
robot moving around. So we are commanding and sending the other topic, C and D well, the specific
and for each point that we have in the here, for each point that we have in the message,
it means that you have this point to cloud. So it's at the to the, so a lot of points is going
around. So we are getting the data and we are processing the data. So at each point, we are processing
the x, y and the angle where I have something around, have some points. So I could have an obstacle.
In this specific application, what we are doing is just detecting if I have an object in one of
the corners. So if I have one of the object front, but left, right. This is a specific application,
just getting the left one. So what I am doing is, if I have an object, less than one
max distance and this object is in this specific range, in this specific angle, it seems that
I have an object in the left. So I am only printing around like in the terminal, I am saying that
I have a left object in my left. You can see here that it is more cold, that it is not being
with right and here, but we can do the same in the left, right, front and back.
And then we are spinning because we are like, wanted to get that cold, but.
So this is the point. Here we are placing a box in different like corners of the robot
and depending on the, the box is placed, here we have a different message in the terminal.
Robot doesn't move because we are not commenting the robot the robot is quiet, which is very
hearing through the scan or well aligned point topic.
So, last application. So now we have seen how to here, how to tell, through topics. So we are
going to use the same both topics in order to be able to tell with the robot. So here we have the
same as before. So here what we have, this is a bit different as before, we are like implementing
a specific like structures, because more or less like anything like class, but here in
press, we are placing, but everything structures. So we are doing the same as before.
You are going to make a polisher, we are going to try the polisher and then we are going to make this
subscriber. Same as before, we have like this is the message that it is like we are like getting
on each callback, and this is the same as before on every. Here we are like fitting the left corner.
So if we have an object in the left corner, in this case, just in this case, what we are doing is
feeling the message from the velocity just to be able to the robot to move around, if it
has for example an object in the left. So this is that this message, we are like feeling that it should
move to the right angle at velocity, if we have an object in the left. So that is the point.
So here is the node, we are getting a different node, here is where we are polishing on each loop,
we are polishing to the robot, and this is only change when in each callback, if there is something
like object around, if not, we may do, you can decide what you want, but you can go straight.
Okay? So that is the point. The robot may go like here, but it just is like an object in the left.
So it is going to start moving around.
So as a conclusion, from this talk, why we should start using Rust in robotics application,
it is because the memory and with safety by default, it is implemented by default.
Also it is a high level code without performance overhead, so it is like a mast.
So it is a type safety, and it contains a robust error handling, and it has an excellent performance,
which is really good on the old time applications. But as I have seen, if you are going to start
to use Rust and you are kind of new in so far development, maybe the learning difficulty and
the learning curve is steep, so maybe you could start using for example Python and then on your application.
The ecosystem in maturity, there are a lot of people who or much companies who are using
trust you with Rust now, so you may not have different packages where you can start like
a solid fault, but maybe, and also the legacy integration, maybe you have some
databases that are legacy, so it may be difficult to integrate with your current software.
And then the compile time, if you see plus plus if you compile by from scratch, you don't
haven't done any compile in the hard. So thank you for the attendance.
If you want to look through the Rust workshop, just to become a familiar about the technology
and about to learn deeper how to make message from scratch and work with services,
you can look through this, and this is my contact if you need netting from our site.
So thank you.
Hello, another language, so you should know them as such type always.
You can talk a little about this. No, no, no, no.
If I understand it correctly, Rust you use this heavily also a lot of Python written stuff.
Yes.
And so there's Python 3 which allows you to do bindings to Rust libraries, so you can accelerate
your Python code. And so would you say having the Rust two bindings for Rust is more
complementary so that you can slowly progress over then, finally then move your code from Python
to Rust, or is it just a completely different approach to integrate Rust into Rust too?
I might say depending on the application, depending on the resources that you have in your application.
For example, you have resources and time on Rust.
This is a very good question because it depends on how you are good on development.
So you can develop a really good code in all of the languages. But by default, if you start working
this specific package, there is only other packages that are working with Rust to
client, but this basically packages how the other Rust like C++ and Rust Python
packages work. So that's the point of using this one. But if you have other applications
just in Python and it's well maintained and it's efficient, it has been like go through.
I would say you can start working with this package from scratch, from new applications,
and you may still working in old and legacy code with other applications.
Depending on what you have, we're only half.
Amazing. Thank you so much.
Thank you.
And if you have further questions, find Julia in the hallway.
Thank you so much, guys.