Exercise 2.4 drone course

hello. im doiing Exercise 2.4 in drone couse.
im trying to make the srv msg but when i build i got the error:
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:196 (message):
catkin_package() the catkin package ‘message_runtime’ has been
find_package()-ed but is not listed as a build dependency in the
package.xml
Call Stack (most recent call first):

i add the message_runtime to the package.xml and i still got the same error.
anyone can help me?

Hi Scotvers, can you publish your file CMakeList.txt?

Hi @Scotvers ,

As far as I know, you do not add message_runtime under find_package() or catkin_package().
You add message_runtime only under package.xml as build_export_depend and exec_depend.
But you should have message_generation under find_package and catkin_package.

Regards,
Girish

yes

cmake_minimum_required(VERSION 3.0.2)

project(my_service_pkg)

find_package(catkin REQUIRED COMPONENTS
rospy
std_msgs
message_runtime
message_generation

)

add_service_files(
FILES
drone_msg.srv
)

generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(

CATKIN_DEPENDS rospy std_msgs message_runtime

)

include_directories(

include

${catkin_INCLUDE_DIRS}

)

In find _package only the packages needed for compilation are declared, message_generation is the package for this purpose, message_runtime is the package needed for the execution of already compiled messages, delete “message_runtime” from find_package. In catkin_package should be provided the packages that other people would need if they wanted to use them. If someone wants to use your “already compiled” package they would need the “message_runtime” package. I understand it that way.

thank you very much . it works

Hi @Scotvers ,

Please mark the corresponding post as “Solution” so this issue thread can be closed.

Regards,
Girish