Ask Your Question

[rospack] Error: package 'my_first_ros_pkg' not found

asked 2018-03-05 23:51:58 -0600

Ibrahim_aerospace gravatar image

updated 2018-03-07 07:13:41 -0600

Hello dear members! I am a beginner to ROS. I am following a book named "ROS Robot Programming" written by Turtlebot3 developers. i am writing my code according the book. first i type these commands for creating CPP file.

$ cd ~/catkin_ws/src/my_first_ros_pkg/src/
$ gedit hello_world_node.cpp

then build the package. then i go to Catkin workspace to build the package.

$ cd ~/catkin_ws && catkin_make

till here everything goes well. but when i try to run the node then it says Could not read parameters..

 ibrahim@ibrahim-Aspire-V5-591G:~$ cd catkin_ws
ibrahim@ibrahim-Aspire-V5-591G:~/catkin_ws$ source devel/setup.bash
ibrahim@ibrahim-Aspire-V5-591G:~/catkin_ws$ rosrun ros_package_template ros_pack
[ERROR] [1520428539.543254493]: Could not read parameters.

Your help will be appreciated. Please comment about it. Thanks.

edit retag flag offensive close merge delete



Have you run source ~/catkin_ws/devel/setup.bash after catkin_make completed? If not, rospack cannot find the package(s) in your catkin_ws.

gvdhoorn gravatar imagegvdhoorn ( 2018-03-06 01:50:22 -0600 )edit

@Ibrahim_aerospace Welcome! I believe doing what @gvdhoorn says should help you. However, it's always a good idea to include a copy and paste of the full error using the 101010 (preformatted text) button vs saying paraphrasing the error.

jayess gravatar imagejayess ( 2018-03-06 02:05:48 -0600 )edit

sir thank you very much for your precious reply. you are right i didnt include all the details actually i just made this account, a few ago moments ago. i wanted to upload the pictures. but as my account is new and i have no votes to upload the picture. sorry for this.

Ibrahim_aerospace gravatar imageIbrahim_aerospace ( 2018-03-06 02:22:09 -0600 )edit

@gvdhoom thanks i will try with this.

Ibrahim_aerospace gravatar imageIbrahim_aerospace ( 2018-03-06 02:23:25 -0600 )edit

No worries. The site blocking you from posting screenshots of the error worked in everyone's favor. Images aren't the best medium for text. You should copy and paste code, errors, and terminal output using the preformatted text (101010) button.

jayess gravatar imagejayess ( 2018-03-06 02:25:23 -0600 )edit

@gvdhoorn your help is needed please. I changed the code now.

Ibrahim_aerospace gravatar imageIbrahim_aerospace ( 2018-03-07 07:15:23 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-06 03:23:26 -0600

gvdhoorn gravatar image

updated 2018-03-07 07:59:04 -0600

ibrahim@ibrahim-Aspire-V5-591G:~/catkin_ws$ rosrun ros_package_template ros_package_template.launch
[rosrun] Couldn't find executable named ros_package_template.launch below /home/ibrahim/catkin_ws/src/ros_best_practices/ros_package

rosrun does not work with .launch files. It only works with executables. As you are passing it the path to a .launch file, you get this error.

Either run your executable directly (using rosrun), or use roslaunch to start launch files.


ibrahim@ibrahim-Aspire-V5-591G:~/catkin_ws$ rosrun ros_package_template ros_pack
[ERROR] [1520428539.543254493]: Could not read parameters.

This error is not related to your initial problem/question. It would be better to ask this question in a new ROS Answers question.

Before you do that however, take a look at how the book does things, because parameters are typically set with .launch files, so starting a single node in isolation with rosrun is not necessarily supposed to work.

edit flag offensive delete link more


sir thanks for help. now error is ibrahim@ibrahim-Aspire-V5-591G:~/catkin_ws$ source devel/setup.bashibrahim@ibrahim-Aspire-V5-591G:~/catkin_ws$ rosrun ros_package_template ros_package_template ibrahim@ibrahim-Aspire-V5-591G:~/catkin_ws$

Ibrahim_aerospace gravatar imageIbrahim_aerospace ( 2018-03-07 00:54:27 -0600 )edit

so is there any problem with my code ? please reply me. bunch of thanks.

Ibrahim_aerospace gravatar imageIbrahim_aerospace ( 2018-03-07 00:55:06 -0600 )edit

I don't see any error in what you copy-paste.

If there is one, please edit your original question, and add the new information at the bottom. Use the edit link/button for that.

gvdhoorn gravatar imagegvdhoorn ( 2018-03-07 01:44:14 -0600 )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


Asked: 2018-03-05 23:50:59 -0600

Seen: 2,859 times

Last updated: Mar 07 '18