Service challenge – client and server
With this new challenge, you will practice everything that was covered in this chapter: custom service interfaces, service servers, and service clients.
We will use the turtle_controller
node we wrote in the previous chapter’s challenge as a starting point. We won’t create a new node here; instead, we will improve the existing code. You can either start from the code you wrote or from the code I provided in the ch5
folder of this book’s GitHub repository.
As always, I will explain what you need to do to complete the challenge, and then detail the most important points for the Python solution. You can find the complete solution code on GitHub for both Python and C++.
Challenge
This challenge is divided into two parts. I suggest following them in order.
Challenge 1 – service client
So far, our turtle_controller
node is subscribing to the /turtle1/pose
topic. In the subscriber callback, we send...