CMake Error in rosmsg tutorial
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
and
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">
<name>beginner_tutorials</name>
<version>0.0.0</version>
<description>The first test package</description>
<maintainer email="xxx">xxx</maintainer>
<license>GPLv3</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>message_runtime</exec_depend>
<export>
</export>
</package>
Content of CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
message_generation
)
add_message_files(
FILES
Num.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package()
include_directories(
${catkin_INCLUDE_DIRS}
)
Content of Num.msg:
int64 sum
string first_name
string last_name
unint8 age
uint32 score
Welcome!
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
andpackage.xml
files and msg definition using the preformatted text (101010
) buttonOh, 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?
Sorry, I don't understand your question.
Just paste your text into the editor, then highlight anything that should be formatted and click the
101010
button.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!
Are you sure that you're following my instructions? I just did exactly what they say and it worked.
After changing the xml- and txt-file, what did you do then?
I only removed the comments from your
CMakeLists.txt
to make it fit better and easier to read.