Answer of Exercise 3.5

Try to have a service server that contains the callback of the subscriber of /amcl_pose message, and create a custom .srv to load the subscriber result as its response. The .srv response is:
Header header
PoseWithCovariance pose

However the catkin_make failed with the reply:

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/pose.srv’ depends on. Did you
forget to specify generate_messages(DEPENDENCIES …)?

Cannot locate message [PoseWithCovariance]: unknown package [get_pose] on
search path [{{‘std_msgs’: [’/opt/ros/noetic/share/std_msgs/cmake/…/msg’],
‘geometry_msgs’: [’/opt/ros/noetic/share/geometry_msgs/cmake/…/msg’]}}]
Call Stack (most recent call first):
/opt/ros/noetic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
get_pose/CMakeLists.txt:71 (generate_messages)

Not sure if my concept is correct? If yes, what portion is wrong? It will be great if there are answers of Exercise 3.5 which can be shared for the reference.

Hello @Kane168 ,

You can find a link to the solutions of the exercises at the end of the chapter.

Thanks a lot Alberto