Command line tool written in rosperf_main.py cannot find `rosperf talker` executable
I have a rosperf package written in cpp, and runs alright using rosrun rosperf talker
. Now I want to create rosperf command line tool (borrowed code from rosbag), but roslib.packages.find_node in rosperf_main.py cannot find the rosperf talker
executable
How can I fix this? How to find the perf executable in python module?
This is the CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(rosperf)
if(NOT WIN32)
set_directory_properties(PROPERTIES COMPILE_OPTIONS "-g;-std=c++11;-Wall;-Wextra")
endif()
find_package(Boost REQUIRED COMPONENTS date_time thread)
find_package(catkin REQUIRED COMPONENTS message_generation rostime roscpp rosconsole roscpp_serialization std_msgs)
include_directories(${catkin_INCLUDE_DIRS} include)
link_directories(${catkin_LIBRARY_DIRS})
catkin_python_setup()
add_message_files(DIRECTORY msg FILES perf.msg)
generate_messages(DEPENDENCIES std_msgs)
catkin_package(
LIBRARIES rosperf
INCLUDE_DIRS include
CATKIN_DEPENDS message_runtime std_msgs
)
macro(rosperf T)
add_executable(${T} src/${T}/${T}.cpp)
target_link_libraries(${T} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(${T} rosperf_gencpp)
install(TARGETS ${T}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
endmacro()
foreach(dir
perf_talker
perf_listener
)
rosperf(${dir})
endforeach()