When to use services.

If you want to have a node perform quick computations or do some actions on demand (enabling/disabling a motor, starting/stopping a robot).

at the interface definition, you can see that the request and response are separated by three dashes (---). In the response,

How Create custom service interface

Make srv folder inside my_robot_interfaces package

.
├── CMakeLists.txt
├── msg
├── package.xml
└── **srv**

naming conventions for Service interfaces

create interface file

All the fields inside the definition must follow the snake_case convention (use underscores between words, all letters lowercase, and no space).

int64 reset_value
---
bool success
string message

Build the interface