twc16670334539 2023-03-27 16:33 采纳率: 0%
浏览 92

ORB-SLAM2中build_ros.sh编译报错

ORB-SLAM2编译build_ros.sh报错
Building ROS nodes
mkdir: 无法创建目录 “build”: 文件已存在
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as

project(ProjectName)

near the top of the file, but after cmake_minimum_required().

CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Deprecation Warning at /opt/ros/noetic/share/ros/core/rosbuild/rosbuild.cmake:7 (cmake_policy):
The OLD behavior for policy CMP0011 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
CMakeLists.txt:2 (include)

CMake Deprecation Warning at /opt/ros/noetic/share/ros/core/rosbuild/rosbuild.cmake:16 (cmake_policy):
The OLD behavior for policy CMP0002 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
CMakeLists.txt:2 (include)

CMake Deprecation Warning at /opt/ros/noetic/share/ros/core/rosbuild/rosbuild.cmake:18 (cmake_policy):
The OLD behavior for policy CMP0003 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
CMakeLists.txt:2 (include)

CMake Deprecation Warning at /opt/ros/noetic/share/ros/core/rosbuild/rosbuild.cmake:20 (cmake_policy):
The OLD behavior for policy CMP0005 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
CMakeLists.txt:2 (include)

CMake Deprecation Warning at /opt/ros/noetic/share/ros/core/rosbuild/rosbuild.cmake:23 (cmake_policy):
The OLD behavior for policy CMP0011 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
CMakeLists.txt:2 (include)

[rosbuild] Building package ORB_SLAM2
Failed to invoke /opt/ros/noetic/bin/rospack deps-manifests ORB_SLAM2
Traceback (most recent call last):
File "/home/test/anaconda3/lib/python3.8/site-packages/rosdep2/init.py", line 40, in
from .installers import InstallerContext, Installer,
File "/home/test/anaconda3/lib/python3.8/site-packages/rosdep2/installers.py", line 36, in
from rospkg.os_detect import OsDetect
File "/home/test/anaconda3/lib/python3.8/site-packages/rospkg/os_detect.py", line 42, in
import distro
ModuleNotFoundError: No module named 'distro'
[rospack] Error: could not find python module 'rosdep2.rospack'. is rosdep up-to-date (at least 0.10.4)?

CMake Error at /opt/ros/noetic/share/ros/core/rosbuild/public.cmake:129 (message):

Failed to invoke rospack to get compile flags for package 'ORB_SLAM2'.
Look above for errors from rospack itself. Aborting. Please fix the
broken dependency!

Call Stack (most recent call first):
/opt/ros/noetic/share/ros/core/rosbuild/public.cmake:207 (rosbuild_invoke_rospack)
CMakeLists.txt:4 (rosbuild_init)

