Robotics StackExchange | Archived questions

Search for 'catkin' in workspace failed

Hello,
When I run catkin_make in a ros workspace, it output:

CMake Error at CMakeLists.txt:20 (message): Search for 'catkin' in workspace failed (catkinfindpkg catkin /home/ubuntu/workspace/05.usbcamcalibrate/src): Traceback (most recent call last):

File "/usr/bin/catkinfindpkg", line 5, in from pkgresources import loadentrypoint
File "/usr/local/lib/python2.7/dist-packages/pkg
resources/init.py", line 72, in import packaging.requirements
File "/usr/local/lib/python2.7/dist-packages/packaging/requirements.py", line 59, in MARKEREXPR = originalTextFor(MARKEREXPR())("marker")

TypeError: call() takes exactly 2 arguments (1 given)

-- Configuring incomplete, errors occurred!

I have remove ros by sudo apt-get remove ros-*, and reinstall ros jade, but the problem is not resolved, the error is same.

Can you know how to fix it ?
Thanks a lot


Edit: The CMakeLists.txt is here, @Geoff

cmakeminimumrequired(VERSION 2.8.3)
project(usb_cam)

Find catkin macros and libraries

if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)

is used, also find other catkin packages

findpackage(catkin REQUIRED COMPONENTS imagetransport roscpp stdmsgs stdsrvs sensormsgs camerainfo_manager)

pkg-config libraries

findpackage(PkgConfig REQUIRED) pkgcheckmodules(avcodec libavcodec REQUIRED) pkgcheck_modules(swscale libswscale REQUIRED)

Declare things to be passed to other projects

LIBRARIES: libraries you create in this project that dependent projects also need

CATKINDEPENDS: catkinpackages dependent projects also need

DEPENDS: system dependencies of this project that dependent projects also need

catkinpackage( INCLUDEDIRS include LIBRARIES ${PROJECT_NAME} )

Build

includedirectories(include ${catkinINCLUDEDIRS} ${avcodecINCLUDEDIRS} ${swscaleINCLUDE_DIRS} )

Build the USB camera library

addlibrary(${PROJECTNAME} src/usbcam.cpp) targetlinklibraries(${PROJECTNAME} ${avcodecLIBRARIES} ${swscaleLIBRARIES} ${catkin_LIBRARIES} )

Declare a cpp executable

addexecutable(${PROJECTNAME}node nodes/usbcamnode.cpp) targetlinklibraries(${PROJECTNAME}node ${PROJECTNAME} ${avcodecLIBRARIES} ${swscaleLIBRARIES} ${catkin_LIBRARIES} )

Install

Mark executables and/or libraries for installation

install(TARGETS ${PROJECTNAME}node ${PROJECTNAME} RUNTIME DESTINATION ${CATKINPACKAGEBINDESTINATION} LIBRARY DESTINATION ${CATKINPACKAGELIB_DESTINATION} )

Copy launch files

install(DIRECTORY launch/ DESTINATION ${CATKINPACKAGESHAREDESTINATION}/launch FILESMATCHING PATTERN "*.launch" )

install(DIRECTORY include/${PROJECTNAME}/ DESTINATION ${CATKINPACKAGEINCLUDEDESTINATION} FILES_MATCHING PATTERN ".h" PATTERN ".hpp" )

Asked by zhangyongwei93 on 2017-04-27 20:02:06 UTC

Comments

Please post your CMakeLists.txt.

Asked by Geoff on 2017-04-28 01:02:03 UTC

Looks like there is something funky with your python install; catkin_pkg is running from /usr/bin but using libraries from /usr/local/lib, which may be too new. If you're using a non-standard python (Anaconda?) or have upgraded packages via pip, you may want to try uninstalling the custom packages

Asked by ahendrix on 2017-04-28 02:59:52 UTC

do echo $ROS_PACKAGE_PATH if there is no output do source /opt/ros/ROS_VERSION/setup.bash in the same terminal build your workspace then source devel/setup.bash and add it in your bashrc. If there is ROS_PACKAGE_PATH please post it for more info

Asked by angeltop on 2017-04-28 03:43:13 UTC

@angeltop do echo $ROS_PACKAGE_PATH, it output
/opt/ros/jade/share:/opt/ros/jade/stacks

Asked by zhangyongwei93 on 2017-04-28 03:48:58 UTC

ROS_PACKAGE_PATH looks good for finding catkin. Sorry I don't have any other ideas...

Asked by angeltop on 2017-04-28 03:56:08 UTC

Answers