Permission denied /opt/ros/electric/stacks/nxt/learning_nxt
Using Ubuntu 10.04 Lucid and ROS Electric. I had successfully installed the NXT packages for ROS and tested them with my brick. Everything seemed to be going well. I'm trying to do the NXT tutorials:
Entered: roscd nxt
Brought me to: /opt/ros/electric/stacks/nxt
Entered: roscreate-pkg learning_nxt rospy nxt_ros
Returned:
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: '/opt/ros/electric/stacks/nxt/learning_nxt'
Before this I had been using roscreate-pkg just fine with the regular ROS tutorials. Now that I'm trying to use it with the NXT packages, it seems to not work.
EDIT 1: In reply to Lorenz, thank you. That is one thing that has confused me about the differences between Fuerte and Electric. In the installing Electric tutorial page, overlays aren't mentioned and I feel like my bashrc isn't setup the way it should be, even though I followed the isntructions verbatim from the install and configuration tutorials. The last three lines of my bashrc are currently (before applying Lorenz's update):
source /opt/ros/electric/setup.bash
export ROS_PACKAGE_PATH=~/ros_workspace:/opt/ros/electric/stacks
export ROS_WORKSPACE=~/ros_workspace
I also don't understand why roscreate-pkg works fine when I use it without NXT in mind.
EDIT 1.1: I ran all of Lorenz's suggested commands verbatim. After trying to run the command: rosws set ~/ros_overlay/sandbox
I get this:
Add element:
{'other': {'local-name': '/home/noah/ros_overlay/sandbox'}}
Continue(y/n): y
Overwriting /home/noah/ros_workspace/.rosinstall
Traceback (most recent call last):
File "/usr/local/bin/rosws", line 66, in <module>
sys.exit(rosinstall.rosws_cli.rosws_main(sys.argv))
File "/usr/local/lib/python2.6/dist-packages/rosinstall/rosws_cli.py", line 519, in rosws_main
return ws_commands[command](workspace, args)
File "/usr/local/lib/python2.6/dist-packages/rosinstall/multiproject_cli.py", line 318, in cmd_set
shutil.move(os.path.join(config.get_base_path(), self.config_filename), "%s.bak"%os.path.join(config.get_base_path(), self.config_filename))
File "/usr/lib/python2.6/shutil.py", line 264, in move
copy2(src, real_dst)
File "/usr/lib/python2.6/shutil.py", line 99, in copy2
copyfile(src, dst)
File "/usr/lib/python2.6/shutil.py", line 52, in copyfile
fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: '/home/noah/ros_workspace/.rosinstall'
Notice the last line.
EDIT 1.2: All of the commands ran fine up to: rosws set ~/ros_overlay/sandbox
The output of the following command is below: ls -l ~/ros_workspace
drwxr-xr-x 11 noah noah 4096 2012-06-25 09:18 beginner_tutorials
I found the .rosinstall
in the ~/ros_overlay
instead of ~/ros_workspace
Is there a way to ...
That's interesting. The rosws init should actually create the .rosinstall file in ~/ros_workspace. Did you get any errors while executing rosws init? After executing it, what's the output of
ls -l ~/ros_workspace
?re EDIT 1: Your .bashrc had a workspace setup correctly (for electric). The reason for the error is that you tried to create a package in the installed nxt stack instead of your home workspace. This is always bad and independent of electric or fuerte.
As I said at the end of my question, you should call roscreate in ~/ros_overlay/sandbox. Ignore what the NXT tutorial or any other tutorial says about where to create packages :) and always use your sandbox dir. The NXT tutorial probably assumes an installation from source.