4 – Nd113 Embedded Terminal V1

Hi. My name is Andrew Pastor, and I am a Content Developer for the Intro to Self-Driving Car Nanodegree. In this lesson, C++ Intro to Optimization, and the following lesson, C++ Optimization Practice, you’ll be using a feature of the classroom that you haven’t seen yet. When you go to the next part of the lesson, an embedded command line tool will load that looks like this. Usually, when you use a computer, you’re using your mouse in a graphical user interface to move files around, open files, create new files, and open programs. But there’s another way that you can use your computer, and this is with the keyboard and entering commands directly to the computer. So, this is essentially what we’ve set up for you in the classroom. When you open this, this section of the classroom is actually connecting to a remote computer that contains files and allows you to run your C++ programs. So, I wanted to give you an overview of what all of this is and how it works. On a Mac or on a Linux machine, there’s a program called the Terminal that allows you to do the same types of things that we’re going to do here, and the equivalent in Windows is called the Console Window. So, when you go to the next part of the lesson, Demo Machine Code, this is going to open. And you’ll see there are three big sections plus a menu down here and then this menu up here. The menu up here is just to be able to navigate the classroom which you should already be familiar with. This part here is showing you all of the files that are on this remote computer. So, you can see that because we’re in the demo machine code part of the lesson, we’ve automatically set it up that it goes to the folder, demo_machine_code, and has these two files in it, which are opening automatically for you. But you can actually navigate through this with your mouse and see workspace, and see all the demos in this lesson. If you double-click on a file or on a folder, it’ll open and you can see the files there. If you go to the “Back” button, it’ll take you to where you were before, and you can just navigate it like anything you’re probably used to on your computer. If you right-click, you’ll see some options like, “Open,” “Move,” which is to move a file to a different folder “Rename,” “Copy,” “Download,” “Delete.” And then, this “Plus” button is if you want to add a file, add a folder, or upload something from your desktop that you were doing. Notice here, it says, “All changes saved.” So, everything you’re doing here it just gets saved automatically. Anything you type in this part will get saved automatically, and so you don’t have to worry about saving things. This part right here is a text editor. So, you can see this instructions.md file is really a text file that explains what the demo is and then here you have machine code.cpp, which is a C++ file. You can actually close these files, open these files by double-clicking over here, it works kind of like your regular computer. So, then, the next part is this big chunk down here where it says, “New Terminal, No Open Terminals.” So, this is where you’re actually going to be able to write commands directly to this remote computer. So, if I click on “New Terminal” here or on this “Plus” sign, it’s going to open this New Window. So, here it says, home/workspace. So, that tells me that I’m actually here in the workspace folder. As you click on this part versus this part, they’re actually not connected. So, if you want to navigate different folders in the terminal, you have to actually put commands in to do that. The instructions actually talk about and give you the commands that you’re going to need. So, don’t worry too much about that. So, I’m going to go through an example of how you can use this to run your C++ code. Every time this opens for you in the classroom, you’re going to see this instruction file, and it’s going to tell you exactly what you need to type in down here and in what order. You can either just go here and copy these commands, and copy and paste them, and they’ll just show up and then you hit “Return” and they’ll run, or alternatively, you can type them out. So, without worrying too much about what all of these commands do, type this in, I’m saying, CD, change directory. So now, you can see that in the terminal, I’ve changed folders and I’m inside this demo_machine_code folder. And then, this next code here, it is going to compile my C++. Okay, and then, you can see over here, this.o file appeared, and then it says in the instructions to type this out, and this is the results of the demo. And if you read through the ReadMe file or this instructions file, you’ll understand what all this is doing. The other part I wanted to mention is this menu down here. So, if this freezes for some reason and it just isn’t running right, you can always hit “Refresh Workspace” down here. It’s just going to reconnect. Your work will be the same everything is saved but it just let’s you start over again. If you want to reset everything and get back to the original code that we provided for you, you’ll have to click on “Reset Data,” which opens this Window here, and it says “Resetting data will wipe all of your work to restore the project to the original state” and then you type in “Reset Data” and click. I really suggest that you do not reset the data unless you have saved all of your work externally and downloaded it because, for example, if you just want to reset these files and you hit “Reset Data,” it’s going to reset everything, and you’re going to lose all of your work. So, make sure that if you need to reset the data that you have right-clicked on everything and you’ve downloaded all your code to the desktop or to wherever so that you can then upload it again after you’ve restarted things. Again, every single one of these lessons, like Demo Binary over here, it opens the files for you and gives you instructions and tells you what to do, and if you want to see the code that is related to all of this, you just click here “Demo Binary” and you’ve got the instructions file and main.cpp. So again, what you’ll always be doing is you’ll be opening this up, you’ll be reading the instructions, you’ll open a new terminal, you’ll type these commands one at a time, hit “Enter” and everything will run. I am going to provide a link about what all of these commands are and what you can do but it’s not something that you need right now. But if you want to study it more and see how you can use the terminal not only in the classroom but using it for yourself on your computer, it’s something that is really helpful, and it’s something that a lot of software engineers need to be able to do. So, thanks.

%d 블로거가 이것을 좋아합니다: