Rosanswers logo

Ubuntu 12.04

ROS Hydro

I am a freshman to ROS, recently I create nodes according to the book ‘Learning ROS for Robotics Programing Second Edition’,

but after I execute ‘rosrun’, something strange happend:

rosrun chapter2_tutorials chap2_example1_a

It shows that:

[rosrun] Couldn't find executable named chap2_example1_a below /home/exbot/dev/catkin_ws/src/chapter2_tutorials

Actually, the executable chap2_example1_a exists in /home/dev/catkin_ws/devel/lib

I think something is wrong with the path. But I am not sure.

How to solve it? Thank you~

Originally posted by ChenJinluo on ROS Answers with karma: 9 on 2015-11-05

Post score: 0

Original comments

Comment by Dimitri Schachmann on 2015-11-05:
Can you show us the output of catkin config? Perhaps you need to sudo apt-get install python-catkin-tools for that.

Do you have multiple catkin workspaces on your machine?


1 Answer 1


Rosanswers logo

Most probably you need to source devel/setup.bash

see here for similar question

Originally posted by Dimitri Schachmann with karma: 789 on 2015-11-05

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by ChenJinluo on 2015-11-05:
Thanks. But it doesn't help. In the end of my ~./bashrc, I already have export ROS_PACKAGE_PATH=~/dev/catkin_ws:/home/exbot/rosbuild_ws/sandbox:/home/exbot/catkin_ws/src:/opt/ros/hydro/share:/opt/ros/hydro/stacks If I add source /opt/ros/hydro/setup.bash in the end. It even can't find

Comment by ChenJinluo on 2015-11-05:
my package. [rospack] Error: stack/package chapter2_tutorials not found

Comment by gvdhoorn on 2015-11-06:
Don't set ROS_PACKAGE_PATH yourself, let setup.bash of the appropriate workspace do that. Remove that line (export ROS_PACKAGE_PATH=..), and change source /opt/ros/hydro/setup.bash to source the setup.bash from your workspace (ie: devel/setup.bash). Then open new terminal, and try again.

Comment by ChenJinluo on 2015-11-06:
It works! Thanks a lot ^ ^


Your Answer

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