cd ~/ros2_ws/src/hexa_robot_interfaces
mkdir srv
cd srv
touch ComputeRectangleArea.srv

fill the contents of the srv

float64 length
float64 width
---
float64 area

other setups are equal to building msg in package.xml and CMakeLists.txt

Just add more interfaces like msg.

Untitled

build colcon

colcon build --packages-select hexa_robot_interfaces

check if it works

ros2 interface show hexa_robot_interfaces/srv/ComputeRectangleArea