ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

For every newly opened terminals, why do I have to source setup.bash and execute catkin_make again?

asked 2018-03-25 02:57:34 -0500

Seagull gravatar image

updated 2021-08-23 01:23:08 -0500

gvdhoorn gravatar image

I' m new to ROS, and running ROS kinetic on a raspberry pi 3B with ubuntu installed.

I have noticed that each time I open up a new terminal, I have to source /opt/ros/kinetic/setup.bash and execute catkin_make though I have done so previously in other terminals.

I don' t know whether it is correct to source and catkin_make every time or something has gone wrong. Please help.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-03-25 04:33:45 -0500

gvdhoorn gravatar image

I have noticed that each time I open up a new terminal, I have to source /opt/ros/kinetic/setup.bash

yes, that is needed in every terminal (or really: bash instance)

and execute catkin_make

No, that should not be needed.

why do I have to source and execute catkin_make again?

This question has been posted and answered quite a few times already. See the following for related / duplicate questions: #q124131, #q239131, #q229365, #q188309 and #q200174.

And the following questions try to explain why this is needed: #q241528, #q251292 and #q252715.

In short: setup.bash configures your shell so that it can find ROS programs and lets those programs find the required ROS packages.

edit flag offensive delete link more


Thanks. That solves my problem.

Seagull gravatar image Seagull  ( 2018-03-25 23:08:53 -0500 )edit

answered 2018-03-25 06:49:55 -0500

If you want to avoid having to manually source your workspace you can add the line to your .bashrc file.

source <path to my workspace>/devel/setup.bash

Then this will automatically be executed every time you open a new terminal. As gvdhoorn has said, there is no reason you should have to re-catkin_make your workspace in every terminal. Try adding this line to your .bashrc file and let us know if this doesn't solve your problem.

edit flag offensive delete link more


This is explained in the Q&As that I linked. I didn't want to duplicate all of that again.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-25 07:08:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-03-25 02:57:34 -0500

Seen: 1,206 times

Last updated: Aug 23 '21