Activity 03 - ROS 2 Services

Let’s practice with ROS 2 Services!

You will start from the Topic activity you did in the last section on Topics.

Here is what you got:

Quick recap:

And now, here is what you’ll add:

Add a functionality to reset the counter to zero:

We will then call the service directly from the command line. You can also decide - for more practice - to create your own custom node to call this “/reset_counter” service.

And of course, as always, you can do the activity for both the Python and Cpp versions.

I’ll see you in the next lecture for the solution.