ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

compiling msg

asked 2016-04-03 05:15:25 -0600

jester gravatar image

updated 2016-04-03 06:44:07 -0600

Hi,

everytime, when I compile my package from scratch,

I have to comment out some lines in my CMakeList.txt

  • addexecutable(file file.cpp )
  • target_link_libraries(file {catkin_LIBRARIES} )

Afterwards it can compile my custom msg and then I include those lines and the project is ready to use.

What must I do that I can compile it as once?

regard, Peter

edit retag flag offensive close merge delete

Comments

Please edit your post and provide more information, such as your entire CMakeLists.txt file (without all the comments though).

spmaniato gravatar image spmaniato  ( 2016-04-03 15:52:06 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2016-04-03 19:53:31 -0600

tfoote gravatar image

You are missing a dependency on the message generation to make sure that the message generation runs before the executable tries to compile.

If you edit your post to show the compile error and your CMakeLists.txt we can probably help you more.

edit flag offensive delete link more
1

answered 2016-04-04 15:16:31 -0600

NEngelhard gravatar image

You could also think about your design. It's often useful to separate the message (service, action) definitions from your code and to create a *_msgs package. This can for example be useful if your code needs some special libraries or takes long to compile. If you now want to just have an action client on another computer, you'd have to fulfill all dependencies just to generate the message files. If however you have a separate msgs-package, you only have to compile the messages.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-04-03 05:15:25 -0600

Seen: 474 times

Last updated: Apr 04 '16