Ask Your Question

CMake Error in rosmsg tutorial

asked 2018-03-01 16:49:27 -0600

AlexChris003 gravatar image

updated 2018-03-01 17:32:34 -0600

jayess gravatar image

I am in the tutorial at CreateMsgAndSrv and got stuck at chapter 3. Running the command

$ rosmsg show beginner_tutorials/Num

got me the following

Unable to load msg [beginner_tutorials/Num]: Cannot locate message [unint8] in package [beginner_tutorials] with paths [['/home/aha/catkin_ws/src/beginner_tutorials/msg', '/home/aha/catkin_ws/devel/share/beginner_tutorials/msg']]

and searching the web for a solution I stumbled upon a thread where someone had somewhat the same problem and said that he made a

catkin_make install

after the changes at the package.xml and CMakeLists.txt which I did not. But it made sense so I ran the command and then got the following error during the install process

CMake Error at /home/aha/catkin_ws/build/beginner_tutorials/cmake/beginner_tutorials-genmsg.cmake:3    (message):                                                                                             Could not find messages which                                                                          '/home/aha/catkin_ws/src/beginner_tutorials/msg/Num.msg' depends on.                                    Did you forget to specify generate_messages(DEPENDENCIES ...)?                                                         Cannot locate message [unint8] in  package [beginner_tutorials] with paths [['/home/aha/catkin_ws/src/beginner_tutorials/msg']]                                                                                    Call Stack (most recent call first): /opt/ros/kinetic/share/genmsg/cmake/genmsg-extras.cmake:307 (include) beginner_tutorials/CMakeLists.txt:71 (generate_messages)

But I followed the tutorial as it is written and did not forget to specify/uncomment "generate_messages". As I am a Newbie, I am kind of lost now and do not really know how to proceed. Can someone help me out?

System is Ubuntu 16.04 LTS, the ROS-Version is Kinetic and I added

source /opt/ros/kinetic/setup.bash


source ~/catkin_ws/devel/setup.bash

to my ~/.bashrc. Hope this sufficient information for the beginning...

EDIT1: Content of package.xml:

<?xml version="1.0"?>
<package format="2">
  <description>The first test package</description>

  <maintainer email="xxx">xxx</maintainer>





Content of CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.3)

find_package(catkin REQUIRED COMPONENTS





Content of Num.msg:

int64 sum
string first_name
string last_name
unint8 age
uint32 score
edit retag flag offensive close merge delete



I stumbled upon a thread

Can you please update your question with a link to the thread that you're referring to? Also, please update your question with a copy and paste of your CMakeLists.txt and package.xml files and msg definition using the preformatted text (101010) button

jayess gravatar imagejayess ( 2018-03-01 17:03:15 -0600 )edit

Oh, sure! Sorry that I didn't think of it before. Is there an easy way to add parapgraphs without getting the text out of the preformatted text field?

AlexChris003 gravatar imageAlexChris003 ( 2018-03-01 17:04:28 -0600 )edit

Sorry, I don't understand your question.

jayess gravatar imagejayess ( 2018-03-01 17:15:20 -0600 )edit

Just paste your text into the editor, then highlight anything that should be formatted and click the 101010 button.

jayess gravatar imagejayess ( 2018-03-01 17:22:01 -0600 )edit

seems not to work...followed you instructions but nothing happens :/

EDIT: no it worked, my browser did't show it properly to my, sorry again!

AlexChris003 gravatar imageAlexChris003 ( 2018-03-01 17:25:24 -0600 )edit

Are you sure that you're following my instructions? I just did exactly what they say and it worked.

jayess gravatar imagejayess ( 2018-03-01 17:26:48 -0600 )edit

After changing the xml- and txt-file, what did you do then?

AlexChris003 gravatar imageAlexChris003 ( 2018-03-01 17:33:34 -0600 )edit

I only removed the comments from your CMakeLists.txt to make it fit better and easier to read.

jayess gravatar imagejayess ( 2018-03-01 17:39:47 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-01 17:34:45 -0600

jayess gravatar image

It looks like there's a typo in your message definition. You have unint8 instead of uint8 for the age property

int64 sum
string first_name
string last_name
unint8 age          # right here
uint32 score

It should be

int64 sum
string first_name
string last_name
uint8 age
uint32 score
edit flag offensive delete link more


.... god I'm gonna burrow my self very very very deep sooo sorry for asking a stupid question and in the end it is a typo.... I mean, it is also clearly visible in the error message -.- Thank you very much for the quick help!!!

AlexChris003 gravatar imageAlexChris003 ( 2018-03-01 17:42:45 -0600 )edit

No worries, we've all been there. Please click on the check mark to mark this answer as correct.

jayess gravatar imagejayess ( 2018-03-01 17:43:47 -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

1 follower


Asked: 2018-03-01 16:49:27 -0600

Seen: 816 times

Last updated: Mar 01 '18