Ask Your Question
0

Cmake error when genmsg is added to the CMakeLists.txt during message creation

asked 2017-02-08 10:30:14 -0500

sam26 gravatar image

updated 2017-02-09 02:48:24 -0500

gvdhoorn gravatar image

During the creation of a .msg file as mentioned in the ros tutorial, I have added genmsg package as well along with std_msgs [ in package.xml and also in CMakeLists.txt at find_package(...) ,catkin_package(...) and generate_messages(...) areas ]. When I catkin_make install after this , a CMake error related to genmsg-cmake is popping up and when I exclude genmsg from CMakeList file, the error disappeared. Why is it so ? Also , how do I decide on what dependencies to add when creating a .msg file ? Thank you in advance.


  1. yes , creating ros msg and srv is the tutorial I was referring to.
  2. C:\fakepath\1.PNG - Since the particular example used only std_msgs as a dependency , I was thinking if genmsg could also be added as another dependency ?[ how do we decide which package our created .msg file should depend on ? ]
  3. So, after adding genmsg as well ,to the dependency list in CMakeLists.txt , the following error popped up when I catkin_make install ( the last step in creating the message , "common step for msg and srv" as the tutorial mentions. ) C:\fakepath\2.png

Please let me know if you still require any additional information to clarify . Thanks !

edit retag flag offensive close merge delete

Comments

@sam26: please EDIT your original question if you want to provide us with more information. Posting answers should only be done if you are answering your own question. This is not a regular forum, but a Q&A site. I've merged your update/answer into your question, but please keep it in mind.

gvdhoorn gravatar imagegvdhoorn ( 2017-02-09 01:23:38 -0500 )edit

@sam26: also please don't use screenshots for showing us console text. It doesn't make sense. Just copy-paste the text from your console into your question. Then use the Preformatted Text button to format it.

gvdhoorn gravatar imagegvdhoorn ( 2017-02-09 02:48:15 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-02-08 11:44:29 -0500

gvdhoorn gravatar image

updated 2017-02-09 02:49:03 -0500

I'm not sure, but is Creating a ROS msg and srv the "ros tutorial" you refer to?

Can you tell us where it asks you to add genmsg? I can't find it on that page.

Also , how do I decide on what dependencies to add when creating a .msg file ? Thank you in advance.

Please see catkin 0.7.4 documentation » How to do common tasks » Package format 2 (recommended) » Building messages, services or actions (in addition to the tutorial you linked).

When I catkin_make install after this , a CMake error related to genmsg-cmake is popping up and when I exclude genmsg from CMakeList file, the error disappeared.

Btw: when asking questions about "errors" it would help if you would include those errors, as we cannot guess what you are seeing, and that makes it very hard to help you.


Edit:

2 . Since the particular example used only std_msgs as a dependency , I was thinking if genmsg could also be added as another dependency ?

No. genmsg is a package that is related to msg code generation, but should not be directly used when creating message packages, such as you are doing.

The tutorial also does not ask you to include that package, anywhere.

how do we decide which package our created .msg file should depend on ?

Well, same as how you decide which package you depend on for other things: which package provides the message definition that you use in your own .msg file? For anything from std_msgs, specify a dependency on std_msgs. For anything you use from geometry_msgs, specify a dependency on geometry_msgs. Etc.

3 . So, after adding genmsg as well ,to the dependency list in CMakeLists.txt, the following error popped up when I catkin_make install ( the last step in creating the message , "common step for msg and srv" as the tutorial mentions. ) C:\fakepath\2.png

I don't think it makes sense to try and debug this: don't add genmsg as a dependency when you just want to create your own messages. It's not needed.

Please also see catkin 0.7.4 documentation » How to do common tasks » Package format 2 (recommended) » Building messages, services or actions for additional information.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-08 10:30:14 -0500

Seen: 327 times

Last updated: Feb 09 '17