0
$\begingroup$

Rosanswers logo

I made a Ros package. And I will try to open the package with Qt. However, I get the following type of error.

-- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:59 (message): find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.

-- Configuring incomplete, errors occurred! See also "/home/navi/catkin_ws/build/CMakeFiles/CMakeOutput.log".

And my package CMakeList is as follows.

cmake_minimum_required(VERSION 2.8.3)
project(multi_xtion)

find_package(catkin REQUIRED COMPONENTS   image_transport   rosbag roscpp   sensor_msgs   std_msgs  cv_bridge )
set(CMAKE_BUILD_TYPE "release")
LIST(APPEND SEARCH_LIBS /usr/lib)
LIST(APPEND SEARCH_LIBS /usr/local/lib) 
LIST(APPEND> SEARCH_LIBS /opt/local/lib)
LIST(APPEND SEARCH_LIBS /usr/lib/x86_64-linux-gnu)
LIST(APPEND SEARCH_HEADERS /usr/include) 
LIST(APPEND SEARCH_HEADERS /opt/include)
LIST(APPEND SEARCH_HEADERS /usr/include/eigen3)
LIST(APPEND SEARCH_HEADERS /opt/include/eigen3)
LIST(APPEND SEARCH_HEADERS /usr/local/include) 
LIST(APPEND SEARCH_HEADERS /opt/local/include)
LIST(APPEND SEARCH_HEADERS /usr/local/include/eigen3)
LIST(APPEND SEARCH_HEADERS /opt/local/include/eigen3)
message("-- Check for Google Flags")
find_library(GFLAGS_LIB NAMES gflags PATHS ${SEARCH_LIBS})
>     find_path(GFLAGS_INCLUDE NAMES gflags/gflags.h PATHS ${SEARCH_HEADERS})
include_directories(${GFLAGS_INCLUDE})
find_path(EIGEN_INCLUDE NAMES Eigen/Core PATHS ${SEARCH_HEADERS})
include_directories(${EIGEN_INCLUDE})
>     find_package(Ceres REQUIRED)
>     message("CERES_INCLUDE_DIRS: " ${CERES_INCLUDE_DIRS})
message("CERES_LIBRARIES: " ${CERES_LIBRARIES})
>     include_directories(${CERES_INCLUDE_DIRS})
IF (NOT "${OpenCV_DIR}" EQUAL "")
>          MESSAGE("Using OpenCV from " ${OpenCV_DIR}) 
ENDIF (NOT "${OpenCV_DIR}" EQUAL "")
> 
>     find_package(OpenCV 3.2 REQUIRED core imgproc highgui imgcodecs xfeatures2d PATHS "/usr/share/local/OpenCV")
>     MESSAGE("Using OpenCV from " ${OpenCV_INCLUDE_DIRS})
include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})
>     link_directories(${OpenCV_LIBRARY_DIRS})

find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
include_directories(${GLFW_INCLUDE_DIRS})
>     message("GLFW_INCLUDE_DIRS: " ${GLFW_INCLUDE_DIRS})
message("GLFW_LIBRARIES: " ${GLFW_LIBRARIES})
> 
>     catkin_package()
>     include_directories( ${catkin_INCLUDE_DIRS})

add_executable(multi_xtion src/multi_xtion.cpp)
add_dependencies(multi_xtion ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(multi_xtion ${OpenCV_LIBS} ${catkin_LIBRARIES})
target_link_libraries(extrinsic_calib ${OpenCV_LIBS} ${GFLAGS_LIB} ${CERES_LIBRARIES} $catkin_LIBRARIES} -lGL -lGLU ${GLFW_LIBRARIES})
>     install(TARGETS multi_xtion
>         RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

Catkin_make works fine. What's wrong with qt-cmake?


Originally posted by anonymous28394 on ROS Answers with karma: 13 on 2017-03-08

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

try setting in the cmake configuration (tools> options> Kits > (your kit) > cmake configuration) and be sure to start qtcreator from a bash with the ros environment configured

CATKIN_DEVEL_PREFIX:STRING=/home//catkin_ws/devel CATKIN_INSTALL_PREFIX:STRING=/home//catkin_ws/install CMAKE_PREFIX_PATH:STRING=/home//catkin_ws/devel;/opt/ros/kinetic CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}


Originally posted by Augusto Luis Ballardini with karma: 430 on 2017-04-12

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

There is a Plugin for QT that typically sets up everything correctly and works like a charm. Have you tried this? https://github.com/ros-industrial/ros_qtc_plugin/wiki


Originally posted by mgruhler with karma: 12390 on 2017-03-08

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.