0
$\begingroup$

Rosanswers logo

Hello All,

I've built a catkin package which has a main node and links against a repository. My problem is that everytime I need to use the package I have to run "source devel/setup.bash" before running the command 'rosrun'. Otherwise, I receive an error.Is there any way to solve this problem and avoid to run this command everytime?

Thanks.


Originally posted by A.M Dynamics on ROS Answers with karma: 93 on 2014-12-29

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If you add source ~/ROS_WS/devel/setup.bash to your bashrc it will automatically source it as soon as you open the terminal.


Originally posted by tonybaltovski with karma: 2549 on 2014-12-29

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by A.M Dynamics on 2014-12-29:
Thanks. My problem was solved.

Comment by gvdhoorn on 2014-12-29:
Note: if you have multiple workspaces, adding a source .. line to your .bashrc is actually a pita.

Comment by A.M Dynamics on 2014-12-29:
@gvdhoorn. By a pita you mean is not good? if so, What do you suggest?

Comment by gvdhoorn on 2014-12-30:
Yes, a 'pita' is not good :).

If you have multiple catkin workspaces (not multiple packages), you could perhaps do something with suitably configured terminals (ie: have each terminal source a different setup.bash). Then start the appropriate terminal. Personally, I just source my workspaces.

Comment by A.M Dynamics on 2014-12-30:
Thanks, I get it. So far I have edited bashrc file because sometimes things get complicated and I forget some details so by editing bash file I reduce the probability of receiving errors.

$\endgroup$

Your Answer

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