Tip:
Highlight text to annotate it
X
Hello, everybody, welcome back to Week Four of the Hardware Lectures.
Rowland O'Flaherty here, Robotics PhD candidate, Georgia Tech.
So last week in Week three I went through and showed you how to wire up the
Quickbot. And this week what we're going to do, is
I'm going to show you how to Set up the BeagleBone Black and connect the
Quickbot to the Matlab simulator Sim.I.AM that JP has been showing you in the
software lectures. So let's get started.
So first I just want to go over an overview of
the steps that you'll take once you have everything set up.
So the first thing that you'll have to do is *** the BeagleBone Black.
Then you'll launch the code, the Quickbot code that will
be running on the robot, and then you will launch
Matlab and the Sim.I.Am simulator and connect to it.
So those will be the steps that you'll go through once you have everything set up.
So. First question is how to *** Beagle
BoneBlack. So SSHing means establishing a secure
shell. So you will be interacting with the
BeagleBone Black, which is a full-fledged computer, through
the command prompt. And to do that, you'll be at a shell
prompt, and you'll connect from your computer to
the BeagleBone Black. And so they call that a secure connection.
So you'll have a secure, a secure shell that you'll be using.
So I'm not going to go through the steps on how
to do that, because it's different for each operating system.
What I'm going to do is point you to a great tutorial.
On Adafruit's website. You can see it here on the slides.
There is a link to that tutorial. And may go through how to set up SSHing
for each of the operating systems. So whether you're on Windows, Mac or
Linux. So follow those steps to get acquainted
with doing a secure shell. Then, once you have that going
we will secure, we will *** the BeagleBone Black.
But first, let me just give you an overview for
those who are not familiar with working with the command prompt.
So when you're at the command prompt, let me give a little demonstration here.
There're several common commands you can do.
So, PWD shows you your current working directory.
I'm on my computer right now, not on BeagleBone Black.
So it's, it's my user. You can change, you can list directories,
you can change directories you can change into in my public directory
or what have you. So I have a list.
Of common commands that you can start out with here, on the slide.
And really Google is your friend here, so whatever command you're looking for,
quickly type into Google, and, and, you can find it pretty, pretty easily.
So let's connect the BeagleBone Black and what I want to start with is getting
the Wi-Fi connected and getting internet connected on the BeagleBone Black.
So the first thing that you're going to do is
connect and Ethernet cable to the BeagleBone Black's Ethernet port.
And one to your router, and then what you can do
is power the BeagleBone Black with a five volt power supply.
And then you can power it directly or you can power it through your
USB cable so here I am going to power it through my USB cable.
Now I just want to point out that. So here, powering the USB cable you can
see the lights are, are, are suddenly light up.
In the last lecture I mentioned that you can power the Quickbot, through a
separate power supply and in doing so you want to make sure the batteries are
disconnected. But, that is if you're applying power to
the entire robot. Here, if you want to just apply power to
the BeagleBone Black, you can do that. And that's going to be a five volt power
supply to the, to the DC barrel connector on the
BeagleBone Black. Make sure you use the five volt here, and
if you're powering the robot you're going to want to make
sure that the batteries are removed. And be using a nine to 12 volt de DC power
supplies. Just make sure you don't get those
confused. So now that the BeagleBone Black is
powered and it's it's booted up, what we want to do is *** BeagleBone Black.
So there are a few ways you can do that. And
what I'm going to show you here is, let's *** the
BeagleBone Black. Let's see, you can do, secure
shell, root is the user, and beagleone.local
will often work. So you might get this, you'll say, yes.
There's no password, you say, just hit Enter.
And now I'm actually on the BeagleBone Black.
You'll notice here, my computer switched from my computer's name,
Bender, to BeagleBone Black, and the user I'm using is root.
So once you're in the BeagleBone Black, your SSHed into it.
You can track those commands, so let's list
the directories in here, are working directory, and.
[BLANK_AUDIO] So now we want to check that we
have internet connected to the BeagleBone Black.
because you've connected your Ethernet cable directly
from the BeagleBone Black to your router. So let's see if we have internet.
So I'm going to ping the Google rou server here.
And, of course, it's not going to work here, because
I don't have internet in the studio, which I forgot about.
So, if you get an error, or you don't get a response, your internet is not working.
If you get It comes back and with a, a time to, of
how long it took to ping it, then you're, you're up and going.
So once you've pinged the Google server, just
So now we have internet on the BeagleBone Black.
clock on the BeagleBone Black black. And then we're, we're going to configure
the Wi-Fi so it works. So the commands you're going to want to go
through are listed here. I'm not going to type them out because
a list of all the timezones you can choose from.
31st but you should see the correct date. So the next thing we want to do is shut
So let's go ahead and do that. So follow that just execute that command
That will reset the BeagleBone Black. As it's resetting, go ahead and take your
BeagleBone Black. And now once the BeagleBone Black is
And here, I'm SSHed into it. Now, we want to see that the Wi-Fi module
is up and working. The command you're going to execute is if
[LAUGH] So you can see that if you get an ra, so it's shown right here, and this is
But if you get a listing here for ra0 then your, your Wi-Fi is working.
And if that shows something, then you're good.
Your Wi-Fi is turned on. And what else, you can also look for,
So once that is going what we need to do next is setup the Wi-Fi configurations.
So we're going to do this through the terminal, we're not going to
Conman or connection manager and the first thing
So what you're going to do is, clear this.
and then you're going to enter your, your router's network name under the
And then you're going to enter the password.
hash-tag that is associated with your password.
So what you want to do is copy this, then you want to go edit the Wi-Fi
lib / connman /Wi-Fi config. So it's nano is the text editor I'm using
Let's go ahead and edit that file.
So, mine's here has already been set up. But what you want to do is type it out so
bracket, service home, you can call it. Then the second line, the type equals
network. Here it's Grits lab.
executed. And then you'll type pass phrase equals,
To exit Nano, you're going to hit ctrl+X and it
And then you hit Y for yes and enter to actually exit.
So, what we want to do is restart the beaglebone black.
So the dash r means reset. And while it's shutting down you are going
connected, and hopefully when it reboots now, it's going to use the Wi-Fi.
So I've had trouble in the past, I've had both Ethernet, cable connected, and Wi-Fi.
If I'm trying to connect through the Wi-Fi, so I go ahead and disconnect the
And if that works you're in business. That means it's connected to your Wi-Fi
module. And obviously it's not going through the
password, no password. So now you're in there.
And what we want to do now. So let's just make sure you have internet
And obviously I don't have internet here. But you should have internet.
So the code is stored on a git repository on my local git repository or I mean, my
git repository on bitbucket.com. So git is a source code management system,
You can test that by typing, which git and it'll actually show you
which means download the all the contents of the repository,
the repository is where the code, lives. And you'll download that to your local
to where the code lives. And what that will do is, create a new
And you can see here that I've already done that on this BeagleBone.
And there it is Quickbot_bbb, and now you have all the code.
And you can see that there are some files there, and these are
run on the BeagleBone black. So listed here are some other commands
just to get you familiar with git. So you can clone repository.
You can pull. So that means if, if I make
pull from within the dir, the quickbot_bbb.git directory.
you're making changes and wanted wanted those to be committed and stored in
the repository, you would use commands like git status, git commit and git push.
basic git commands. Again, Google is your friend.
and you should be able to find a lot more information there.
So the next thing we have to do is we want to get
address of our computer. So in the slide here it shows two
So again, do this ifconfig ra0, and right there, you should see an inet address
then .105; but if I open up a new terminal window.
Now this is on my local machine, to do IFConfig, might have to search through it
address that is fairly similar except to the last three numbers of your I'm
So go ahead and write those down because what we're going to do next is actually.
Launch the code on the BeagleBone Black, that's going to be
Let's go ahead and change back to the terminal window with the BeagleBone Black,
So let's list to make sure do a list dash l,
l stands for long what you want to look for on the Quickbot.
the third spot, if there's not you want to make that file what they call executable.
So you'll do a change mode. User plus x that's saying add executable
rights to the user and then give it the file you want that to
would be now, mine is already executable. So then to, to run the code, let's go
./ that means from our current directory, run QuickBotRun.py and we're going to use
first the IP address of our computer, that's the one that's
let me make this a little bigger, and then it was the IP address of the bigger bone
So you'll run that and it'll say running Quickbot
And if you get them correct. Now the code is running on your BeagleBone
Black, ready to receive commands from the Matlab simulator or even you can send it
So let's now s, start up the Matlab simulator.
So what you want to do is launch Matlab, start up the Sim.I.Am Simulator
The one on the right side, and then press Play.
you've written by Matlab actually on the robot.
either in simulation or on the robot is toggle that connect switch.
And, and you're up and, up and running. So let me show you a quick demo of this
demonstrate is a live demo of the Quickbot working with the
have to do is open Matlab, navigate to the
then what you want to do first actually you need to go into the
blah blah blah. So this is where you're going to set the
IP address of the BeagleBone Black. So it knows how to communicate with it.
the terminal. Here I have mine as 192.168.1.101.
But this is my current IP address of my BeagleBone Black, so make sure you set
simulator like you normally do with JPs lectures.
You're going to connect to the robot and then you're going to press Play.
time sensing the distances. So JP's helping me here.
change. For example, that front one as he moves
forward it gets closer to him. And you can see those side ones are
So you see the sensor's working in real time,
What I'm going to do is show. A, a Quickbot doing a ob obstacle
it actually moved this time, instead of sit, sit still.
Now its going to move forward until it sense and obstacle and it's
going to stop and move forward until is senses an obstacle and stop.
backwards before it runs into my computer.
Sim.I.AM, a simulator, working together. Now, you have all the tools in place to
his lectures, to actually run them on a real
You might ask, or, you've run your own program,
So the first thing you can do is close the Sim.I.Am simulator, and shut down Matlab.
Black, you can press Ctrl+C, that will kill the program that was running.
Then you can just type shutdown -H now. That will shut down the BeagleBone Black.
the BeagleBone Black, the four lightly will no longer be blinking.
Just the power light will be on. And the last thing you can do is just go
to go. Alright, so now you know how to, now your
the code on it and start the simulator. So you are all set to run JP's
exercise and demo, not only in the simulator but on the robot.
Enjoy.