ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

message_runtime in CMakeLists.txt

asked 2020-04-11 05:56:29 -0600

N.N.Huy gravatar image

updated 2020-04-11 06:00:26 -0600

Hello everyone, when we need to declare message_runtime and geometry_msgs in the part catkin_package() in CMakeLists.txt ? For example:

catkin_package(
 INCLUDE_DIRS include
 LIBRARIES beginner_tutorials
 CATKIN_DEPENDS roscpp rospy std_msgs sensor_msgs geometry_msgs message_runtime
 DEPENDS system_lib
)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-04-12 05:39:47 -0600

Weasfas gravatar image

Hi @N.N.Huy,

The term CATKIN_DEPENDS refers to other catkin projects that your project depends on, thus if you not fullfil all dependencies the package will not be compiled and/or installed in your machine.

Knowing that, when you place the geometry_msgs, it means that in some part of your source files you are going to use a definition that is implemented in that particular package, like the msg types: Point, Twist, Pose etc.

In the same way, message_runtime is a package used for build-time dependencies to generate language bindings of messages. This means that is the package in charge of compiling and generating all the needed files when you add a custom msg type, service, action etc. in your package. Hence, when you have in your package a custom msg type, you will need to include the message_runtime dependency in order to tell Catkin and Cmake that your projects contains custom types and it needs to compile all headers and files for you to ble able to include those in your code.

You can find more information about Catkin and message_runtime here.

edit flag offensive delete link more

Comments

Thank you so much :) !

N.N.Huy gravatar image N.N.Huy  ( 2020-04-15 04:19:40 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-04-11 05:56:29 -0600

Seen: 577 times

Last updated: Apr 12 '20