0
$\begingroup$

Rosanswers logo

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?


Originally posted by newrosy on ROS Answers with karma: 3 on 2018-01-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by PeteBlackerThe3rd with karma: 9529 on 2018-01-18

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by newrosy on 2018-01-18:
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

Comment by jayess on 2018-01-18:
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.

Comment by PeteBlackerThe3rd on 2018-01-18:
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!

Comment by newrosy on 2018-01-18:
Great thanks! everything is fine now!

Comment by gvdhoorn on 2018-01-18:
@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.

Comment by Catman on 2020-02-16:
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

$\endgroup$

Your Answer

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