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

Package is not found after running roscore

asked 2018-01-18 02:32:06 -0600

newrosy gravatar image

I use catkin_make to build a package. It works . I then proceed to source the generated setup file in order to add my workspace to my ROS environment. (. ~/catkin_ws/devel/setup.bash). Using rospack I can display the dependecies of the package. But then when I run roscore and look again for package (or use rosrun) I get and error that there is no such package. . Did I miss a step?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2018-01-18 02:49:33 -0600

I'm assuming that when you started roscore you then created a new terminal window to execute the rosrun command. You need to source the setup.bash file for you package in every terminal you open (it only effects the terminal is sourced in)

If you missed this step then it would explain the problem you're having. Hope this helps.

edit flag offensive delete link more

Comments

That's it! Thank you! But I am wondering why it does not work since I checked my .bashrc file and I found the line : source /opt/ros/kinetic/setup.bash so I assumed it should apply to all terminals and it is not required to write this command every time I am using a new terminal

newrosy gravatar image newrosy  ( 2018-01-18 03:13:52 -0600 )edit
3

Note that you can add source ~\catkin_ws\devel\setup.bash to your .bashrc file to avoid this problem. But, if you have multiple workspaces then that would introduce another issue.

jayess gravatar image jayess  ( 2018-01-18 03:14:16 -0600 )edit
2

What jayess just said. You need to source the setup.bash files for ros as a whole and your package for it to work. If you've got one workspace then put it in .bash and save yourself a lot of typing!

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-01-18 03:17:51 -0600 )edit

Great thanks! everything is fine now!

newrosy gravatar image newrosy  ( 2018-01-18 03:19:30 -0600 )edit

@PeteBlackerThe3rd: what do you mean exactly with:

You need to source the setup.bash files for ros as a whole and your package for it to work.

gvdhoorn gravatar image gvdhoorn  ( 2018-01-18 04:37:35 -0600 )edit

Thank you so much! I was dumb enough to uninstall ros for such small problem I copied souce ~/catkin_ws/devel/setup.bash to .bashrc file and now everything is working just fine

Catman gravatar image Catman  ( 2020-02-16 16:35:29 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-01-18 02:32:06 -0600

Seen: 613 times

Last updated: Jan 18 '18