使用rosmake编译ROS功能包时出错:“IOError: [Errno 13] Permission denied: '/home/xxx/.ros/rosdep/sources.cache/”

自己在Ubuntu下搭了一个ROS的开发环境,使用rosmake时提示出错:

true@ubuntu:~/dev/rosbook$ rosmake chapter2_tutorials 
[ rosmake ] rosmake starting...                                                                                                                                                       
[ rosmake ] Packages requested are: ['chapter2_tutorials']                                                                                                                            
[ rosmake ] Logging to directory /home/true/.ros/rosmake/rosmake_output-20160824-073455                                                                                               
[ rosmake ] Expanded args ['chapter2_tutorials'] to:
['chapter2_tutorials']                                                                                                           
Traceback (most recent call last):
  File "/opt/ros/indigo/bin/rosmake", line 55, in <module>
    if rma.main():
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmake/engine.py", line 793, in main
    self.build_or_recurse(p)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmake/engine.py", line 316, in build_or_recurse
    self.build_or_recurse(d)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmake/engine.py", line 315, in build_or_recurse
    for d in self.dependency_tracker.get_deps_1(p):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmake/parallel_build.py", line 100, in get_deps_1
    potential_dependencies = self.rospack.get_depends(package, implicit=False)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 224, in get_depends
    m = self.get_manifest(name)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 164, in get_manifest
    return self._load_manifest(name)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 208, in _load_manifest
    retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name, rospack=self)
  File "/usr/lib/python2.7/dist-packages/rospkg/manifest.py", line 393, in parse_manifest_file
    _static_rosdep_view = init_rospack_interface()
  File "/usr/lib/python2.7/dist-packages/rosdep2/rospack.py", line 58, in init_rospack_interface
    lookup = _get_default_RosdepLookup(Options())
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 127, in _get_default_RosdepLookup
    verbose=options.verbose)
  File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 607, in create_default
    sources = load_cached_sources_list(sources_cache_dir=sources_cache_dir, verbose=verbose)
  File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 504, in load_cached_sources_list
    with open(cache_index, 'r') as f:
IOError: [Errno 13] Permission denied: '/home/true/.ros/rosdep/sources.cache/index'
Traceback (most recent call last):
  File "/opt/ros/indigo/bin/rosmake", line 55, in <module>
    if rma.main():
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmake/engine.py", line 793, in main
    self.build_or_recurse(p)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmake/engine.py", line 316, in build_or_recurse
    self.build_or_recurse(d)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmake/engine.py", line 315, in build_or_recurse
    for d in self.dependency_tracker.get_deps_1(p):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmake/parallel_build.py", line 100, in get_deps_1
    potential_dependencies = self.rospack.get_depends(package, implicit=False)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 224, in get_depends
    m = self.get_manifest(name)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 164, in get_manifest
    return self._load_manifest(name)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 208, in _load_manifest
    retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name, rospack=self)
  File "/usr/lib/python2.7/dist-packages/rospkg/manifest.py", line 393, in parse_manifest_file
    _static_rosdep_view = init_rospack_interface()
  File "/usr/lib/python2.7/dist-packages/rosdep2/rospack.py", line 58, in init_rospack_interface
    lookup = _get_default_RosdepLookup(Options())
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 127, in _get_default_RosdepLookup
    verbose=options.verbose)
  File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 607, in create_default
    sources = load_cached_sources_list(sources_cache_dir=sources_cache_dir, verbose=verbose)
  File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 504, in load_cached_sources_list
    with open(cache_index, 'r') as f:
IOError: [Errno 13] Permission denied: '/home/true/.ros/rosdep/sources.cache/index'

一开始以为环境变量有问题查看了

true@ubuntu:~/dev/rosbook$ cat ~/.bashrc

source /opt/ros/indigo/setup.bash
export ROS_PACKAGE_PATH=~/dev/rosbook:/opt/ros/indigo/share:/opt/ros/indigo/stacks

显示正常

后来使用如下方式解决:

true@ubuntu:~/dev/rosbook$ sudo rm -fr /home/true/.ros/rosdep/sources.cache

true@ubuntu:~/dev/rosbook$ rosdep update

你可能感兴趣的:(ROS,ubuntu)