November 02, 2021

How to setup ROS2 for development

by Tyler Weaver

Transcript: Hello, this is Russ developer notes. I’m Tyler. And today I’ll be talking to you about how to get your rust to environment set up for development. In the last video, I explained using a meant link for claim format. And if you had gone out and tried to do it, you might have been confused and the reason is, is playing format in Alin. Isn’t a released feature yet. And you’re like, well, how did you use it? The thing is, is in rust two. And with a lot of development tools, building stuff from source should be normal or okay. You that’s, that’s what we’re gonna do. Um, you want the latest features. You gotta build some of ‘em from source. So you probably installed heavy packages and, and Russ is development tool. So this is not so weird. All right, you, you probably went through and did this, but we’ll go through and do it.

Um, so you can see me doing it and, uh, you can do it locally. I have a 2004 LXD container, uh, that I’m in this in. So set up your local, just copy paste this stuff and do a terminal. Uh, we need to set up our sources. So I’m gonna start copying and pasting this over the terminal. Um, we’re gonna install basic stuff it’s already installed. So the, you don’t have to sit here, watch me do and app install. Watch it for the full cross to rolling desktop. Oh, that’s another thing use rolling. There’s a lot of bug fixes and latest features. That’s enrolling that you want for development. If you go to release something and you’re gonna all this binaries into some product it’s gonna live forever. Yeah. You can use the long term support, but for development, your defaults should probably be using rolling.

Um, anyway, here’s the rolling desktop install. Now, the next thing that’s not super obvious. I’m gonna go back to the browser is you’re gonna develop Ross stuff using Ross, right? Uh, it, you need to be able to build stuff and you need all the same stuff that you would if you’re building Ross too. Um, and this is a pretty default or good basic, uh, environment set up for, uh, or set of packages. So we need to install tools. Actually terminal takes this stuff. That’ll be pretty fast. Next thing is Python stuff. So this is a little odd, but one thing is, is when you’re lending doing your Python lending specifically flake eight, um, what’s installed in your Python environment is what the it impacts what S get run. So if you have issues where like flag eight, doesn’t pass locally and it passes on CI or vice versa, this is the first place I would look. It’s like, make sure that on your CI system locally, you’ve installed the same FLA eight packages. So here we’re gonna copy and paste these to our terminal. Those are installed.

And the next thing we’re gonna do is these, uh, this stuff for the mid various middlewares. All right. So we did that. All right. Now, the next thing is step, uh, raw step is sort of like, think of it like apt for Ross packages. It it’s a way to where you can it’ll scan over your it’s also does dependency resolution for your, your source stuff. So it’ll scan over your source directory. It it’ll install raw dependencies that your package Exel list that you need from binaries to be able to build and stuff like that. Um, you need to run this in knit command. Um, this will set it up for the first time. Oh, uh, I already have it set up, so we need to do Ross, Deb update. That’s the next thing. Um, this is going to download sources from various stuff. Um, just think of this like apt update for us anyway, you need that.

Um, the next thing is right. We want those. We want that Minlin feature the immense cling format. That’s not released yet. How do we get that? We, well, I’m gonna create a tools workspace. So, um, I have a code directory. There’s nothing in it. I’m gonna make a tools, workspace, um, source directory. All right, let’s go find a mint. So a mint li here’s it on GitHub, copy the or all for it, own it. All right. Now we wanna build, uh, the next thing I wanna talk to you about is col con mixing. So col con is the build tool for Ross. And when you did that, let’s go back to the browser. When you did this, one of the things you did, it’s all Python, three co common extensions. So that installed Coke and a handful of its common exception extensions, but one of the extensions, it didn’t install is mix in and mix in. Is this awesome tool that allows you to write shorthand commands, to do this, do really common stuff. Um, I don’t know why it’s not installed by default, but install into your environment. Um, the way you do that back to the terminal is studio or not. I gonna do with apt. It’s actually PIP B uh, PIP three install, bulk on mix.

All right. I already have an install, but you, you, that then the next step is it’s not super obvious. You gotta go over here. Um, this repository, Coke mixing repository. Um, if you just Google for co it’ll be one of the first Orcon mixing, um, one of the first results, this one right here. So this command, add this, uh, mixing set up so that you could add your own and, uh, have a lot of flexibility that way. Uh, but we’re gonna grab the default ones. The default ones are awesome. So there, uh, those are the two were just copied and pasted out of, um, this read that you can find, go on, mix in search for it. This result right here. Yeah. You want these two commands out of the re now you go, okay. So we’re gonna go back to the terminal. I’ll show you what that does.

I do Pokemon mix in show. Here are some of the things it does. It’s like adding CMA arguments that are just like really long and access to type out some, you may have like aliases to do this, but mix in it, mix in like a built in alias. It’s cool and has a lot of good defaults. The first one I’m wanna point out is sea cash. Um, sea cash is a feature that built cashes your, um, compiler outputs. Uh, it’s great. You’re gonna be rebuilding stuff all the time. You should, I’ll see cash and just use the C cash mix in the next one is your build type. So I use release the bug info all the time on whatever I’m building so that when I want to bug it, it’s I have the bug symbols, but, uh, for tools that you just build, that you, you just want the latest copy I’d use. So that’s what we’re gonna do. Um, we’re gonna do col on build, um, add mix in and then release and see cash. Well, first before we do see cash, you have to be able, you have to install it. Pro have to install cash, sorry, install mine, but that’s what you to do to get it. And then you can do Coke, build mix in piece cash.

All right. Um, there’s some mornings, but it was because of a fast environment thing I had anyway, whatever. Um, so now we have it. Um, the thing is, is, so now we can, uh, meant playing format and this would normally air. Um, it’s not gonna air for me. It’s gonna actually run it. Um, and the reason is one other thing you need to do is you need to do app install, playing format, the actual tool already install, but you to do that before you can run it, um, then when you run it, it’ll give you output like this. And now you have the tool. Um, one more thing, uh, you want to add to your, uh, uh, uh, script setup, your RC script, um, sourcing the Ross install and sourcing these tools directory. So you just have it all the time. So how you do that is, uh, add this to the bottom. In my case, I use eSSH. Um, if you use batch, it’s very similar, uh, opt cross rolling. Um, H and I’m gonna also source my tools. One home, you run to tools, install, uh, I like the local setup anyway, and we’ll test that, that works. We’ll start any terminal. So page, um, playing format. All right. There it is. Yep. Now we have it. Now you’re all set up. So you go watch the other video and use, uh, a amend click format format, your C plus code developed with Ross two. You have all the, uh, right stuff installed. Thank you. Uh, if this is raised your Ross IQ, uh, great day,