ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

[rospack] Error: package 'my_first_ros_pkg' not found

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

Ibrahim_aerospace gravatar image

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

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.
ibrahim@ibrahim-Aspire-V5-591G:~/catkin_ws$

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


edit retag flag offensive close merge delete

Comments

1

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 image gvdhoorn  ( 2018-03-06 01:50:22 -0500 )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 image jayess  ( 2018-03-06 02:05:48 -0500 )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 image Ibrahim_aerospace  ( 2018-03-06 02:22:09 -0500 )edit

@gvdhoom thanks i will try with this.

Ibrahim_aerospace gravatar image Ibrahim_aerospace  ( 2018-03-06 02:23:25 -0500 )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 image jayess  ( 2018-03-06 02:25:23 -0500 )edit

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

Ibrahim_aerospace gravatar image Ibrahim_aerospace  ( 2018-03-07 07:15:23 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

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

gvdhoorn gravatar image

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

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.


Edit:

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

Comments

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 image Ibrahim_aerospace  ( 2018-03-07 00:54:27 -0500 )edit

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

Ibrahim_aerospace gravatar image Ibrahim_aerospace  ( 2018-03-07 00:55:06 -0500 )edit
1

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 image gvdhoorn  ( 2018-03-07 01:44:14 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 7,667 times

Last updated: Mar 07 '18