Error when creating the get_pose service

Hello,
I am working through Ex 3.5, and am trying to create a service for which the response is a Point and a Quaternion. This means that the srv file is the one below.


Point position
Quaternion orientation

I followed (what I believed to be) the necessary steps to support this service declaration, but am getting the following error when running catkin_make (after sourcing).

CMake Error at /home/user/catkin_ws/build/get_pose/cmake/get_pose-genmsg.cmake:3 (message):
** Could not find messages which**
** ‘/home/user/catkin_ws/src/get_pose/srv/get_pose.srv’ depends on. Did you**
** forget to specify generate_messages(DEPENDENCIES …)?**

** Cannot locate message [Point] in package [get_pose] with paths**
** [[’/home/user/catkin_ws/src/get_pose/msg’]]**
Call Stack (most recent call first):

I have introduced the following changes to cmake:

find_package(catkin REQUIRED COMPONENTS
rospy
std_msgs
geometry_msgs
message_generation
)

generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
)

add_service_files(
FILES
get_pose.srv

Service1.srv

Service2.srv

)

Any idea what I am doing wrong ?
Thank you!

Hi @sarah.e.keren
Make sure these 3 dependencies are also included in your package.xml (like the following example for geometry_msgs)

 <build_depend>geometry_msgs</build_depend>
 <exec_depend>geometry_msgs</exec_depend>

That did the trick, thank you !

1 Like

Hello guys,
How did you link the service with the topic /amcl_pose?
Thank you!!