In this laboratory lesson, we will apply everything we have learned so far in the course to visualize
the Erdf model of the robot in RV's.
To do this, we will use the Ros two parameters to configure some nodes that allows us to publish the
Erdf model within some Ros.
Two topics where Arviz will read the information needed to display the robot so including its links
and joints in its graphical interface.
So let's start by opening a new terminal and let's go to the workspace.
Let's source it.
So let's source the setup dot bash file.
And now let's start by running the robot estate publisher node.
So with the Ros two run command and from the robot state publisher package, let's start the robot state
publisher node.
This node has discussed in the theoretical lessons is a general purpose node that is developed to publish
the RDF model of any robot within our Ros two topic.
Therefore we need to configure it to publish the RDF model of our robot.
So let's assign a value to a parameter that this node offers.
And so as we learned in the previous lesson, to assign a parameter to a node, we use the Ros args
and then minus P to assign a value to the parameter robot
description.
And so since we used the exact format to write the RDF model of our robot, but actually still the official
accepted format for modeling robots is Erdf in Ros two, we first need to convert the model into a plain
Erdf model before passing it to the robot description parameter.
To do so, we can use a small trick, let's say.
And so we can use a command within the parentheses and the command is.
And then to this one we need to pass the directory of the Erdf model, which in my case is located in
OLM, Alien Arduino Bot Workspace.
And then it is in the source folder in the Arduino bot.
Description in the DF and the model is called Arduino bot dot Urdf dot Zarco.
So you have to substitute this directory here with the directory on your PC of the Arduino bot Urdf
Hexaco model.
So let's press enter and now we can leave this node up and running.
So basically we can leave this node publishing the model of the robot within a certain topic.
Now let's split the terminal.
So let's open a new window and here let's again source the workspace.
So the file setup dot bash and let's start a new node with the command Ros to run and this time from
the joint state publish GUI package.
Let's start the joint state publisher, GUI node.
So let's press enter and this starts a graphical interface with some sliders which corresponds to all
the movable joints of our robot which we can use then to move around our urdf model.
So first, in order to see our robot moving, we need to launch our So still opening a new terminal.
Let's again source it.
And now let's run our RVs as if it was a normal Ros two node.
So, Ros to run.
And from the RVs to package.
Let's start RV two.
Here.
This is the RV's window.
And as a first step, as you can see here, we have an error saying that the global status so the fixed
frame map doesn't exist because our first frame was the frame world.
So let's change this one to be the frame world, the first frame of our model.
Now everything is fine and we can add some visualization.
So in order to visualize the links that make up the robot.
And so let's click on Add and let's visualize the TF.
So let's press enter.
And this message contains the position and the orientation of all the links of the robot.
And this one is published by the robot state publisher node, which here we left running.
So it is still in execution.
And now we can also display the robot meshes that are associated with each of these links.
So this is just the structure.
In order to visualize also the meshes, let's add a new plugin and this one is the robot model.
So let's press Enter.
And this plugin basically is subscribed to a topic where the robot description is published and it uses
this topic to display the meshes.
So let's change the name of the topic here.
So here the description is topic and we need to check the robot description.
So let's press enter.
And now we can see that the meshes of the robot are all in place.
Also, we can see that if we take the joint state publisher, so this window here and we move these
sliders.
The robot is moving accordingly so we can move all the joints.
And also we can open and close the gripper.
Before closing this window.
Let's save the current configuration.
So let's save the current configuration in which we have added the visualization of the TF plugin and
the robot model so that the next time that we want to visualize this model, we don't have to add them
manually.
So let's go to file save config as and then let's go into our workspace.
So here in the source folder in the Arduino bot description and here let's create a new folder called
RVs.
And within this folder let's call this visualization display dot RVs.
So let's save this file.
As a conclusion in this laboratory lesson.
I want to point out the number of steps that we had to perform and also the number of terminals that
we had to open in order to visualize and move our robot in RVs.
In the next lessons, we will see how to simplify all of these operations with the use of a single command.
Thanks to the launch files that are available in Ros two.