In this final laboratory lesson, we will create a new launch file and use it to start all the functionalities
that we have developed so far during the course with the real robot to which we will give comments through
the Voice assistant.
Let's start by creating a new launch file within the Arduino board, bring up package.
So here within the launch folder where we have already created the simulated robot dot launch, let's
add a new file called Real Robot Dot Launch.
Dot py.
And since most of the applications that we want to run for the real robot.
Work the same as for the real robot.
As for the simulation, we can copy the content of the simulated.
Robot and let's paste it here within the real robot.
But anyway, for the real robot, we are not going to need Gazebo, for example.
And also in this launch file, let's remove Gazebo here from the launch description.
And now all this left is to change the value of the is sim argument for the controller and set it to
false.
So if you remember in the previous lessons we have added an argument to the controller dot launch dot
pi.
So this one, the SEC.
And so let's customize this one to indicate that we want to launch the control system for the real robot.
So here, let's set this one to false.
And also let's do the same for Move It.
So let's set the argument is same to false and we can leave instead.
All the other instructions in the launch file unchanged as they are independent of whether we are using
the real robot or the simulated one.
Now everything is ready so we can finally see the result of our hard work.
And so we can start all the functionality, all the applications that we have developed in this course.
So let's connect the robot.
Or better, let's connect the Arduino board that controls the robot to the PC through a USB cable.
We have already uploaded the code on our board and so it is ready to take commands.
Now let's open a new terminal.
Let's go into the workspace and let's build it.
And so this will compile also the new launch file that we have created.
Now, within a new terminal, let's source the workspace.
And now we can start all the functionalities for our robot.
So with the command Ros to launch and from the Arduino bot, bring a package.
Let's start the real robot dot launch dot pi.
So let's press enter.
We can see that there is an error, so let's go back.
Most probably there is an error with the hardware interface and we can see the error here.
So the error is with the Ros2 control library.
And in fact we have we are using an invalid tag, so we have a typo.
So if we go back in Visual Studio code and if we open the Arduino board ros2 control, we can see that
the error is here.
The name of the tag is Zakro.
And then and unless so, let's save this.
Let's interrupt the execution of our launch file.
Now let's build the workspace again and let's give it one more try.
Here, we can see that there is also an error in loading the controllers.
So we can see that it wasn't able to loading the gripper controller.
The joint state broadcaster and neither the arm controller.
So if we go back to Visual Studio code, this is because if we go in the controller launch.
Here, we can see that there is a typo.
So here when we start the controller manager, we are passing the configuration file and we are passing
the Arduino board controller, but the name is Arduino board controllers.
So let's add the S here.
So let's save it again.
Let's interrupt the execution of the script and let's build it again.
Let's give it one more try.
Now we can see that the controllers are loaded correctly.
And everything is working.
So as we started this file, we can already see that the robot arm brings itself in the on position.
Now we can also start moving our robot arm by opening a new terminal.
And here let's start ngrok to communicate with Alexa.
So let's go to the download folder in which I have the ngrok and let's start it with the command and
rock.
Let's start an Http server and then we want to open the port 5000 of the PC.
Now, as you remember, as we are using the free version of Ngrok, we need to copy the new address
that it provides.
So let's copy this address here and let's paste it within the Alexa developer console.
So within our skill.
Let's go to the endpoint section and let's change the endpoint with the new one.
Let's save it.
And then now we can finally start sending comments to our real robot.
So let's put the developer here.
Let's go into the test section.
Let's put our RVs here.
So here in our RVs, we are going to see also the robot moving.
So we will see both the real robot and also in RVs here, the user interface, the robot moving.
So let's start interacting with Alexa.
Activate robot.
Hi.
How can I help?
Pick the pen.
Okay.
I'm moving.
And now, as you can see, the real robot.
And also we have its feedback in service.
They are moving into the peak position.