WEBVTT 00:00.000 --> 00:19.280 Hi, so the next talk, the next talk will be by Julia and she's going to talk about programming 00:19.280 --> 00:26.280 Rostu with Rust. Please give her a warm welcome. 00:29.280 --> 00:35.280 Thank you everyone. Welcome to the talk or the presentation about how to program Rostu with Rust. 00:35.280 --> 00:41.280 Maybe it's a bit different topic as we have seen in this bedroom, but let's see. 00:41.280 --> 00:48.280 So, sorry. 01:02.280 --> 01:10.280 So, first of all, I'm a robotic consultant and I've been working as a robotic super engineer for five years. 01:10.280 --> 01:21.280 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 01:21.280 --> 01:32.280 because about how to program Rostu with Rust was a kind of new topic and not much people was talking about this, so that's also why I'm here. 01:32.280 --> 01:42.280 So, first of all, what do you want to see? First of all, what is Rostu? Maybe some of you are most active developers, but I'm provided developers. 01:42.280 --> 01:52.280 So, yes, we're going to see this, we're still working for robotics, why we are using Rostu for robotics and so on right now. 01:52.280 --> 01:57.280 We're going to see together how to make a position as a subscriber application. 01:57.280 --> 02:06.280 We're going to start with our position, then we're going to get into the subscriber and then we're going to see both the position as a subscriber in the same note. 02:06.280 --> 02:09.280 And then we're going to look through some conclusions to go. 02:09.280 --> 02:17.280 So, first of all, what is Rostu? If you want to look here, you have a dark, if you want to get familiar with Rostu. 02:17.280 --> 02:29.280 Rostu, it's the robotic operating system. It's a framework that mostly, probably it's like people use. It's an open source framework. 02:29.280 --> 02:38.280 And it's maintained by the open source of ethics, foundation and lots of institutes and people does and develop lots of code for this framework. 02:38.280 --> 02:50.280 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 it. 02:50.280 --> 02:58.280 Look through your computer and also it has hardware drivers. 02:58.280 --> 03:07.280 AI, machine learning, the library applications also has been developed to be also compatible with Rostu. 03:07.280 --> 03:14.280 So, debugging, that is you can save bugs and then retrieve them in the future. 03:14.280 --> 03:19.280 For example, the robot has done something unexpectedly. So, you can see it after. 03:19.280 --> 03:26.280 Also, there is simulation. You don't need to have a real robot in order to be able to develop. 03:26.280 --> 03:36.280 You don't need to have a robot. So, you can use simulation. So, you can develop code. We don't need it to have a robot real robot. 03:36.280 --> 03:51.280 Also, there is computer vision, open CVs, lots of integrated Rostu, machine planning. You can do task planners and use in your robots and communication. There are different protocols that has been developed to be used with Rostu. 03:51.280 --> 03:57.280 So, Rostu is based on the DDS, the data distribution system network. 03:57.280 --> 04:08.280 And here in this, we are going to talk about the client. So, until now, what mostly people were using is the Python and the C++ client. 04:08.280 --> 04:17.280 But now, there is a possibility to be able to use Rost in order to develop application for robotics to Rostu. 04:18.280 --> 04:26.280 So, what is the basic about Rostu? What is so different and so important? Rostu is based on topics. 04:26.280 --> 04:39.280 Topics are the channel, the service server gets or responds to the client. So, in this case, for example, we can have a robotic server that wants to close this specific Ripper. 04:39.280 --> 04:46.280 So, what you can do is sending a request, the client can send a request, please. I want to close the Ripper. 04:46.280 --> 04:57.280 And then, the robotics are, we will close the Ripper. And then, it will, as a response, it will say, okay, it has been succeeded or not. 04:57.280 --> 05:07.280 So, why was Rostu for robotics? When I started working in robotics, five years ago, I didn't have, 05:07.280 --> 05:19.280 I didn't have, I was in the storage area, 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. 05:19.280 --> 05:27.280 It has to be really fast, because what has to go fast and also you can maybe have a real time application. 05:27.280 --> 05:38.280 Also, the safety has to be safe system, priorities are important, the flexibility to be able to run different threads on different application at the same time. 05:38.280 --> 05:47.280 The liability to be able to run the robot and every time you run your robot, every time you should work. 05:47.280 --> 05:59.280 So, now, we have the capability to use fast, it's like a language that has developed working as a hyperformance, is a low level code, so it has more efficiency. 05:59.280 --> 06:12.280 Memory on type 60, because as it thinks about memory, we are like getting rid of sometimes memory leaks, and also inside type 60, because design in order to think about type. 06:12.280 --> 06:30.280 So, the concurrency being able to run different threads as a concurring way, and also the ownership thing that has been developed in the past, in order to know who gets the ownership, I think that's a good thing. 06:30.280 --> 06:37.280 And so, as we have talked about, we were fewer runtime crashes, it's a safer system. 06:37.280 --> 06:48.280 So, this is the package. This is the repository that we are going to talk about. It's an open social repository, and you can see that there is different packages. 06:48.280 --> 06:58.280 We are going to focus on the RCLRS, that it's a RAS client like package, or create in this case. 06:58.280 --> 07:07.280 So, here is the tag, if you want to know, then start working with this. Lots of people are contributing around. 07:07.280 --> 07:23.280 So, this is the, now, so you don't need to download the package itself, or the repository, because the client has been released as a great, so you can install it, and you don't need to download and compile. 07:23.280 --> 07:32.280 So, here you can access to the great itself, and it also contains a really good documentation. So, you can go through this. 07:32.280 --> 07:38.280 So, I think that when you are starting, and when you're having a good documentation, it's easier for you. 07:38.280 --> 07:50.280 So, what we are going to see now. Now, we're going to see three different applications to use this specific RAS client in different like ways. 07:50.280 --> 08:02.280 This is our friend. This is the go-to from the 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. 08:02.280 --> 08:14.280 So, first, we're going to see the pollution. The pollution, what we're going to see in the pressure is how to send common bells. We're about how to make the robot move around through this simulation. 08:14.280 --> 08:22.280 Then, what we're going to see is the subscriber. We're going to get through this topic, the relevant points topic. 08:22.280 --> 08:31.280 We're going to get the scan or the points for this specific ladder that the robot contains. 08:31.280 --> 08:38.280 And finally, as a third application, we're going to make using both pollution and subscriber getting the velocity. 08:38.280 --> 08:48.280 I'm sort of pulling into the velocity and getting the positions from the sensor. We're going to make together an obstacle avoidance. 08:48.280 --> 08:56.280 So, first, how to create a pollution? Normally, in trust, what we have is anode. 08:56.280 --> 09:05.280 The node contains application itself. So, we're creating anode that's going to contain the application. It's called CMD Val pollution. 09:05.280 --> 09:13.280 Then, we're going to create the pollution. The topic, the channel, we're going to send a specific velocity to the robot. 09:13.280 --> 09:19.280 The pollution, it's called CMD Val, common bell. We're going to send, commerce to the robot. 09:20.280 --> 09:32.280 In order to pull it to our topic, we need to feel or like we need a message. The message is like the message is going to go through this topic. 09:32.280 --> 09:35.280 And it's how we're going to pull it onto the robot. 09:35.280 --> 09:44.280 So, as it is a velocity, as we are combing and sending velocity, we're going to feel this specific message. 09:44.280 --> 09:54.280 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. 09:54.280 --> 10:03.280 And we are changing the velocity doing a pendulum movement, because we don't want to lose the robot. 10:03.280 --> 10:11.280 We want to have the robots control and we are going to make the robot move around, but doing a pendulum movement. 10:11.280 --> 10:19.280 So, after we are like feeling the message, then we're going to print by terminal, a message. 10:19.280 --> 10:29.280 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. 10:29.280 --> 10:38.280 So, here we are polishing, we're going to make the robot polish and move around here. 10:38.280 --> 10:46.280 And this is the robot moving around. So, we are commanding and sending the other topic, CMD well, the specific. 10:46.280 --> 10:56.280 And for each point that we have in the here, for each point that we have in the message, it means that you have the point to cloud. 10:56.280 --> 11:03.280 So, it's at the to this. So, lots of points is going around. So, we are getting the data and we are processing the data. 11:03.280 --> 11:13.280 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. 11:13.280 --> 11:21.280 In this specific application, what we are doing is just detecting if I have an object in one of the corners. 11:21.280 --> 11:29.280 So, if I have one of the object front, but left, right. This is a specific application, just getting the left one. 11:29.280 --> 11:43.280 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. 11:43.280 --> 11:51.280 So, I am only printing around like in the terminal. I am saying that I have a left object in my left. 11:52.280 --> 12:00.280 Okay, 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. 12:00.280 --> 12:06.280 And then we are spinning because we are like wanted to get that cold, but. 12:06.280 --> 12:19.280 So, this is the point. Here we are placing a box in different like corners of the robot, and depending on the box is placed. 12:19.280 --> 12:23.280 Here we have a different message in the terminal. 12:23.280 --> 12:37.280 Robot doesn't move because we are not commenting the robot the robot is quiet, which is very hearing through the scan or validine point topic. 12:37.280 --> 12:44.280 So, last application. So, now we have seen how to hear how to tell through topics. 12:44.280 --> 12:50.280 So, we are going to use the same both topics in order to be able to tell with the robot. 12:50.280 --> 12:57.280 So, here we have the same as before. So, here what we have. 12:57.280 --> 13:06.280 This is a bit different as before. We are like implementing a specific structure. 13:07.280 --> 13:25.280 So, we are doing the same as before. You are going to make a polisher. 13:25.280 --> 13:29.280 We are going to try the polisher, and then we are going to make this subscriber. 13:29.280 --> 13:36.280 Same as before. We have like this is the message that it is like we are like getting on each call that. 13:36.280 --> 13:42.280 And this is the same as before on every. Here we are like fitting the left corner. 13:42.280 --> 13:48.280 So, if we have an object in the left corner, in this case just in this case. 13:48.280 --> 13:54.280 What we are doing is feeling the message from the velocity just to be able to the robot to move around. 13:54.280 --> 13:58.280 If it has for example, an object in the left. So, this is that this message. 13:58.280 --> 14:05.280 We are like feeling that it should move to the right angle at velocity. 14:05.280 --> 14:09.280 If we have an object in the left. So, that is the point. 14:09.280 --> 14:17.280 So, here is the node. We are creating a different node. Here is where we are polishing on each loop. 14:17.280 --> 14:25.280 We are polishing to the robot. And this is only change when in each call that. 14:25.280 --> 14:36.280 If there is something like object around, if not, we may do, you can decide what you want, but you can go straight. 14:36.280 --> 14:40.280 So, that is the point. 14:41.280 --> 14:47.280 The robot may go like here, but it just is like an object in the left. 14:47.280 --> 15:02.280 So, it is going to start moving around. 15:02.280 --> 15:10.280 So, as a conclusion from this talk, why we should start using Rust in robotics application. 15:10.280 --> 15:16.280 It is because the memory unfolds by default. It is implemented by default. 15:16.280 --> 15:22.280 Also, it is a high level code without performance overhead. So, it is like a must. 15:22.280 --> 15:26.280 So, it is a type of safety and it contains a robust error handling. 15:26.280 --> 15:31.280 And it has an excellent performance which is really good on the old time applications. 15:31.280 --> 15:39.280 But, as I have seen, if you are going to start to use Rust and you are kind of new in software development, 15:39.280 --> 15:43.280 maybe the learning difficulty and the learning curve is steep. 15:43.280 --> 15:48.280 So, maybe you could start using, for example, Python and then on your application. 15:48.280 --> 15:57.280 The ecosystem in maturity, there are a lot of people who are much companies who are using trust you with Rust now. 15:57.280 --> 16:04.280 So, you may not have different packages where you can start, like, as a default. 16:04.280 --> 16:11.280 But, maybe, and also the legacy integration, maybe you have some databases that are legacy. 16:11.280 --> 16:17.280 So, it may be difficult to integrate with your current software. 16:17.280 --> 16:25.280 And then, the compile time, if you see++, if you compile from scratch, you don't have it on any compile, 16:25.280 --> 16:30.280 and I will be hard. So, thank you for their attendance. 16:30.280 --> 16:37.280 If you want to look through the Rustu workshop, just to become a familiar about the technology and about to learn 16:37.280 --> 16:42.280 deeper how to make message from scratch and work with services, you can look through this. 16:42.280 --> 16:46.280 And this is my contact if you need anything from our site. So, thank you. 16:46.280 --> 17:01.280 You can talk a little bit about this. 17:01.280 --> 17:13.280 If I understand it correctly, Rustu uses heavily also a lot of Python written stuff. 17:13.280 --> 17:21.280 And so, there's Python 3, which allows you to do bindings to Rust libraries, so you can accelerate your Python code. 17:21.280 --> 17:30.280 And so, would you say having the Rustu bindings for Rust is more complimentary so that you can slowly progress over, 17:30.280 --> 17:42.280 then, finally, then move your code from Python to Rust, or is it just a completely different approach to integrate Rust into Rustu? 17:42.280 --> 17:48.280 I might say depending on the application, depending on the resources that you have in your application. 17:48.280 --> 17:54.280 For example, you have resources and time and Rust. 17:54.280 --> 18:03.280 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. 18:03.280 --> 18:13.280 By default, if you start working this specific package, there is only other packages that are working with Rustu client, 18:13.280 --> 18:20.280 but this basically packages how the other Rust like C++ and Rust Python packages work. 18:20.280 --> 18:22.280 So, that's the point of using this one. 18:22.280 --> 18:30.280 But if you have other applications just in Python and it's well maintained and it's efficient, it has been like go through. 18:30.280 --> 18:43.280 I would say you can start working with this package from scratch, from new applications, and you may still working in old and legacy, depending on what you have to really have. 18:43.280 --> 18:46.280 Amazing, thank you so much. 18:46.280 --> 18:56.280 And if you have further questions, find Julia in the hallway. 18:56.280 --> 18:58.280 Thank you so much, guys.