0
$\begingroup$

Rosanswers logo

I have "source devel/setup.bash" added to my bashrc file, but sometimes, if I create a new package and then compile it for the first time with "catkin_make", then I find I need to open a new terminal in order to run the package because the terminal I already have open needs to source devel/setup.bash again.

Does anyone know how to get "source devel/setup.bash" to run every time I do catkin_make? Or otherwise how to solve this problem?


Originally posted by mysteriousmonkey29 on ROS Answers with karma: 170 on 2014-01-14

Post score: 4

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

  1. Either you must run the above source command each time you open a new terminal window

  2. or add it to your .bashrc file as follows.

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

I found the above instruction from this website: https://github.com/MST-Robotics/MST_ROS_Catkin_Packages/wiki/New-Member-Tutorials


Originally posted by urthkakao with karma: 108 on 2014-01-30

This answer was ACCEPTED on the original site

Post score: 7


Original comments

Comment by Will Chamberlain on 2016-11-06:
or

catkin_make  &  source devel/setup.sh

or even set up an alias for that e.g. in your ~/.bashrc

alias catkin_make_and_source='catkin_make & source devel/setup.sh'
$\endgroup$

Your Answer

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