Couldn't find executable

asked 2020-06-15 06:46:55 -0500

M.Halwani gravatar image

updated 2020-06-15 07:47:19 -0500

gvdhoorn gravatar image

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})
edit retag flag offensive close merge delete

Comments

2

The name of your executable is visual_servo_node and not HoleDetection.

pcoenen gravatar image pcoenen  ( 2020-06-15 09:45:56 -0500 )edit
1

@pcoenen has the spotted your problem.

On another note, you shouldn't mess with CMAKE_CXX_FLAGS directly. Simply uncomment the add_definition(-std=c++11) call two lines belwo your set(CMAKE_CXX_FLAGS ...) call.

mgruhler gravatar image mgruhler  ( 2020-06-16 07:37:20 -0500 )edit