We can finally test our transmitter node and see how it is possible to receive messages from the Arduino
board and make them available in Ros.
Two topics.
To do this.
Let's open the Arduino IDE and let's start by connecting the Arduino board to our PC using a USB cable.
Next in the Arduino IDE.
Let's check the port to which our Arduino has been connected.
So in my case, this is the ACM zero port.
And now, since we have already uploaded the code within our Arduino board, we can close this one and
instead we can start running our node.
So to do so, we can open a new terminal and we can go into the workspace here.
Let's source it.
So the file setup dot bash that is in the install folder.
And now let's start our node.
So Ros to run.
And from the Arduino boot firmware package, let's start the simple serial.
Receiver.
Note here I'm running the cplusplus implementation of this node.
But if you want, you can start the python implementation by adding the suffix.py.
But before running the node, we also need to set the parameter port.
So we need to set a value for the parameter port of the simple serial receiver node.
So we do this with the flag Ross args, and then let's pass a parameter.
And so we set the parameter for the port that in my case is the ACM zero port.
So let's press enter and upon starting this node, initialize the serial communication with the Arduino
on the specified port and also listen for any new messages that are sent by the Arduino to publish them
within our Ros2 topic.
We can actually see that this topic already exists.
If we open a new terminal and if we use the command Ros2 topic list, we can see that there is the topic
serial receiver and also we can see which are the messages that are passing through this topic with
the command Ros2 Topic ACO.
And let's read from the serial receiver topic and here we can see all the messages that the Arduino
is sending to our PC through the serial port.
And so they are then republished within this ros2 topic.