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

sensor_msgs - Can't build tutorial project

asked 2018-03-14 19:01:36 -0500

dharmaforone gravatar image

I am trying to pass images as messages in a simple ROS project. I'm a complete beginner in ROS and robotics. The tutorial I'm trying to follow is here:

http://wiki.ros.org/cv_bridge/Tutoria...

But I can't get past adding dependencies to the package and building it. Here are the commands I have used to create my project:

mkdir image_pkg_test
cd image_pkg_test/
mkdir -p catkin_ws/src
cd catkin_ws/
catkin_make
source devel/setup.bash
cd src
catkin_create_pkg image_msg_tests sensor_msgs opencv3 cv_bridge rospy roscpp std_msgs
cd ..
catkin_make

The catkin_make command fails with the following message:

CMake Error at /opt/ros/kinetic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:172 (find_package):
  Could not find a package configuration file provided by "sensor_msgs" with
  any of the following names:

    sensor_msgsConfig.cmake
    sensor_msgs-config.cmake

  Add the installation prefix of "sensor_msgs" to CMAKE_PREFIX_PATH or set
  "sensor_msgs_DIR" to a directory containing one of the above files.  If
  "sensor_msgs" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  image_msg_tests/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!

However, rospack find sensor_msgs shows:

/opt/ros/kinetic/share/sensor_msgs

So this package is at least partially installed. What am I doing wrong? How can I debug the issue more effectively?

edit retag flag offensive close merge delete

Comments

1

Is there a difference between this question and your other #q285467?

jayess gravatar image jayess  ( 2018-03-14 22:11:41 -0500 )edit

No. But the first time I tried to post it, I was required to register and there was no indication that the question was successfully posted after registering since it goes to moderation. I've deleted the other one.

dharmaforone gravatar image dharmaforone  ( 2018-03-14 23:23:35 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-03-18 08:37:41 -0500

dljubic gravatar image

pengjiawei answer will help you get it up and running.

However, since you are a beginner I would like to give you a couple of pieces of advice so that you avoid mistakes like this in the future.

  • As stated in the tutorial you should source your setup.bash because it gives you access to ROS commands (as stated in the tutorial). Also, you should do that in every new terminal you open, unless you put the command in .bashrc. You can find more about it here and more about source command here.
  • Furthermore, I think it is a good practice to have a ROS folder in your home folder and, inside it, catkin workspaces you are working on. That way, you would have all your catkin workspaces in ROS folder and in every workspace you would have some ROS packages related to that workspace.

If you have any further question, feel free to ask.

edit flag offensive delete link more
0

answered 2018-03-15 22:34:53 -0500

updated 2018-03-15 22:35:08 -0500

try this

source /opt/ros/kinetic/setup.bash

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-03-14 19:01:36 -0500

Seen: 4,543 times

Last updated: Mar 18 '18