0
$\begingroup$

Rosanswers logo

hello i am new to ROS and to Ubuntu ! I use ubuntu 12.04 and Ros Fuerte!I was trying to understant ROS through the examples of the book "Learing Ros for Robotics Programming" but i've been stucked 2 days in creating nodes section !(pages 52-56) I have made whatever it says but when i write rosrun chapter2_tutorials example1_a on terminal i keep getting "[rosrun] Couldn't find executable named example1_a below /home/ioannis/dev/rosbook/chapter2_tutorials" Is there any idea which the problem is? If you want further info let me know! Sorry for my bad english! Thank you in advance!


Originally posted by ioann_kats on ROS Answers with karma: 1 on 2015-01-11

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It could be that in your CMakelists.txt (see page 55 at the end of the page on the same book) you must define where your cpp files are in your system:

(from the book):

rosbuild_add_executable(example1_a src/example1_a.cpp)
rosbuild_add_executable(example1_b src/example1_b.cpp)

for this reason be sure that the path and the name of the .cpp files are right. if you didn't create a src/ folder in your chapter2_tutorials/ folder then you need to remove it from your CMakelists.txt file. For example it would be:

rosbuild_add_executable(example1_a example1_a.cpp)
rosbuild_add_executable(example1_b example1_b.cpp)

I hope that this solve your problem. And don't forget to source your file in your terminal:

source devel/setup.bash

EDIT: you picked up the only book that is made entirely from the tutorials online. For using and learning ROS I would suggest you to use the tutorials online since they are updated and much more detailed than the book. As an exercise can you lately switch to the book again and try to develop its robot's examples with the stuff you learned.

Ciao


Originally posted by Andromeda with karma: 893 on 2015-01-11

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by ioann_kats on 2015-01-11:
First of all thank you for your time! unfortunately i have src folder and inside this folder is both example1 and example2 I think that the problem may be in bashrc file export ROS_PACKAGE_PATH=/home/ioannis/dev/rosbook:/home/ioannis/dev/rosbook:/opt/ros/fuerte/share:/opt/ros/fuerte/stacks

Comment by Andromeda on 2015-01-11:
did you initialize the workspace of ROS?!?!? In ~/dev/rosbook you should initialize the workspace. Hydro and above need a catkin_initbut since you are using Fuerte I'm not really sure

Comment by Andromeda on 2015-01-11:
if I were you I would forget the book for a moment and start again slowly with the tutorial online Select rosbuild when asked for the system. I'm pretty sure you didn't initialize the workspace.

Comment by ioann_kats on 2015-01-11:
So !should i prefer hydro?

Comment by Andromeda on 2015-01-11:
If you don't need Fuerte install Indigo!! But if you are forced to use Fuerte you have to choose in the tutorials rosbuild.

If you can install Indigo

Comment by ioann_kats on 2015-01-11:
ok!Thank you so much!

Comment by corilei on 2018-01-15:
rosrun chapter2_tutorials chap2_example1_a

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.