rosrun can't find executable. [closed]

asked 2017-06-19 12:54:49 -0500

yzheng0310 gravatar image

ROS Hydro

Ubuntu 12.04

I'm trying to write a barrett wam arm driver using ros control package, and I find this example online barrett_control on github, so I finished the barrett_hw package and here is the CMakeLists.txt for this package:

# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html 
cmake_minimum_required(VERSION 2.8.3)
project(barrett_hw)
# Load catkin and all dependencies required for this package
# TODO: remove all from COMPONENTS that are not catkin packages.
find_package(catkin COMPONENTS hardware_interface  
barrett_model kdl_urdf_tools terse_roscpp controller_manager
control_toolbox rospy xenomai_ros)

find_package(barrett)

if(Xenomai_FOUND)

include_directories(include ${catkin_INCLUDE_DIRS})

# CATKIN_MIGRATION: removed during catkin migration
# include(${rosbuild_xenomai_PACKAGE_PATH}/rosbuild_xenomai.cmake)

find_package(Eigen REQUIRED)
include_directories(${EIGEN_INCLUDE_DIRS})
add_definitions(${EIGEN_DEFINITIONS})

# Barrett
include_directories(${BARRETT_INCLUDE_DIRS})
link_directories(${BARRETT_LIBRARY_DIRS})
add_definitions(${BARRETT_DEFINITIONS})

# Add xenomai flagslink text
add_xenomai_flags()

#add_library(barrett_hw src/wam.cpp include/barrett_hw/wam.h)

#add_definitions(-D__XENO__)
add_executable(wam_server src/wam_server.cpp)
target_link_libraries(wam_server xenomai native rtdm ${BARRETT_LIBRARIES} ${catkin_LIBRARIES})

## Generate added messages and services with any dependencies listed here
# TODO: fill in what other packages will need to use this package
## DEPENDS: system dependencies of this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## INCLUDE_DIRS: 
## LIBRARIES: libraries you create in this project that dependent projects also need
catkin_package(
   DEPENDS hardware_interface barrett barrett_model kdl_urdf_tools terse_roscpp controller_manager control_toolbox     rospy
   CATKIN_DEPENDS # TODO
   INCLUDE_DIRS # TODO include
   LIBRARIES # TODO
 )

install(TARGETS wam_server
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

endif()

Then, when I run rosrun barrett_hw wam_server, the following error pops out:[rosrun] Couldn't find executable named wam_server below /home/robot/my_ws/src/barrett_control/barrett_hw

Then I found out somehow the cmake didn't install the executable in the right path, which is my_ws/devel/lib/barrett_hw, but installed it in the path of my_ws/build/barrett_hw

I've never met this situation before, and when I rerun CmakeLists.txt for other packages in my workspace, and the executables are all installed in the right path. Now in order to use wam_sever, I have to copy and paster the executable every time I re-compile.

Does any one know where the problem might be ?

THx!!!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2018-08-08 01:23:59.953105