As we learned in Section one.
Ross One was around for a long time till the Ross to architecture came around to fix some of its communication
woes.
However, there were so many programs by this time which were developed and dependent on Ross one,
so trying to adapt entire codebases quickly to Ross two could easily be seen as problematic and costly.
So trying to have legacy Ross one systems communicate with Ross too quickly became a key topic as a
means of backwards compatibility.
Thus comes the Ross one bridge, which, as its name suggests, Bridges, Ross one and Ross two nodes
together to be able to communicate with each other.
Now, the last time Ross two and Ross one were supported on the same version was Ross one Noetic and
Ross to Foxy on Ubuntu 20.4.
So this lecture is shot on an Ubuntu 20.4 machine with both Ross noetic and Foxy installed on it.
So by all means no need to follow along.
This is purely for educational purposes in case you ever find yourself needing to bridge the old Ross
one package to Ross two.
Another common way to use the Ross Bridge is with the help of Docker images.
But this course will not be covering the use of Docker with Ross.
With that info out of the way, let's get started.
So the first thing I'm going to do is head over to my bachelor si file, which I'll edit in.
Adam.
At the bottom.
We should have our sources for our Ross two installation.
I'm going to go ahead and comment mines out so that no Ross is sourced.
I'll go ahead and save this and close.
Now, if I open a new terminal, I should be unable to use Ros two or any ROS one commands.
Now we can move on to installing ROS one onto our system so that we can utilize the bridge here locally.
So here I'm on the Ross Noetic installation page since I'm currently running Ubuntu 20.
So go ahead and open up a terminal.
We'll go ahead and set up our sources list.
Put in your password.
Then we'll go ahead and set up our keys.
Then we'll run pseudo apps update.
All right.
Go ahead and clear the screen.
And for the purposes of this video, I'm not going to install the full desktop version of Rosenau wedding,
partly because it will also coincide with my current installations of RVs and Gazebo.
So instead, what I'm going to do is just simply install the base version of Ross Noetic.
So this will just give me the basic packages and communication libraries.
No user interface tools or anything like that.
So I'll just go ahead and install this.
I'll go ahead and hit.
Yes.
And so this will take a while to install.
So go ahead and pause the video now and we'll come back once it's finished.
All right, so the installation finished and we can just see that all it did was set up all the packages
That took about maybe 4 minutes for me.
Now we'll go ahead and move on with the environment set up of this.
So in order for us to utilize our Ross one, we can't use anything yet.
So I use Ross core, which is a Ross one command to start the Ross master.
Even though we have Ross installed, we can't use anything because we haven't set up our environment
file.
So if I go ahead and source my terminal environment, we should now see that I can run things like Ross
Corp.
Great.
So now this device has Ross one and Ross two installed on it, but by default neither will be sourced
on terminal startup.
So the next thing we're going to do is we're going to make sure that we have all these other dependencies
for building packages.
So I'll go ahead and copy and paste this in.
Go ahead and hit Y and enter.
And in most cases you'll already have Ross step initialized, but you can double check by pasting in
this so we can see I've already have it installed and I already have it initialized.
And we can double check that it's initialized by running these commands.
So here we can see error sources file already exists, so I'm not going to bother removing that one.
Creating a new one.
I'll just leave it as is.
So now we have Ros one and Ros two installed and we have our actual dependencies if we have to build
any packages.
So for now, I'm going to start off clean with a new terminal environment that's not sourced on any
raw system.
So now if I run Ros to help see Ros two command not found or ROS core and we see Rostker not found.
So this terminal instance can't see either one of our ROS installations.
So now we'll go ahead to the ROS.
One bridge documentation.
All right, so here are the prerequisites.
We should have majority of these prerequisites from the basic installation.
But first off, I'll go ahead and source the Ross one installation as these were catered towards the
Ross one installation.
So I'll do source slash opt slash Ross noetic.
And so now I should have access to my tools like raw Core.
And we can see I do.
And now I'll just make sure that I have all these other packages installed, which I can do using sudo
apt install.
And then we do Ross the name of the distribution, which in this case for me is noetic.
And then the name of the package.
So things like CAT scan, raw CP ros launch ros message should all be already installed because that
comes with the basic installation.
The main things we're going to be missing though are going to be those that are utilized for the examples,
including the tutorials and the RCT image view.
So I can go ahead and install those specifically.
And note instead of using underscores when using the pseudo app command, you should use just a simple
dash when you see the package name separated by underscores.
So as you can see here, instead of doing Ross PI underscore tutorials.
I am doing Ross P dash tutorials, but that correlates to the correct package.
And then last but not least, I'll install the RCT image view.
All right.
And we should be good to go on that front.
You can double check with all the other packages that you have then properly installed.
Moving on.
We can go on to building the bridge from source.
So earlier we installed ROS two from source.
And so in order to utilize it, we're actually have to make sure that we skip the ROS one bridge command
on build initially.
So I'll go ahead and do that now in a new terminal.
So here you are seeing we're rebuilding the Ross two installation, but this should go by a lot faster
since we've already built it already.
This time we're just simply skipping the Ross one bridge.
That took 20 minutes or so.
We did have some standard error outputs from GUI and M.W..
Next, I'm not going to be using next and I'm don't plan on using the RCT, so I don't think this will
affect us for right now.
So I'm just going to continue on with the read me documentation for utilizing the raster bridge.
So now we need to source our Ross one environment.
So what we will do is do the source.
So we will do source slash OP slash Ross Noetic set up bash.
Now we will source the Ross two installation, which is located here in my Workspaces directory, so
I'll do source install setup bash.
And so it'll mention that the distribution was noetic before.
That's fine, because that's what indeed we were doing.
We had our ROS one source and then now we just source our Ros Fox, the installation.
Now we can build the Ross one bridge using this command.
And so this will only rebuild the Ross one bridge package.
So it won't rebuild the whole Ross to installation.
So we'll go ahead and run this.
All right, So our Rosslyn Bridge finished building.
That took about 8 minutes for me.
So we'll go through and try to run some examples.
So I'll go ahead and open up new terminals that are independent of this one, since this one has both
of them sourced.
So I'll put this one away.
So the first one I'll do is source this terminal to have only Ross one to imitate my previous robot
or system, which only ran Ross one code such as source slash opt Ross Noetic set up dot bash,
and then we'll just run a Ross core instance.
Then for this example, we'll need another shell which has Ross one and then Ross to source, which
pretty much makes up the previous terminal we had and did our insulation.
So I'm going to bring that one back.
And what we're going to do is export the Ross Master Uri to match that of the local host or in this
case, what this URI should be.
So we can go ahead and export that.
And now we can try run the Ross to bridge.
All right.
So here we can see that it created a bridge for the Ross out and Rxl interface tags.
So here, if I go and open a new terminal tab Source Opt Ross Noetic Setup dot Bash Ross Topic list.
All right, so we see that it converted our Ross out from Ross one to Ross two.
All right, so now we can go ahead and actually start some nodes.
For this example, we'll need another terminal which has our Ross one sourced, which I just did here.
So I'll actually go ahead and clear the screen and we'll go ahead and run our talker node from the tutorials.
So here we see these Hello Worlds publishing out.
And now I can go ahead and open up another Ross to instance.
So this one has our roster bridge running.
So I'm going to open up another terminal tab, and I'm going to source our install setup dot, dot bash
file.
And then we can do our listener node.
And here we can see we are receiving the Hello world messages here on this Ross two terminal from.
This Ross One instance running our Talker node from Ross Noetic to Ross Foxy.
So there you go.
That's how you can utilize the Ross Bridge to bridge over perhaps old nodes that you had made in Ross
one, and then you can implement them into Ross two nodes.
So go ahead and stop these.
That's it for this part of the video.
I will do a second part of the video where I will do Cross-device communication using the Ross Bridge.
All right, So here we are.
I have two different computers going right now that are connected to each other via an Ethernet switch.
So the first one is our original computer, which is running our Ubuntu 20, where we have our ROS two
Foxy installed as well as ROS one noetic.
On the second computer.
We have a laptop of mine that's running Ubuntu 18 and this one is running RAR melodic.
So starting off with my laptop, I can go ahead and open up a terminal here just to show this to you.
If I go over and do Ross version dash D you can see I'm running melodic and if I were to do Ros to help,
you can see that I do not have Ros to install.
All right, so that's the first thing to note.
So the second thing to note when working with two different systems is that each one will have its own
independent IP address either by you setting it or by a router setting it.
So if I can check that by running the if config command.
And so here we can see my IP address for this computer is 192.168.50.177.
So all my other local computers that are on this network can access or communicate with this computer
by locating this IP address.
So we can do the same thing over here on my Ubuntu 20 machine.
So if I go over here and I type in F config, you can see this machine has an IP address of 192.168.50.3.
So be wary of what your machine's IP addresses are because they will vary from mine.
If you are trying to reproduce what I'm about to do here.
All right.
So heading back to my machine running Ubuntu 18, I can go ahead and clear the screen so this will be
running our ROS1 instance and we'll be simulating essentially that this is one of our robots running
a ROS1 node.
And then we want our Ubuntu 20 machine which has RAS two and RAS one installed to be able to communicate
with this one.
And so we don't want to have to install Rasta in this machine.
So we're going to go through how we can go about doing that.
If we have an older robot that we developed code for, we can still utilize it with newer machines that
run ROS two.
So the first thing to note, whenever we're dealing with ROS networking, we have to set Ros Master
Uri and the ROS IP of the device.
So I've gone ahead and listed these down.
Right, So we just took note of the IP address and I'll put it back up on here.
I have config.
All right.
So this one is 192.168 50.177.
So in ROS one there was a central ROS master server which all the ROS nodes would have to communicate
with.
I will have that set running on this computer.
So what I will do is set my Ros master Uri.
Variable by using the export command and I will set it to this IP address or I'll set it to HTTP colon
slash, slash this IP address and then port 11 311, which is the default port Ross one runs off of.
So I'll go ahead and run that.
Then I'm going to set the Ross IP of this particular device, which is just the IP address part.
So you don't need the HTTP and you don't need the port number at the end of it.
And so with that, now this knows that the Ross master should be running on this machine on Port 11
311 because this is the same the machine with this particular IP address.
So now we can go ahead and start our ROS master using the four Ros one using Ros core.
Okay, so now we have our core instance running.
So our Ros Melodic is running.
So now if we go over to our 1 to 20 Machine.
We can run through the first example from the Rosslyn Bridge documentation in a very similar way.
So right now our shell A which is ROS1 only is that ubuntu 18 computer that I just ran rostker on.
So that only has ra melodic on it and it's now running core.
So now this will be our shell b so we first source ros one.
In this case I don't have melodic but I have noetic, but this will still work even though it's a different
distribution.
So if I go ahead and run this source command right here I am sourcing my noetic setup that bash where
I installed it.
So now my RA noetic is source for this terminal.
Then we'll go ahead and source our ROS two instance, which I also have here because I built ROS two
from source.
So I have it here in my workspaces folder.
Ros do foxy and then install setup dot bash.
And so we get a little warning here saying set to noetic before please make sure, but that's totally
fine.
So for now I'm just going to clear the screen and now we need to export the ROS master Uri and our ROS
IP address to match what it's supposed to be.
So first off, we will set the ROS master Uri to the same thing we just set it to on the other computer.
Right.
So the ROS master is running on the Ubuntu 18 computer which has this IP address.
So this will be our master URI we want to communicate with.
And then as we mentioned, if I type in if config, right, this is the IP address for this specific
computer.
So I'm going to export the ROS IP variable here in my terminal so that it knows that this is the ROS
IP of this machine.
Cool.
That I can go ahead and clear the screen and now we can run our Ros Bridge.
So if I go ahead and run this Ros to run Ros one bridge dynamic bridge, I can go ahead and run it.
And now you can see it created the bridge and it's already beginning to convert those messages.
Now we can actually open up another terminal to follow through with this example and we will open this
up on our Ubuntu 18 machine and this will be our talker node that comes with just the normal ros PE
tutorials for ROS one.
So I'll go ahead and do that now.
So control alt dt.
So now I have a new terminal here and just to make sure again, just to prove to you that this is only
source with this Ros melodic if I do ROS version, this is melodic.
Ros to help.
And you can see I don't have Ros two installed on this machine so I'm not trying to pull anything here.
This machine only has Ros one on it.
We will need to make sure though that we have our master Uri and IP properly set in every terminal.
So normally you would set this in your Batchelor C file so that it runs every time you open a new terminal.
But for right now I'm just going to set this manually.
Each time we open a new terminal, we'll only be opening these terminals.
This should be fine.
And now we can go ahead and run our talker node.
So here we can see that default.
Hello.
World messages are pointing to the screen.
Now if I go back to my Ubuntu 20 machine.
I can open up another shell that only needs to have Ross two sauce on it, so I'll go ahead and do control
TW.
And here's my second instance, and so I will source my Ross Foxy install.
And we don't have to worry about the warning.
And then if now I go ahead and run a listener.
Right.
So there are no talker nodes running on this machine.
That only talker node is running on the Ubuntu 18 machine.
But because we have our bridge running here, we should be able to listen in on those messages over
the network because we set our ROS master Uri and our ROS IP address accordingly actually.
That's actually what I need to do here.
So before I go ahead and run that, I will need to set our Ros master Uri and our Ros IP in this terminal
since this is a new terminal.
Right with that.
Now I can go ahead and run the listener.
And here you can see the Ross Bridge detects that message coming from the Ross two and the Ross one.
It bridges it.
And here we can see I heard Hello World, which is matching with what is being sent from the Ubuntu
18 computer.
Cool.
And it's worth noting that this works both away, so go ahead and stop this listener note and I'll stop
the talker node on the other machine.
I'll go ahead and clear the screen on both of these.
But this also works from Ross two to Ross one.
So if you create any new nodes on your Ross two instance that you want your Ross one computer to subscribe
to.
It works the same way.
Instead of running the listener node, this time I can run the talker node.
So if we say talker, we can see we're publishing Hello World.
And then the counter variable, that's what this version of Talker looks like for Ross, too.
And now if I run the listener node on our Ubuntu 18 machine that is running only Ross one, the Ross
Bridge will show up that it's bridging the communications.
And we can see here that my Ross two publishing Hello World is being received on my Ross one machine
and it's receiving the Hello world messages just fine on the listener node.
Great.
I'll go ahead and stop those.
All right.
With that you can see how you can implement the Ross Bridge to connect Legacy Ross One Systems to newer
Ross two code bases.