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

rospack can't find package created with catkin_create_package

asked 2013-11-10 07:33:59 -0600

altemir gravatar image

I'm working through the beginner tutorials using ROS Hydro and I attempted to create my first package by running:

$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp

This produced no errors and appears to have created the associated files and folders. However, using rospack to find the newly created package doesn't work:

$ rospack find beginner_tutorials 
[rospack] Error: stack/package beginner_tutorials not found

What am I missing?

edit retag flag offensive close merge delete

5 Answers

Sort by ยป oldest newest most voted
6

answered 2013-11-11 02:51:57 -0600

Tirjen gravatar image

updated 2019-10-29 09:58:21 -0600

Did you create the package in your ROS_PACKAGE_PATH? Try also to run 'rospack profile' before running the rospack find command.

edit flag offensive delete link more

Comments

What do you mean by " did you create the package in your ROS_PACKAGE_PATH"?

nbro gravatar image nbro  ( 2019-09-27 18:10:41 -0600 )edit
2

answered 2018-10-16 12:53:43 -0600

BlackBirdLab gravatar image

updated 2018-10-18 11:39:19 -0600

I had a similar problem with a package i created using the catkin_create_pkg tool. here's what i did:

  1. erase all the folders and files in your catkin_ws except "src"
  2. build your catkin_ws (catkin_make or catkin build whatever you use)
  3. go to ~/catkin_ws/devel and find your setup.bash file (the point is to just make sure you know the path to this file)
  4. go to your home folder, ctr+h to see hidden files, open the .bashrc file and at the end add "source [path to the setup file from step 3]
  5. close your terminal, open it again and now your packages in the catkin_ws/src should be registered.

hope i helped somebody

edit flag offensive delete link more

Comments

thanks a lot... It worked for me... !! Is it necessary to always put the path as a source in the .bashrc ? for each package i'll create

bld-abir gravatar image bld-abir  ( 2019-08-15 12:01:06 -0600 )edit
1

answered 2017-10-04 03:55:44 -0600

tonyParker gravatar image

ros sometime does not recognise newly created packages.

Solution: go to <path-to-catkin-ws> source devel/setup.bash

close terminal and open new terminal. Now you would be able to find that package.

edit flag offensive delete link more

Comments

Closing terminal after sourcing is pointless because the source will be lost. @Tirjen is right, rospack profile should do the work if the package is already sourced.

l4ncelot gravatar image l4ncelot  ( 2017-10-05 09:12:06 -0600 )edit
0

answered 2013-11-11 15:15:36 -0600

altemir gravatar image

Thanks Tirjian, that was it exactly.

edit flag offensive delete link more
0

answered 2018-04-30 21:48:46 -0600

RicHykkie gravatar image

Just leaving this here, but don't forget to shut down any running roscore!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-11-10 07:33:59 -0600

Seen: 9,169 times

Last updated: Oct 29 '19