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

Creating a ROS msg and srv - Tutorial

asked 2015-02-20 06:06:14 -0600

bluefish gravatar image

updated 2015-02-20 08:55:06 -0600

Hi!

I have the same problem as mentioned here: Error using rosmsg in "Creating msg and srv" Tutorial

In section 2.2 of this tutorial when typing the command

$ rosmsg show beginner_tutorials/Num

I don't get

init64 num

but

Unable to load msg [beginner_tutorials/Num]: Cannot locate message [Num]: unknown package [beginner_tutorials] on search path ...

In the other thread the solution is: I should simply run:

$ cd ~/catkin_ws/ then $ catkin_make

But there I get the Error:

CMake Error at /home/user/catkin_ws/build/beginner_tutorials/cmake/beginner_tutorials-genmsg.cmake:3 (message):
Could not find messages which '/home/user/catkin_ws/src/beginner_tutorials/msg/Num.msg' depends on.
Did you forget to specify generate_messages(DEPENDENCIES ...)?

Cannot locate message [init64] in package [beginner_tutorials] with paths
[['/home/user/catkin_ws/src/beginner_tutorials/msg']] Call Stack (most recent call first): /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:304 (include)
beginner_tutorials/CMakeLists.txt:68 (generate_messages)

-- Configuring incomplete, errors occurred! See also "/home/user/catkin_ws/build/CMakeFiles/CMakeOutput.log". See also "/home/user/catkin_ws/build/CMakeFiles/CMakeError.log". make: * [cmake_check_build_system] Error 1 Invoking "make cmake_check_build_system" failed

What do I do wrong. I changed the CMakeList.txt exactly as said in the tutorials and checked it a lot of times. And I put in

catkin_package(CATKIN_DEPENDS message_runtime)

Can anybody help me out here? Thanks!!

Edit:

Here is the CMakeLists.txt (I removed the commented parts):

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
)
include_directories(
  ${catkin_INCLUDE_DIRS}
)

And here the package.xml:

<?xml version="1.0"?>
<package>
  <name>beginner_tutorials</name>
  <version>0.0.0</version>
  <description>The package for beginners</description>


  <maintainer email="user@todo.todo">user</maintainer>

  <license>TODO</license>


  <build_depend>message_generation</build_depend>

  <run_depend>message_runtime</run_depend>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>rospy</build_depend>
  <build_depend>std_msgs</build_depend>
  <run_depend>roscpp</run_depend>
  <run_depend>rospy</run_depend>
  <run_depend>std_msgs</run_depend>

  <export>

  </export>
</package>
edit retag flag offensive close merge delete

Comments

Did you save the file as said iin the tutorial? Could you please entirely post your CMakeLists.txt und package.xml ?

Andromeda gravatar image Andromeda  ( 2015-02-20 07:55:14 -0600 )edit

Thanks for your comment! Yes, I saved it here: ~/catkin_ws/src/beginner_tutorials

bluefish gravatar image bluefish  ( 2015-02-20 08:48:02 -0600 )edit

I put in both files in the edit above.

bluefish gravatar image bluefish  ( 2015-02-20 08:55:36 -0600 )edit

Does your Num.msg file actually say init64 num? It should say int64 num (you have an extra 'i'). That typing error would explain why you are getting the "Cannot locate message [init64]" when running catkin_make

jarvisschultz gravatar image jarvisschultz  ( 2015-02-20 09:59:25 -0600 )edit

And what happen if you type simply:

$ rosmsg show Num

????? without the folder name

Andromeda gravatar image Andromeda  ( 2015-02-20 10:44:44 -0600 )edit

Thanks so much javisschultz and Andromeda!! I really put in that extra "i". And I tried to find that error for hours. So stupid....

Sorry for bothering you with that and thanks again!!

bluefish gravatar image bluefish  ( 2015-02-20 11:03:18 -0600 )edit

I face the same problem. I changed the CMakeList.txt exactly as said in the tutorials and checked it a lot of times. When I try to ~/catkin_ws/src/beginner_tutorials$ rosmsg show Num,it returns Could not find msg 'Num'. Can anybody help me out here? Thanks!!

JarvisRobot gravatar image JarvisRobot  ( 2016-12-07 11:11:56 -0600 )edit

The command should be rosmsg show beginner_tutorials/Num

jarvisschultz gravatar image jarvisschultz  ( 2016-12-08 07:42:48 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-02-20 09:44:20 -0600

dornhege gravatar image

There is a typo: init64 instead of int64.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-02-20 06:06:14 -0600

Seen: 3,379 times

Last updated: Feb 20 '15