Now that we have modeled our robot following the Urdf convention, we can move on and visualize it using
one of the most useful tools available in Ros two.
We are talking about RVs.
RV indicates the second version of the Ros visualization tool.
And this is a graphical interface that allows us to visualize the content of some Ros two messages that
are published on some topics.
The way it works is very simple, and it basically uses the publisher subscriber communication protocol.
In fact, are these creates a subscriber node that receives messages from one or more ros2 topics.
Whenever a new message is published on a topic, the subscriber receives it and interprets it based
on the message type, and then it displays it in the GUI in an understandable and intuitive way.
Arby's provides several plugins for the visualization of the most common rescue messages.
For example, it is possible to visualize the map of a building that the robot can use for the navigation
purposes in which three areas are marked in white occupied areas are marked in black and unknown areas
or unexploited areas are marked in gray.
It is also possible to visualize data from the robot sensors such as laser scanner, that measure the
distance from obstacles.
And that you can see here in Irvis represented as a set of red points or even it is possible to visualize
images coming from the cameras that might be mounted on the robot.
All of this information that we can visualize with RVs are basically transmitted as standard rescue
messages in some ros2 topic.
And so arviz simply allows us to visualize such messages with plugins that can interpret the message
and create an understandable and user friendly visualization for it.
I will try to give you some more examples to convince you that this is a key tool in the hands of any
robotic software developer and that you will always find yourself using it.
For this reason, I want to introduce you to this tool so early in the course so that you have time
to play and to experiment with it.
Until now, we have worked only with string messages in Ros2 and so with messages that were really simple
to read and visualize in the terminal just by using the command Ros2 topic Echo.
And so actually we didn't need to use a graphical interface like Arviz to visualize this kind of information.
However, very often the messages that pass in the topics can be very complex and almost impossible
to read and to understand only by displaying their content in the terminal.
For example, this is what happened.
If we use the command Ros2 topic echo to read the content of a topic where a map message is being published.
The message Thatrillionepresents.
A map is called occupancy grid and contains a very long vector full of numbers, each of them representing
a single cell, a single pixel of the map, and also it has a number associated with it that indicates
if the area of the map is free, occupied by an obstacle or unknown.
So still unexplored.
Let's assume that you implemented your code that adds some obstacles to the map and you want to actually
see that it works.
And so that these obstacles have been added in the correct position of the map.
It would be impossible for you to do so only by reading the message in the terminal, just using the
command Ros2 topic echo and by reading one by one each value each pixel of the map.
For this reason, we use RVs to view in a clearer and more understandable way the content of this message.
Similarly in the Ross, two topics can also be published.
All those messages that contain the sensor readings such as laser scanner.
Also in this case, the message that is published in the scan topic is incomprehensible.
If you just read its content in the console, since it contains the distances from the obstacles in
all the directions that are detected by the laser scanner.
Finally, if I still haven't convinced you to use our reach to analyze all the messages that are published
in the two topics, consider also that this not only allows you to visualize the difficult messages
to understand, but it also does that when these messages are being published with high frequency in
those two topics, consider, for example, the case of the streaming video coming from a camera.
In this case, not only you have a message that is difficult to understand since it contains RGB colors
of each pixel of the image, but also since we are dealing with a streaming video.
This is obtained by constantly publishing images frames with high frequency inside the topic.
In the following lessons of this section, we will use this tool to visualize our RDF model of the robot,
and then along the course we will continue using it to visualize other messages that are still published,
still available in some Ros topics.