-- Configuring incomplete, errors occurred!
See also "/home/test/catkin_ws/src/ORB_SLAM2-master/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".

  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2023-03-28 02:09
    关注
    不知道你这个问题是否已经解决, 如果还没有解决的话:
    • 帮你找了个相似的问题, 你可以看下: https://ask.csdn.net/questions/779920
    • 这篇博客你也可以参考下:CMake error: error in configuration process, project files may be invalid 解决办法
    • 这篇博客也不错, 你可以看下CMake error: error in configuration process, project files may be invalid 解决办法
    • 除此之外, 这篇博客: Ubuntu18.04安装灭霸SLAM:ORBSLAM3中的 4.5 错误CMake Deprecation Warning at /opt/ros/melodic/share/ros/core/rosbuild/rosbuild.cmake:7 (cmake_policy): 部分也许能够解决你的问题, 你可以仔细阅读以下内容或者直接跳转源博客中阅读:
      Building ROS nodes
      mkdir: cannot create directory ‘build’: File exists
      CMake Deprecation Warning at /opt/ros/melodic/share/ros/core/rosbuild/rosbuild.cmake:7 (cmake_policy):
        The OLD behavior for policy CMP0011 will be removed from a future version
        of CMake.
      
        The cmake-policies(7) manual explains that the OLD behaviors of all
        policies are deprecated and that a policy should be set to OLD only under
        specific short-term circumstances.  Projects should be ported to the NEW
        behavior and not rely on setting a policy to OLD.
      Call Stack (most recent call first):
        CMakeLists.txt:2 (include)
      
      
      CMake Deprecation Warning at /opt/ros/melodic/share/ros/core/rosbuild/rosbuild.cmake:16 (cmake_policy):
        The OLD behavior for policy CMP0002 will be removed from a future version
        of CMake.
      
        The cmake-policies(7) manual explains that the OLD behaviors of all
        policies are deprecated and that a policy should be set to OLD only under
        specific short-term circumstances.  Projects should be ported to the NEW
        behavior and not rely on setting a policy to OLD.
      Call Stack (most recent call first):
        CMakeLists.txt:2 (include)
      
      
      CMake Deprecation Warning at /opt/ros/melodic/share/ros/core/rosbuild/rosbuild.cmake:18 (cmake_policy):
        The OLD behavior for policy CMP0003 will be removed from a future version
        of CMake.
      
        The cmake-policies(7) manual explains that the OLD behaviors of all
        policies are deprecated and that a policy should be set to OLD only under
        specific short-term circumstances.  Projects should be ported to the NEW
        behavior and not rely on setting a policy to OLD.
      Call Stack (most recent call first):
        CMakeLists.txt:2 (include)
      
      
      CMake Deprecation Warning at /opt/ros/melodic/share/ros/core/rosbuild/rosbuild.cmake:20 (cmake_policy):
        The OLD behavior for policy CMP0005 will be removed from a future version
        of CMake.
      
        The cmake-policies(7) manual explains that the OLD behaviors of all
        policies are deprecated and that a policy should be set to OLD only under
        specific short-term circumstances.  Projects should be ported to the NEW
        behavior and not rely on setting a policy to OLD.
      Call Stack (most recent call first):
        CMakeLists.txt:2 (include)
      
      
      CMake Deprecation Warning at /opt/ros/melodic/share/ros/core/rosbuild/rosbuild.cmake:23 (cmake_policy):
        The OLD behavior for policy CMP0011 will be removed from a future version
        of CMake.
      
        The cmake-policies(7) manual explains that the OLD behaviors of all
        policies are deprecated and that a policy should be set to OLD only under
        specific short-term circumstances.  Projects should be ported to the NEW
        behavior and not rely on setting a policy to OLD.
      Call Stack (most recent call first):
        CMakeLists.txt:2 (include)
      
      
      [rosbuild] Building package ORB_SLAM3
      Failed to invoke /opt/ros/melodic/bin/rospack deps-manifests ORB_SLAM3
      Traceback (most recent call last):
        File "/usr/lib/python2.7/dist-packages/rosdep2/rospack.py", line 60, in init_rospack_interface
          lookup = _get_default_RosdepLookup(Options())
        File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 136, in _get_default_RosdepLookup
          verbose=options.verbose)
        File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 609, 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 566, in load_cached_sources_list
          raise CachePermissionError('Failed to write cache file: ' + str(e))
      rosdep2.core.CachePermissionError: Failed to write cache file: [Errno 13] Permission denied: '/home/nvidia/.ros/rosdep/sources.cache/index'
      [rospack] Error: could not call python function 'rosdep2.rospack.init_rospack_interface'
      
      
      CMake Error at /opt/ros/melodic/share/ros/core/rosbuild/public.cmake:129 (message):
        
      
        Failed to invoke rospack to get compile flags for package 'ORB_SLAM3'.
        Look above for errors from rospack itself.  Aborting.  Please fix the
        broken dependency!
      
      Call Stack (most recent call first):
        /opt/ros/melodic/share/ros/core/rosbuild/public.cmake:207 (rosbuild_invoke_rospack)
        CMakeLists.txt:4 (rosbuild_init)
      
      
      -- Configuring incomplete, errors occurred!
      See also "/home/nvidia/ORB_SLAM3/catkin_ws/src/ORB_SLAM3-v0.3-beta/Examples/ROS/ORB_SLAM3/build/CMakeFiles/CMakeOutput.log".
      make: *** No targets specified and no makefile found.  Stop.
      
      

      这个错误的原因时因为,没有写入环境变量里面,但是写入后同时也报这个错误,那么需要rosdep一下,推荐使用鱼香ros的rosdep方法。

      最简单的ROS安装方法和rosdepc安装(一行代码搞定)
      具体方法是:
      curl http://fishros.com/tools/install/rosdepc | bash 
      
      sudo rosdep fix-permissions
      rosdep update
      

    如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^
    评论

报告相同问题?

问题事件

  • 创建了问题 3月27日

悬赏问题

  • ¥15 vs2019的js智能提示
  • ¥15 关于#开发语言#的问题:FDTD建模问题图中代码没有报错,但是模型却变透明了
  • ¥15 uniapp的h5项目写一个抽奖动画
  • ¥15 TeleScan不能修改bar
  • ¥100 请问我基于逐飞库写的这个有关于mp u6050传感器的函数,为什么输出的值是固定的?
  • ¥15 hadoop中启动hive报错如下怎么解决
  • ¥15 如何优化QWebEngineView 加载url的速度
  • ¥15 关于#hadoop#的问题,请各位专家解答!
  • ¥15 如何批量抓取网站信息
  • ¥15 Spring Boot离线人脸识别