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

add the workspace to your ROS permission denied

asked 2015-03-04 05:35:41 -0500

JLL gravatar image

updated 2015-03-16 08:30:37 -0500

gvdhoorn gravatar image

hello I have a problem to add the workspace in the ROS environment.

I am following the tutorial and when I have to add the workspace in the ROS environment

$ . ~/catkin_ws/devel/setup.bash

I get the following:

bash: /home/jonatan/catkin_ws/devel/setup.bash: permission denied

What should I do to solve it?


Edit:

BEFORE:

jonatan@jonatan-TECRA-S4:~/catkin_ws2/devel$ ls -l

total 40

- rwxr-xr-x 1 jonatan jonatan   506 mar 16 13:13 env.sh

- drwxrwxr-x 3 jonatan jonatan  4096 mar 16 12:46 etc
- drwxrwxr-x 3 jonatan jonatan  4096 mar 16 13:03 lib
- rw-r--r-- 1 jonatan jonatan   260 mar 16 13:13 setup.bash
- rw-r--r-- 1 jonatan jonatan  2384 mar 16 13:13 setup.sh
- rwxr-xr-x 1 jonatan jonatan 12274 mar 16 13:13 _setup_util.py
- rw-r--r-- 1 jonatan jonatan   250 mar 16 13:13 setup.zsh
- drwxrwxr-x 3 jonatan jonatan  4096 mar 16 13:03 share

AFTER:

jonatan@jonatan-TECRA-S4:~/catkin_ws2$ rm -r devel

jonatan@jonatan-TECRA-S4:~/catkin_ws2$ rm -r build

jonatan@jonatan-TECRA-S4:~/catkin_ws2$ catkin_make

jonatan@jonatan-TECRA-S4:~/catkin_ws2$ ls -l

total 12

drwxrwxr-x 8 jonatan jonatan 4096 mar 16 13:55 build

drwxrwxr-x 5 jonatan jonatan 4096 mar 16 13:55 devel

drwxrwxr-x 3 jonatan jonatan 4096 mar 16 13:00 src

jonatan@jonatan-TECRA-S4:~/catkin_ws2$ ~/catkin_ws2/devel/setup.bash

bash: /home/jonatan/catkin_ws2/devel/setup.bash: permission denied

*(NOTE: catkin_ws = catkin_ws2)

edit retag flag offensive close merge delete

Comments

It seems broken. What did you do to create this?

dornhege gravatar image dornhege  ( 2015-03-04 06:09:33 -0500 )edit

@JLL: please only update your original question with new information. Don't post answers with new information. I've merged your answer into your question this time.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-16 08:31:35 -0500 )edit
1

@JLL: without the dot (ie: . /path/to/setup.bash), bash will not source setup.bash, but try to execute it. Is the missing dot a typo? Could you please try sourcing with source /path/to/setup.bash?

gvdhoorn gravatar image gvdhoorn  ( 2015-03-16 08:32:48 -0500 )edit

This would explain the error. Without +x the setup.bash is not executable (which it doesn't need to be, actually it should not be!)

dornhege gravatar image dornhege  ( 2015-03-16 08:36:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-03-04 07:31:02 -0500

Wolf gravatar image

updated 2015-03-16 08:57:06 -0500

Update for your comment/ added info:

The command:

jonatan@jonatan-TECRA-S4:~/catkin_ws2$ ~/catkin_ws2/devel/setup.bash

won't work. Try using

jonatan@jonatan-TECRA-S4:~/catkin_ws2$ source ~/catkin_ws2/devel/setup.bash

or

jonatan@jonatan-TECRA-S4:~/catkin_ws2$ . ~/catkin_ws2/devel/setup.bash

I. e. you must not try to execute the script but source it so the environment variables set in their will persist once its execution is done.

edit flag offensive delete link more

Comments

The odd thing is that the source command points to catkin_ws/desa, so I guess there was some overlaying going on or similar. In any case I'd recommend the first solution. The executable flag isn't just "lost", so I'd assume something more is broken.

dornhege gravatar image dornhege  ( 2015-03-04 08:02:09 -0500 )edit
3

Also: setup.bash is sourced, not executed. So it doesn't need the exec bit. It also doesn't have it on my installation.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-04 08:25:38 -0500 )edit

I've done the solutions you've recommended to me but I get the same

I need a solution please!

JLL gravatar image JLL  ( 2015-03-16 07:18:55 -0500 )edit

Please post the exact commands you entered and outputs and give the output of ls -l before and after.

dornhege gravatar image dornhege  ( 2015-03-16 07:30:34 -0500 )edit

maybe add the output of groups to see which permissions your user has

Wolf gravatar image Wolf  ( 2015-03-16 07:41:05 -0500 )edit
1

The command: [..] won't ever work. [..]

@Wolf: I think you missed the dot in front of the the quoted command. Sourcing a file using a dot is perfectly legal (see here fi).

gvdhoorn gravatar image gvdhoorn  ( 2015-03-16 08:28:23 -0500 )edit

But you need the dot (or source) The command of JLL up there just enters the file name. This fails with permission denied if the file has no exec flag but even if it has an exec flag and you run it like this it won't change your environment. Either . or source is needed.

Wolf gravatar image Wolf  ( 2015-03-16 09:05:22 -0500 )edit

The first quote from @JLL does include the dot:

$ . ~/catkin_ws/devel/setup.bash

You're right that the one in the edit doesn't include it.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-16 09:21:15 -0500 )edit

Question Tools

Stats

Asked: 2015-03-04 05:35:41 -0500

Seen: 8,753 times

Last updated: Mar 16 '15