Couldn't find executable
Hi, I followed the tutorials while making a subscriber and publisher. after trying to run a ",cpp" executable file this message appears [rosrun] Couldn't find executable named HoleDetection below /home/ubuntu/thesis_ws/src/visual_servoing_2
Knowing that I did "source devel/setup.bash" after running catkin make Another thing might be worth noting is that I faced a problem before while running catkin_make, but I solved it by adding this line of code in the cmake file >>> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
Below is the cmake file
CMAKE file:
cmake_minimum_required(VERSION 2.8.3)
project(visual_servoing_2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
## Compile as C++11, supported in ROS Kinetic and newer
#add_compile_options(-std=c++11)
find_package(catkin REQUIRED COMPONENTS
roscpp
dvs_msgs
cv_bridge
)
find_package(OpenCV REQUIRED)
include_directories(${OPENCV_INCLUDE_DIR})
include_directories ("${PROJECT_SOURCE_DIR}/include/")
catkin_package(
#INCLUDE_DIRS include
#LIBRARIES visual_servoing_2
#CATKIN_DEPENDS roscpp
#DEPENDS system_lib
)
add_executable(
visual_servo_node
src/hole_detection_node.cpp
src/HoleDetection.cpp)
target_link_libraries(visual_servo_node ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
add_dependencies(visual_servo_node ${catkin_EXPORTED_TARGETS})
The name of your executable is
visual_servo_node
and notHoleDetection
.@pcoenen has the spotted your problem.
On another note, you shouldn't mess with
CMAKE_CXX_FLAGS
directly. Simply uncomment theadd_definition(-std=c++11)
call two lines belwo yourset(CMAKE_CXX_FLAGS ...)
call.