2

I'm following the ROS-tutorial and I am facing the following behavior after creating my own package: If try to execute any installed package (e.g. any_package), I get the following error:

[rosrun] Couldn't find executable named <any_package> below /opt/ros/kinetic/share/<any_package>
[rosrun] Found the following, but they're either not files
[rosrun] or not executable:
[rosrun]   /opt/ros/kinetic/share/<any_package>

Any help?

EDIT: If I execute catkin_find --without-underlays --libexec --share <any_package>, it gives me the following output:

Multiple packages found with the same name "my_package":
- my_new_package/my_package
- my_new_package/my_package_2
Tik0
  • 2,499
  • 4
  • 35
  • 50
millivanilli
  • 25
  • 1
  • 8
  • Please be more specific! What OS do you use? How does your workspace look like? – Tik0 Oct 06 '18 at 10:03
  • 1
    Plain Ubuntu 16.04. The workspace is exactly the same as in the tutorial. – millivanilli Oct 06 '18 at 10:04
  • 1
    Your link is to a long list of tutorial steps/tasks. Can you provide a more specific link to the exact part of this tutorial you are having problems. This should make it easier for others to help you figure out your problem. – Keith Dawson Oct 06 '18 at 10:08
  • 1
    Sure, I've updated the link! – millivanilli Oct 06 '18 at 10:13
  • Could you please execute the following command after you've sourced your workspace: `catkin_find --without-underlays --libexec --share ` – Tik0 Oct 06 '18 at 10:17
  • 1
    Sure, it gives `Multiple packages found with the same name "my_package" ...`. I'll edit the question. – millivanilli Oct 06 '18 at 10:21

2 Answers2

2

I assume that you have a tainted workspace. I assume that you've just copied the my_package to my_package_2 without editing the package.xml file in my_package_2. It is not really mentioned in the tutorial, since it assumes that you use the proper commands which creates a manifest file with a unique package name. Just edit the name-tag as follows:

<name>my_package</name>

to

<name>my_package_2</name>

in the corresponding folder.

Tik0
  • 2,499
  • 4
  • 35
  • 50
0
You have to make sure you edit CmakeLists.txt according to your compile version, c++ executable declaration & Specify libraries to link a library

Below are step step modification and then run catkin_make before running your project:

step 1
add_compile_options(-std=c++11)

step 2
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
add_executable(${PROJECT_NAME}_node src/myproject_node.cpp)

step 3

## Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}_node
   ${catkin_LIBRARIES}
 )
Jitendra
  • 69
  • 2
  • 3