ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Command line tool written in rosperf_main.py cannot find `rosperf talker` executable

asked 2018-08-09 03:39:43 -0500

foodtooth gravatar image

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

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-09 06:38:36 -0500

foodtooth gravatar image

Sorry, this is typo in roslib.packages.find_node causing the error. I will add other info if the problem re-occurs.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-08-09 03:39:43 -0500

Seen: 118 times

Last updated: Aug 09 '18