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

[rosrun] Couldn't find executable named ...

asked 2014-12-10 16:50:29 -0600

A.M Dynamics gravatar image

updated 2014-12-12 14:36:49 -0600

Dear all,

I am trying to link against the youbot API driver repository from a catkin package. First I created a catkin workspace named lib_youbot_test including:

build       devel    src

in src there is a package named node_pkg including:

CMakeLists.text    package.xml       main.cpp

The main.cpp is a node that uses the APIs and headers of youbot driver. (youbot_driver package)

This is the cmakelists.text:

cmake_minimum_required(VERSION 2.8.3)

project(node_pkg)

find_package(catkin REQUIRED COMPONENTS youbot_driver)
include_directories(${catkin_INCLUDE_DIRS})
link_directories(${catkin_LIBRARY_DIRS})
catkin_package()

add_definitions(-DYOUBOT_CONFIGURATIONS_DIR="${youbot_driver_CONFIG_DIR}")

add_executable(node_pkg
    main.cpp
)

target_link_libraries(node_pkg
    ${catkin_LIBRARIES}
)

OPTION(USE_SETCAP "Set permissions to access ethernet interface without sudo" ON)

SET(SUDO_COMMAND gksudo)
IF($ENV{USE_NORMAL_SUDO})
    SET(SUDO_COMMAND sudo)
ENDIF($ENV{USE_NORMAL_SUDO})

IF(USE_SETCAP)
add_custom_command(TARGET node_pkg POST_BUILD
    COMMAND ${SUDO_COMMAND} setcap cap_net_raw+ep $<TARGET_FILE:node_pkg>
)    
endif(USE_SETCAP)


install(TARGETS node_pkg
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

and this is package.xml:

<package>
  <name>node_pkg</name>
  <description>
     node_pkg
  </description>
  <author>ALIREZA</author>
  <maintainer email="x@x.de">x</maintainer>
  <license>BSD</license>
  <version>0.1.0</version>
  <url>https://github.com/youbot/youbot_applications</url>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>youbot_driver</build_depend>
  <run_depend>roscpp</run_depend>

</package>

** When I run catkin_make it gives me no error. BUT MY PROBLEM IS WHEN I RUN rosrun node_pkg main I RECEIVE THIS ERROR:

[rosrun]Couldn't find executable named below /home/youbot/lib_youbot_test/src/node_pkg

And this is the output ROS_PACKAGE_PATH:
/home/youbot/lib_youbot_test:/home/youbot/lib_youbot_driver:/home/youbot/ros_stacks:/opt/ros/hydro/share:/opt/ros/hydro/stacks

I would appreciate it if you help me out.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-12-12 14:24:27 -0600

ahendrix gravatar image

The add_executable(node_pkg main.cpp) line in your cmakelists is telling cmake to compile main.cpp into an executable named node_pkg. Therefore you should run it as:

rosrun node_pkg node_pkg
edit flag offensive delete link more

Comments

Thanks, it seems like it is OK. I don't have that error but I have to first try it on a real youbot robot.

A.M Dynamics gravatar image A.M Dynamics  ( 2014-12-12 16:27:37 -0600 )edit

I tried it on the youbot (ros version: fuerte) but I receives this error: [rospack] ERROR: stack/package node_pkg not found!

A.M Dynamics gravatar image A.M Dynamics  ( 2014-12-12 17:01:02 -0600 )edit
1

Why are you building and running with different versions of ROS? Fuerte shipped with a pretty broken version of catkin; I'm surprised that your package even compiles against Fuerte.

ahendrix gravatar image ahendrix  ( 2014-12-12 17:19:51 -0600 )edit

Dear ahendrix, The youbot's internal computer has fuerte but my laptop has hydro. Since I am new to ROS, I first try my program by Laptop then try to the same package for youbot. For fuerte I use and create-pkg rosmake commands.

A.M Dynamics gravatar image A.M Dynamics  ( 2014-12-12 18:21:29 -0600 )edit

@ahendrix, I run the program on the real youbot and it works well. Thanks for you help.

A.M Dynamics gravatar image A.M Dynamics  ( 2014-12-26 17:49:36 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-12-10 16:50:29 -0600

Seen: 17,390 times

Last updated: Dec 12 '14