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

Permission errors roscreate-pkg using ROS electric without rosws

asked 2012-07-17 04:00:31 -0600

bgagnon gravatar image

Hello,

I've been able to find questions similar to the one, but they all end being resolved in a way that I don't think I can choose.

I'm running ROS Electric on a turtlebot laptop and have another computer running ROS Fuerte. Both are as updated as possible. They are both network properly and can communicate well.

The problem I am having is common, I can't create new packages anywhere because of a permission error. I have no problems on my workstation computer, just the laptop running ROS Electric. Here is the terminal output below after running this command (occurs through ssh or on the laptop itself) from ~/ros_workspace

    robolab@robolab:~/ros_workspace$ roscreate-pkg robonav
Traceback (most recent call last):
  File "/opt/ros/electric/ros/bin/roscreate-pkg", line 35, in <module>
    roscreate.roscreatepkg.roscreatepkg_main()
  File "/opt/ros/electric/ros/tools/roscreate/src/roscreate/roscreatepkg.py", line 125, in roscreatepkg_main
    create_package(package, author_name(), depends, uses_roscpp=uses_roscpp, uses_rospy=uses_rospy)
  File "/opt/ros/electric/ros/tools/roscreate/src/roscreate/roscreatepkg.py", line 63, in create_package
    os.makedirs(p)
  File "/usr/lib/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/robolab/ros_workspace/robonav'

I've tried tirelessly to get the package path's set correctly and when I do

echo $ROS_PACKAGE_PATH

it shows this.

/home/robolab/ros_workspace:/opt/ros/electric/share:/opt/ros/electric/stacks

What more must I do to tell ROS where my stuff should go... Keep in mind I don't have rosws since this is electric. Below are the lower contents of my ~/.bashrc file and my setup.sh file.

Bash file

source /opt/ros/electric/setup.bash
export ROS_MASTER_URI=http://192.168.0.214:11311
export ROS_HOSTNAME=192.168.0.214
export ROS_PACKAGE_PATH=~/ros_workspace:/opt/ros/electric/share:/opt/ros/electric/stacks
export ROS_WORKSPACE=~/ros_workspace

setup file

export ROS_ROOT=/opt/ros/electric/ros
export PATH=${ROS_ROOT}/bin:${PATH}
export PYTHONPATH=${ROS_ROOT}/core/roslib/src:${PYTHONPATH}
export ROS_PACKAGE_PATH=~/ros_workspace
export ROS_PACKAGE_PATH=/opt/ros/electric/stacks:${ROS_PACKAGE_PATH}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-07-17 05:03:04 -0600

allenh1 gravatar image

updated 2012-07-17 05:06:16 -0600

Try this at the end of your ~/.bashrc file. The way you have it may be problematic in a few aspects. Keep it simple!

source /opt/ros/electric/setup.bash
export ROS_MASTER_URI=http://192.168.0.214:11311
export ROS_IP=192.168.0.214
export ROS_PACKAGE_PATH=~/ros_workspace:${ROS_PACKAGE_PATH}
export ROS_WORKSPACE=~/ros_workspace

You shouldn't need to change anything else. No setup file should be needed. The issues I saw with your configuration:

  1. ROS_HOSTNAME should be used when you want it to detect an actual hostname, so I have it here as ROS_IP. When both are present, ros defaults to hostname.

  2. The PATH environment variable can be sensitive. Avoid changing it when possible.

Also, you should check your write permissions in that directory. From the user you want to make the package with, run the following:

sudo chown robolab -R ~/ros_workspace

Hope this was helpful for you!

edit flag offensive delete link more

Comments

Yes, @bgagnon has the wrong $ROS_PACKAGE_PATH for Electric. The suggested change should fix that.

joq gravatar image joq  ( 2012-07-17 06:11:56 -0600 )edit

Question Tools

Stats

Asked: 2012-07-17 04:00:31 -0600

Seen: 457 times

Last updated: Jul 17 '12