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

roscpp dependency error

asked 2019-08-26 03:42:24 -0600

Adam gravatar image

updated 2019-08-26 09:58:29 -0600

Platform: ROS Melodic on Debian Stretch IDE: QtCreator

Hello,

I strictly followed installation guide and package creating tutorial on a fresh install of Debian Stretch for Ros Melodic to install my environment. Then I created a package using catkin_create_pkg in a workspace that is tested to be valid. Then I followed IDE's wiki page steps to write a piece of C++ code to try if it is working but I got a roscpp dependency error from CMAKE Could not find a package configuration file provided by "roscpp" with any of the following names:

Afterwards I tried to do it with catkin tools on a separate workspace using catkin create pkg and followed the steps for it again but still the same error.

Here is my CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
 project(pkg_a)

find_package(catkin REQUIRED COMPONENTS
  roscpp
)

include_directories(
  ${catkin_INCLUDE_DIRS}
)

I have three lines in my .bashrc file for sourcing the packages.

source /opt/ros/melodic/setup.bash source /home/<username>/catkin_ws/devel/setup.bash source /home/<username>/pkg_ws/devel/setup.bash #The last line added later on after trying to find a way with catkin tools

Links to the guides I followed

Installation: http://wiki.ros.org/melodic/Installat...

To setup the environment: http://wiki.ros.org/ROS/Tutorials/Ins...

To build packages with catkin_make: http://wiki.ros.org/ROS/Tutorials/Bui...

IDE setup: http://wiki.ros.org/IDEs

Output of env | grep -i ros | sort

CMAKE_PREFIX_PATH=/home/<username>/pkg_ws/devel:/home/<username>/catkin_ws/devel:/opt/ros/melodic
LD_LIBRARY_PATH=/home/<username>/pkg_ws/devel/lib:/home/<username>/catkin_ws/devel/lib:/opt/ros/melodic/lib
PATH=/opt/ros/melodic/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PKG_CONFIG_PATH=/home/<username>/pkg_ws/devel/lib/pkgconfig:/home/<username>/catkin_ws/devel/lib/pkgconfig:/opt/ros/melodic/lib/pkgconfig
PYTHONPATH=/home/<username>/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/melodic/lib/python2.7/dist-packages
ROS_DISTRO=melodic
ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROSLISP_PACKAGE_DIRECTORIES=/home/<username>/pkg_ws/devel/share/common-lisp:/home/<username>/catkin_ws/devel/share/common-lisp
ROS_MASTER_URI=http://localhost:11311
ROS_PACKAGE_PATH=/home/<username>/pkg_ws/src/pkg_a:/home/<username>/catkin_ws/src:/opt/ros/melodic/share
ROS_PYTHON_VERSION=2
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_VERSION=1

rospack find roscpp

/opt/ros/melodic/share/roscpp

@Solved

If anybody has the same issue; I made it work through making the changes to QtCreator in the IDEs wiki page section 3. catkin tools but made it run through the 2. method (catkin_make)

edit retag flag offensive close merge delete

Comments

I strictly followed installation guide and package creating tutorial on a fresh install of Debian Stretch for Ros Melodic to install my environment.

Please always link to any tutorials/guides/howtos/documentation you are using.

We don't always know what you refer to.


Edit: also add the output of env | grep -i ros | sort and rospack find roscpp to your question text. Use the edit button/link for that.

gvdhoorn gravatar image gvdhoorn  ( 2019-08-26 03:44:45 -0600 )edit
1

which directory did you run catkin_create_pkg? Also, is that your entire CMakelists file? I didn't see where you declared your cpp executable or linked the catkin libraries

prefpkg21 gravatar image prefpkg21  ( 2019-08-26 07:09:19 -0600 )edit

@prefpkg21

Managed to run CMake succesfully after creating a package using catkin tools but this time ros.h file couldn't be found.

Adam gravatar image Adam  ( 2019-08-26 07:50:15 -0600 )edit

does the CMakelists portion of your original post reflect the current file in your package?

prefpkg21 gravatar image prefpkg21  ( 2019-08-26 08:18:20 -0600 )edit

@prefpkg21

Actually yes, but the package created with catkin_create_pkg started working now. Thank you for the help

Adam gravatar image Adam  ( 2019-08-26 08:40:02 -0600 )edit

Please post your last edit as an answer and then accept your own answer.

gvdhoorn gravatar image gvdhoorn  ( 2019-08-26 10:02:03 -0600 )edit

@gvdhoorn Sorry I couldn't accept my answer because I dont have enough points.

Adam gravatar image Adam  ( 2019-08-27 03:21:38 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-08-27 03:20:51 -0600

Adam gravatar image

If anybody has the same issue; I made it work through making the changes to QtCreator in the IDEs wiki page section 3. catkin tools but made it run through the 2. method (catkin_make)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-08-26 03:42:24 -0600

Seen: 514 times

Last updated: Aug 27 '19