How to create a string message in a ROS package with catkin correctly?
This is the output of catkin_make
that shows an error.
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ catkin_make
Base path: /home/notsotechnical/catkin_ws
Source space: /home/notsotechnical/catkin_ws/src
Build space: /home/notsotechnical/catkin_ws/build
Devel space: /home/notsotechnical/catkin_ws/devel
Install space: /home/notsotechnical/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/notsotechnical/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/notsotechnical/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- 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/notsotechni
cal/catkin_ws/build/test_results
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.17
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - repo_name_hw2
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'repo_name_hw2'
-- ==> add_subdirectory(repo_name_hw2)
-- Could NOT find roscpp (missing: roscpp_DIR)
-- Could not find the required component 'roscpp'. 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/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "roscpp" with any
of the following names:
roscppConfig.cmake
roscpp-config.cmake
Add the installation prefix of "roscpp" to CMAKE_PREFIX_PATH or set
"roscpp_DIR" to a directory containing one of the above files. If "roscpp"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
repo_name_hw2/CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/notsotechnical/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/notsotechnical/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:334: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$
I also tried the following:
notsotechnical@notsotechnical-VirtualBox:~$ export CMAKE_PREFIX_PATH=/home/notsotechnical/Programs
notsotechnical@notsotechnical-VirtualBox:~$ echo $CMAKE_PREFIX_PATH
/home/notsotechnical/Programs
notsotechnical@notsotechnical-VirtualBox:~$
Update
Hey I got rid of thw following errors by reinstalling ROS melodic:
Could not find a package configuration file provided by "roscpp" with any of the following names:
roscppConfig.cmake
roscpp-config.cmake
However, I got more errors :(
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ catkin_make
Base path: /home/notsotechnical/catkin_ws
Source space: /home/notsotechnical/catkin_ws/src
Build space: /home/notsotechnical/catkin_ws/build
Devel space: /home/notsotechnical/catkin_ws/devel
Install space: /home/notsotechnical/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/notsotechnical/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/notsotechnical/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- 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/notsotechnical/catkin_ws/build/test_results
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.17
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 2 packages in topological order:
-- ~~ - repo_name_hw2 ...
We're going to need some more information here. Can you show us your code (source, CMakeLists.txt, etc.) in addition to this output?
CMakerlist: https://drive.google.com/file/d/1ws3h...
I also tried the following: notsotechnical@notsotechnical-VirtualBox:~$ export CMAKE_PREFIX_PATH=/home/notsotechnical/Programs notsotechnical@notsotechnical-VirtualBox:~$ echo $CMAKE_PREFIX_PATH /home/notsotechnical/Programs notsotechnical@notsotechnical-VirtualBox:~$
Can you please update your question with the contents of the file instead of linking to it? That keeps the question self-contained (and useful to others in the future) if/when that link no longer works
It would also help to know what you have in
package.xml
, since it appears that your package is not able to findroscpp
package. It is inCMakeLists.txt
. If it is not declared as a dependency inpackage.xml
that could explain the error.When pasting code/files please remove the commented out boilerplate. Having a minimal working example makes it easier to see what is going on.
I'm not sure why, but it says "This content is forbidden" whenever I paste something that is long in the comment. package.xml: https://drive.google.com/file/d/1k2Wn...
@notSoTechnical That's because comments aren't for code, files, etc., they're for shorter exchanges. Codes, files, etc. should be put in questions as an update.