Ask Your Question
0

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

asked 2016-01-21 21:11:22 -0500

updated 2016-02-01 21:54:31 -0500

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.028046   /opt/ros/jade/share
0.001151   /home/khan/catkin_ws/src
0.000042 * /opt/ros/jade/share/doc
0.000010 * /opt/ros/jade/share/realsense
0.000008 * /opt/ros/jade/share/doc/liborocos-kdl

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

still got the same answer.

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)

## Add include directories
include_directories(include
      ${PCL_INCLUDE_DIRS}
)

## Add link directories
link_directories(
  ${PCL_LIBRARY_DIRS}
)

add_executable(pcl_sample src/pcl_sample.cpp)
add_executable(pcl_create src/pcl_create.cpp)

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 flag offensive close merge delete

Comments

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.

gvdhoorn gravatar imagegvdhoorn ( 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.

Dr Abdul Mannan gravatar imageDr Abdul Mannan ( 2016-01-22 04:22:54 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-01-22 06:39:05 -0500

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).

edit flag offensive delete link more

Comments

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

Dr Abdul Mannan gravatar imageDr Abdul Mannan ( 2016-01-25 21:01:00 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-01-21 21:11:22 -0500

Seen: 129 times

Last updated: Feb 01 '16