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

catkin_make: cannot find 'std_msg'

asked 2018-02-08 09:04:09 -0500

dayogeorge gravatar image

updated 2018-02-11 09:06:11 -0500

I'm still in the process of setting up my ROS, I am getting an error message when i run this command

catkin_make

The above command is at step 4 here

Then i get this error Message:

Base path: /home/dayo/catkin_ws
Source space: /home/dayo/catkin_ws/src
Build space: /home/dayo/catkin_ws/build
Devel space: /home/dayo/catkin_ws/devel
Install space: /home/dayo/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/dayo/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/dayo/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/dayo/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.8
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
  Could not find a package configuration file provided by "std_msg" with any
  of the following names:
    std_msgConfig.cmake
    std_msg-config.cmake
  Add the installation prefix of "std_msg" to CMAKE_PREFIX_PATH or set
  "std_msg_DIR" to a directory containing one of the above files.  If
  "std_msg" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:10 (find_package)
-- Could not find the required component 'std_msg'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "std_msg" with any
  of the following names:
    std_msgConfig.cmake
    std_msg-config.cmake
  Add the installation prefix of "std_msg" to CMAKE_PREFIX_PATH or set
  "std_msg_DIR" to a directory containing one of the above files.  If
  "std_msg" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/dayo/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/dayo/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:290: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed*

This is the CMakeLists.txt :

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
)  

catkin_package()

include_directories(
  ${catkin_INCLUDE_DIRS}
)

This is the Package.xml :

<?xml version="1.0"?>
<package format="2">
  <name>beginner_tutorials</name>
  <version>0.0.0</version>
  <description>The beginner_tutorials package</description>
  <maintainer email="dayo@todo.todo">dayo</maintainer>
  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>rospy</build_depend>
  <build_depend>std_msgs</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>

  <export>
  </export>
</package>

These are the outputs of the following commands:

dpkg -l | grep std-msgs

ii  ros-kinetic-std-msgs                         0.5.11-0xenial-20171104-175741-0800                   amd64        Standard ROS Messages including common message ...
(more)
edit retag flag offensive close merge delete

Comments

1

#q208679 has the same error message, they were able to debug it with additional catkin output and contents of the package CMakeLists.txt

lucasw gravatar image lucasw  ( 2018-02-08 10:02:43 -0500 )edit

Please update your question with the entire terminal output. There isn't enough information to figure out what's going on here.

jayess gravatar image jayess  ( 2018-02-08 11:08:29 -0500 )edit

Can you post your package.xml and CMakeLists.txt?

jayess gravatar image jayess  ( 2018-02-08 13:19:49 -0500 )edit

i've updated the terminal output, pls check it out

dayogeorge gravatar image dayogeorge  ( 2018-02-08 13:31:53 -0500 )edit

please check the package.xml and CMakeLists.text

dayogeorge gravatar image dayogeorge  ( 2018-02-08 15:54:34 -0500 )edit

Can you please copy and paste those files again using the preformatted text (101010) button? The current formatting makes the contents of those files are unreadable. And please remove any comments to shorten the length of them too.

jayess gravatar image jayess  ( 2018-02-08 16:27:56 -0500 )edit

i have done that

dayogeorge gravatar image dayogeorge  ( 2018-02-08 18:22:39 -0500 )edit

It looks the same

jayess gravatar image jayess  ( 2018-02-08 18:33:53 -0500 )edit

i reposted the question while trying to effect the change you suggested but its still the same, maybe there is something i'm not getting. i'm new here. what else can i do

dayogeorge gravatar image dayogeorge  ( 2018-02-08 18:54:57 -0500 )edit

See #q270918 for how to use the preformatted text button

jayess gravatar image jayess  ( 2018-02-08 19:07:56 -0500 )edit

it says the page has been deleted

dayogeorge gravatar image dayogeorge  ( 2018-02-08 19:21:28 -0500 )edit

Sorry, #q270916

jayess gravatar image jayess  ( 2018-02-08 19:35:48 -0500 )edit

ok so i tried the post here but it was not working so i reposted the question and it is better. Please check for it

dayogeorge gravatar image dayogeorge  ( 2018-02-08 20:52:47 -0500 )edit

Please don't create a new question just to format your text. Open your CMakeLists.txt, copy the text, paste it into the editor here, then highlight the text, then click the preformatted text (101010) button. Then do the same with your package.xml file.

jayess gravatar image jayess  ( 2018-02-08 21:39:52 -0500 )edit
3

I've fixed the formatting of the CMakeLists.txt, but the package.xml is a wall of text.

@dayogeorge: please copy-paste your package.xml again into your question, select the text you just pasted, and click on the Preformattext Text button (or use ctrl+k).

gvdhoorn gravatar image gvdhoorn  ( 2018-02-09 02:13:49 -0500 )edit
1

@dayogeorge: how did you install ROS?

Could not find a package configuration file provided by "std_msg" [..]

std_msgs is part of the core of ROS. It would be really strange for it not to be installed.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-09 02:15:53 -0500 )edit

@dayogeorge may you try one trick because that help for me always , save your CMakeList.txt file first then go to your Src directory delete your CMakeList.txt and then use Catkin_make it will help you

lagankapoor gravatar image lagankapoor  ( 2018-02-09 02:27:45 -0500 )edit
1

@dayogeorge I removed the comments in your CMakeLists.txt file so that it's shorter but your package.xml file is still unreadable. Can you please copy and paste it again? This time please make sure that it's readable (properly indented, etc.).

jayess gravatar image jayess  ( 2018-02-09 20:17:25 -0500 )edit

thanks guys. Please check the package,xml now. So how should I proceed? I'm still at step 4 on this page: http://wiki.ros.org/ROS/Tutorials/Cre...

