catkin_make cannot find any package
(Ubuntu 20.04, Ros noetic) Hello all! I followed the Tutorials to create a package with catkin_create_pkg
. The package was created successfully. When I tried catkin_make
, there is no error but it did not find the package. Also nothing happened in the devel
folder. I think there should be "~~ traversing packages in topological order: ~~ - beginner_tutorials" after catkin_make according to the tutorial. I wonder why nothing happened.
adamchy@ubuntu:~/catkin_ws/src$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp
Created file beginner_tutorials/package.xml
Created file beginner_tutorials/CMakeLists.txt
Created folder beginner_tutorials/include/beginner_tutorials
Created folder beginner_tutorials/src
Successfully created files in /home/adamchy/catkin_ws/src/beginner_tutorials. Please adjust the values in
adamchy@ubuntu:~/catkin_ws/src$ cd beginner_tutorials
adamchy@ubuntu:~/catkin_ws/src/beginner_tutorials$ ls
CMakeLists.txt include package.xml src
adamchy@ubuntu:~/catkin_ws/src$ ls
beginner_tutorials CMakeLists.txt test_pkg
And the catkin_make
:
adamchy@ubuntu:~/catkin_ws$ catkin_make
Base path: /home/adamchy/catkin_ws
Source space: /home/adamchy/catkin_ws/src
Build space: /home/adamchy/catkin_ws/build
Devel space: /home/adamchy/catkin_ws/devel
Install space: /home/adamchy/catkin_ws/install
####
#### Running command: "cmake /home/adamchy/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/adamchy/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/adamchy/catkin_ws/install -G Unix Makefiles" in "/home/adamchy/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/adamchy/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/adamchy/catkin_ws/devel;/opt/ros/noetic
-- This workspace overlays: /home/adamchy/catkin_ws/devel;/opt/ros/noetic
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3")
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using Debian Python package layout
-- Using empy: /usr/lib/python3/dist-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/adamchy/catkin_ws/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python3 (found version "3.8.10")
-- Using Python nosetests: /usr/bin/nosetests3
-- catkin 0.8.10
-- BUILD_SHARED_LIBS is on
-- Configuring done
-- Generating done
-- Build files have been written to: /home/adamchy/catkin_ws/build
####
#### Running command: "make -j4 -l4" in "/home/adamchy/catkin_ws/build"
####
I also tried the latter steps in the tutorials, the packages in catkin_ws/src
folder also cannot be showed when catkin_make
.They cannot be compiled into the devel folder. So I think the problem is in the former step above. How to fix this problem. Please!
PS:~/catkin_ws/src/beginner_tutorials/CMakeLists.txt
.(I haven't edited it, just deleted the part with #)
cmake_minimum_required(VERSION 3.0.2)
project(beginner_tutorials)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
)
################################################
## Declare ROS messages, services and actions ##
################################################
################################################
## Declare ROS dynamic reconfigure parameters ##
################################################
###################################
## catkin specific configuration ##
###################################
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES beginner_tutorials
# CATKIN_DEPENDS roscpp rospy std_msgs
# DEPENDS system_lib
)
###########
## Build ##
###########
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
#############
## Install ##
#############
#############
## Testing ##
#############
PS: Besides, I also have tried with ROS/Tutorials/WritingPublisherSubscriber(c++).
Added talker.cpp
and listener.cpp
in the ~/catkin_ws/src/beginner_tutorials/src. And the ~/catkin_ws/src/beginner_tutorials/CMakeLists.txt ...
Is the
src
folder empty? Also, could you addCmakeList.txt
(the one inside the package) file to the question?@skpro19 Thank you for your response. The package created by catkin_create_pkg (beginner_tutorials) and CmakeList.txt are in the src folder. And I added the CmakeList.txt. Please have a look, thanks.
I wanted you to paste
~/catkin_ws/src/beginner_tutorial/CMakeLists.txt
.@skpro19 The initial CMakeLists in beginner_tutorial was created automatically. I haven't edited it after creating the package.(I also put the one following the later part tutorial and it also has the same problem)
Have you tried source devel/setup.bash ?
Yes. And I have already added it to the bashrc
Did you try running the
talker
node using therosrun
command?