WEBVTT

00:00.170 --> 00:06.170
We can finally test our transmitter node and see how it is possible to receive messages from the Arduino

00:06.170 --> 00:08.890
board and make them available in Ros.

00:08.900 --> 00:09.920
Two topics.

00:10.490 --> 00:11.330
To do this.

00:11.360 --> 00:19.550
Let's open the Arduino IDE and let's start by connecting the Arduino board to our PC using a USB cable.

00:24.070 --> 00:25.930
Next in the Arduino IDE.

00:26.260 --> 00:30.620
Let's check the port to which our Arduino has been connected.

00:30.640 --> 00:34.450
So in my case, this is the ACM zero port.

00:34.630 --> 00:41.830
And now, since we have already uploaded the code within our Arduino board, we can close this one and

00:41.830 --> 00:44.590
instead we can start running our node.

00:44.950 --> 00:52.150
So to do so, we can open a new terminal and we can go into the workspace here.

00:52.150 --> 00:53.320
Let's source it.

00:53.440 --> 00:57.760
So the file setup dot bash that is in the install folder.

00:58.000 --> 01:00.340
And now let's start our node.

01:00.370 --> 01:02.770
So Ros to run.

01:02.980 --> 01:11.710
And from the Arduino boot firmware package, let's start the simple serial.

01:13.700 --> 01:14.300
Receiver.

01:14.300 --> 01:18.420
Note here I'm running the cplusplus implementation of this node.

01:18.440 --> 01:24.500
But if you want, you can start the python implementation by adding the suffix.py.

01:26.010 --> 01:30.930
But before running the node, we also need to set the parameter port.

01:30.930 --> 01:36.030
So we need to set a value for the parameter port of the simple serial receiver node.

01:36.270 --> 01:42.600
So we do this with the flag Ross args, and then let's pass a parameter.

01:43.470 --> 01:50.400
And so we set the parameter for the port that in my case is the ACM zero port.

01:50.790 --> 01:57.900
So let's press enter and upon starting this node, initialize the serial communication with the Arduino

01:57.900 --> 02:04.590
on the specified port and also listen for any new messages that are sent by the Arduino to publish them

02:04.590 --> 02:06.480
within our Ros2 topic.

02:06.660 --> 02:09.930
We can actually see that this topic already exists.

02:10.110 --> 02:18.330
If we open a new terminal and if we use the command Ros2 topic list, we can see that there is the topic

02:18.330 --> 02:23.940
serial receiver and also we can see which are the messages that are passing through this topic with

02:23.940 --> 02:27.570
the command Ros2 Topic ACO.

02:27.690 --> 02:35.550
And let's read from the serial receiver topic and here we can see all the messages that the Arduino

02:35.550 --> 02:39.000
is sending to our PC through the serial port.

02:39.000 --> 02:42.420
And so they are then republished within this ros2 topic.