dayogeorge gravatar image dayogeorge  ( 2018-02-09 20:52:07 -0500 )edit
1

@dayogeorge How did you install ROS? Like @gvdhoorn said, std_msgs should have been installed with ROS.

jayess gravatar image jayess  ( 2018-02-09 22:13:42 -0500 )edit

i followed the steps on ros.org what do you suggest i do?

dayogeorge gravatar image dayogeorge  ( 2018-02-09 22:24:09 -0500 )edit
1

What steps? We don't know what platform you are using.

jayess gravatar image jayess  ( 2018-02-09 22:58:14 -0500 )edit

i'm trying to installing kinetic on ubuntu. Amd i'm following the steps here

dayogeorge gravatar image dayogeorge  ( 2018-02-10 03:17:28 -0500 )edit

Can you tell us the exact command you used to install ROS?

And please link to all tutorials you followed for the installation.

Reason we keep asking about this is that std_msgs should definitely be there, and we're trying to make sure it's not an installation issue before checking other things.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 03:21:00 -0500 )edit

i used this command:

sudo apt-get install ros-kinetic-desktop-full

And it can be foundhere

I basically just followed all the step highlighted in the link above

dayogeorge gravatar image dayogeorge  ( 2018-02-10 03:45:04 -0500 )edit

Ok. Please do this:

  1. open a new terminal
  2. source /opt/ros/kinetic/setup.bash
  3. dpkg -l | grep std-msgs
  4. rospack find std_msgs
  5. ls -al /opt/ros/kinetic/share/std_msgs

add the output of the last three commands to your OP (edit it).

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 03:47:23 -0500 )edit

Also: what is the output of which gcc?

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 04:10:57 -0500 )edit

Please check my edited post for the output of the commands above

dayogeorge gravatar image dayogeorge  ( 2018-02-10 05:03:07 -0500 )edit

That all looks ok. But there is something strange looking at the catkin_make output that you included in your OP: I don't see any mention of compilers or pthread. Even with an empty workspace catkin_make prints lines about that for me.

Can you remove any source ... lines from your ..

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 05:19:39 -0500 )edit

.. .bashrc file (if you have any), save it, and do the following:

  1. open a new terminal
  2. mkdir -p $HOME/test_ws/src
  3. cd $HOME/test_ws
  4. source /opt/ros/kinetic/setup.bash
  5. catkin_make

then copy-paste the whole output of catkin_make into your OP.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 05:21:03 -0500 )edit

And just making sure: your OS is Ubuntu 16.04 or Ubuntu Xenial, correct? lsb_release -a shows Ubuntu 16.04 and xenial?

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 05:22:49 -0500 )edit

yes my ubuntun is 16.04.3 LTS xenial. pls how do i access the .bashrc file?

dayogeorge gravatar image dayogeorge  ( 2018-02-10 05:45:24 -0500 )edit

It's in your home directory. Something like gedit $HOME/.bashrc should open it.

Look at the end. If there are lines like source /opt/ros/kinetic/setup.bash or source ~/catkin_ws/devel/setup.bash remove them. Save, close, follow steps in previous comment.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 05:47:39 -0500 )edit

thanks a lot bro. I removed the source and then i ran the commands. check the output of catkin_make in my edited post. Looks like it is done right?

dayogeorge gravatar image dayogeorge  ( 2018-02-10 06:15:19 -0500 )edit

I do not see any update.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 06:16:52 -0500 )edit

Re: new run of catkin_make: yes, that looks a lot better.

Can you now do:

  1. ls -al /home/dayo/catkin_ws
  2. ls -al /home/dayo/catkin_ws/src

and add the output to your OP?

It's good that things are now ok, but without knowing what caused the problems initially, it's hard to avoid it.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 07:22:59 -0500 )edit

you mean updates in terms of std_msgs?

dayogeorge gravatar image dayogeorge  ( 2018-02-10 07:30:33 -0500 )edit

No I meant that you had posted your comment "I've edited my post", but I did not see an updated post.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-10 07:39:49 -0500 )edit

pls check for all the outputs

dayogeorge gravatar image dayogeorge  ( 2018-02-10 09:12:43 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-02-11 17:36:20 -0500

clyde gravatar image

To state the obvious (and answer the question): the catkin_build output refers to std_msg instead of std_msgs. The revised CMakeLists.txt and package.xml in the question are correct. It should build now.

edit flag offensive delete link more

Comments

That would seem to be the actual answer, however, the initial CMakeLists.txt posted by @dayogeorge (rev7) already has this:

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs )

so either that is the CMakeLists.txt of a different pkg, or @dayogeorge forgot to tell us something.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-12 00:49:22 -0500 )edit

there is nothing more i'm not telling you..i followed the steps in the tutorials and i post the outputs

dayogeorge gravatar image dayogeorge  ( 2018-02-12 14:26:54 -0500 )edit

Did you find any solution for this problem? There is same problem for me.

Teyhan gravatar image Teyhan  ( 2019-06-04 02:37:48 -0500 )edit
1

answered 2019-11-26 05:48:25 -0500

Robotronics gravatar image

Hi , the command : " catkin_create_pkg beginner_tutorials std_msgs rospy roscpp " creates for you two files:

  1. package.xml
  2. CMakeLists.txt.

The folder name is std_msgs (with an s) while the folder containing package.xml and CMakeLists.txt has std_msg (without an s) embedded inside it.

To Solve: Simply edit package.xml and CMakeLists.txt and change all std_msg to std_msgs.

Save and Done!

edit flag offensive delete link more

Comments

this solved the issue, thanks!

adiManav gravatar image adiManav  ( 2021-10-29 23:48:50 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-02-08 09:04:09 -0500

Seen: 9,798 times

Last updated: Feb 11 '18