# Book: Learning ROS for Robotic Programming, 2nd Edn; Chapter 6 - pcl_create not working

I am trying to go through the book recommended for the ROS beginners "Learning ROS for Robotics Programming" Second Edition. Right now, I am reading chapter 6 about point cloud library. I have followed all the steps given in there from page 236-240. I am constantly seeing this error

[rosrun] Couldn't find executable named pcl_create below /home/khan/catkin_ws/src/chapter6_tutorials

even though the command catkin_make is being compiled in my root directory and no error occurs. To resolve this problem I have already gone through all the solutions provided online such as this, this and this. Tried everything such as

cd ~/catkin_ws
source devel/setup.bash

echo $ROS_PACKAGE_PATH /home/khan/catkin_ws/src:/opt/ros/jade/share:/opt/ros/jade/stacks$ rospack profile

Full tree crawl took 0.029871 seconds.
Directories marked with (*) contain no manifest.  You may
want to delete these directories.
To get just of list of directories without manifests,
re-run the profile with --zombie-only
-------------------------------------------------------------
0.001151   /home/khan/catkin_ws/src

roscd chapater6_tutorials
rosrun chapter6_tutorials pcl_create

and that's what I get

[rosrun] Couldn't find executable named pcl_create below /home/khan/catkin_ws/src/chapter6_tutorials

I have also tried running it from the root directory such

cd ~/catkin_ws
rosrun chapter6_tutorials pcl_create

My "chapter6_tutorials" package address is home/catkin_ws/src/chatper6_tutorials. In my" chapter6_tutorials", I have two files CMakeLists.txt and package.xml and only one folder naming "src" in which I have two files "pcl_sample" and "pcl_create" both of these files are created as per instructions given in the book. In my CMakesLists.txt I have already added following instructions

find_package(PCL REQUIRED)

include_directories(include
${PCL_INCLUDE_DIRS} ) ## Add link directories link_directories(${PCL_LIBRARY_DIRS}
)

target_link_libraries(pcl_sample ${catkin_LIBRARIES}${PCL_LIBRARIES})
target_link_libraries(pcl_create ${catkin_LIBRARIES}${PCL_LIBRARIES})

It is also worth mentioning that I am using ubuntu15.04 with jade version of ROS.

I have already learnt how to create package from the tutorial (this) and I have also gone through how to make nodes following book and tutorials (a and b). Please, help if you can. I have spent a lot of time in it and stuck. Please, help, I shall bring cookies for you. :D :D :D

edit retag close merge delete

Please edit your question to include the full layout of your workspace (or at least, something that shows where chapter6_tutorials is located, and what it's contents is). You could use something like tree for that. Also: please add the contents of your CMakeLists.txt.

( 2016-01-22 03:38:50 -0500 )edit

Thanks gvdhoorn for your attention. I have edited my question for the very important information I missed. I am so grateful to you for your kindness.

( 2016-01-22 04:22:54 -0500 )edit

Sort by » oldest newest most voted

Is that your whole CMakeLists.txt? I wouldn't expect that to properly build your executables because of missing catkin dependencies at the top. Further, it appears you are missing a call to the catkin_package() macro (documentation here). One of the things this macro does is tell catkin where to put the compiled executables. If they aren't in the right place, then rospack (and correspondingly rosrun) won't be able to find them.

I'm guessing if you run the command

find ~/catkin_ws -name "pcl_create" -executable

it will tell you the compiled binary is located in ~/catkin_ws/build/, but if you add a call to catkin_package() before your add_executable lines then you will find the executable in ~/catkin_ws/devel/lib/ (which is where it should be).

more

I was so in loosing hope that nobody helps here; but here I got your message and it worked. Hurrah!!! Thank you so much Jarvisschutlz. I shall buy cookies for you and give away to some poor person by your name. :) :) :). You helped me so much and I cannot pay you back anyways. This is so much to me

( 2016-01-25 21:01:00 -0500 )edit