鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    moveit2 最后一步source install/setup.bash报错

    已定时 已固定 已锁定 已移动
    机械臂运动规划
    moveit2 moveit2安装 ros2
    5
    9
    1.1k
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 1
      1035207328
      最后由 编辑

      source install/setup.bash
      not found: "/home/wade/dev_ws/install/local_setup.bash"
      这个问题好像后续launch可以使用,我感觉没有source应该会出些意想不到的bug,应该怎么解决

      小鱼小 1 条回复 最后回复 回复 引用 0
      • 小伊小
        机器人小伊
        最后由 编辑

        在使用 MoveIt 2 (或其他基于 ROS 2 的软件包) 时,当你看到关于 source install/setup.bash 的报错,但实际上错误消息提到了 local_setup.bash 而不是 setup.bash,这通常意味着你可能在尝试使用 ROS 1 的习惯来配置 ROS 2 环境。

        在 ROS 2 中,环境配置通常是通过 source install/setup.*sh 完成的,其中 * 可以是 bash、zsh、fish 等,具体取决于你的 shell。ROS 2 不再使用 local_setup.bash 这样的文件。

        这里有几个步骤可以帮助你解决这个问题:

        1. 确保你正在使用 ROS 2:
          确保你的工作空间是为 ROS 2 构建的,而不是 ROS 1。

        2. 检查安装文件夹:
          导航到你的工作空间中的 install 文件夹,并检查是否有 setup.bash 文件。你可以使用以下命令来查找和列出 install 目录中的文件:

          cd ~/dev_ws/install
          ls -l setup.*sh
          

          如果 setup.bash 存在,那么你可以正常地 source 它:

          source ~/dev_ws/install/setup.bash
          
        3. 检查你的构建命令:
          确保你使用了正确的 ROS 2 构建命令,如 colcon build。ROS 2 使用 colcon 而不是 catkin_make 或 catkin build。

        4. 检查你的 ROS 2 版本:
          确认你安装了正确的 ROS 2 版本,并且你的环境变量(如 ROS_VERSION 和 ROS_DISTRO)设置正确。

        5. 重新构建你的工作空间:
          如果上述检查都没问题,你可以尝试重新清理和构建你的工作空间:

          cd ~/dev_ws
          colcon build --packages-select your_package_name  # 或者如果你想要构建整个工作空间,则省略 --packages-select
          

          注意:your_package_name 是你想要构建的包的名称。

        6. 检查 MoveIt 2 的安装说明:
          如果你是在按照 MoveIt 2 的安装说明操作,请确保你遵循了针对你的 ROS 2 发行版的正确步骤。

        7. 查看 MoveIt 2 的文档和社区:
          如果问题仍然存在,查看 MoveIt 2 的官方文档或社区论坛可能会提供额外的帮助。

        最后,请注意,即使 source 命令出现了关于 local_setup.bash 的错误,但如果你仍然能够成功启动节点和 launch 文件,那可能是因为你的环境中有其他 ROS 2 设置已经正确配置了。然而,为了避免潜在的问题,最好还是确保你的环境配置是正确的。


        以上为生成回答,仅供参考~

        我是小伊,已接入ChatGpt,所有回复,仅供参考~

        1 1 条回复 最后回复 回复 引用 0
        • 1
          1035207328 @小伊
          最后由 编辑

          @小伊 尝试过了未解决问题

          1 条回复 最后回复 回复 引用 0
          • 小伊小
            机器人小伊
            最后由 编辑

            当你说“尝试过了未解决问题”时,我理解你可能在描述一个技术、工程或日常问题,你已经尝试了一些解决方案但都没有成功。为了更有效地帮助你,我可以提供一些一般性的建议:

            1. 明确问题:

              • 清晰地定义你遇到的问题。
              • 尝试将问题分解为更小的部分,这有助于确定问题的根源。
            2. 收集信息:

              • 查找相关的文档、教程或在线资源。
              • 搜索类似的问题和潜在的解决方案。
              • 收集尽可能多的错误信息或日志,以帮助你更好地理解问题。
            3. 重新评估你的解决方案:

              • 回顾你尝试过的所有解决方案。
              • 考虑是否有任何遗漏的步骤或配置。
              • 思考是否有其他可能的方法或工具可以尝试。
            4. 寻求帮助:

              • 在相关的论坛、社区或问答网站上发布你的问题。
              • 向同事、朋友或专家咨询。
              • 如果有支持服务,联系技术支持获取帮助。
            5. 尝试新的解决方案:

              • 根据你收集的信息和反馈,尝试新的解决方案。
              • 遵循推荐的步骤,并仔细阅读所有的错误信息和提示。
            6. 记录和分享:

              • 记录你尝试过的所有解决方案和结果。
              • 如果问题得到解决,分享你的解决方案和过程,以便其他人可以从中受益。
            7. 耐心和持续的努力:

              • 解决复杂问题可能需要时间和耐心。
              • 不要轻易放弃,即使你已经尝试了很多次。
            8. 学习和成长:

              • 每次遇到问题时,都是一个学习和成长的机会。
              • 从错误中学习,了解为什么会失败,并尝试避免在未来重复这些错误。

            如果你能提供更多的上下文或具体的问题描述,我可能能够给出更具体的建议或解决方案。


            以上为生成回答,仅供参考~

            我是小伊,已接入ChatGpt,所有回复,仅供参考~

            1 条回复 最后回复 回复 引用 0
            • 小鱼小
              小鱼 技术大佬 @1035207328
              最后由 编辑

              @1035207328 在 moveit2 最后一步source install/setup.bash报错 中说:

              not found: "/home/wade/dev_ws/install/local_setup.bash"

              有没有在 ~/.bashrc 中配置什么东西,展示下你的 ~/.bashrc 文件

              命令:

              cat ~/.bashrc
              

              新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

              1 3 2 条回复 最后回复 回复 引用 0
              • 1
                1035207328 @小鱼
                最后由 编辑

                @小鱼 已经解决了 单线程colcon build 完后先在原终端source后新开终端就可以source了

                3 1 条回复 最后回复 回复 引用 0
                • 3
                  3533056191 @小鱼
                  最后由 编辑

                  @小鱼 # ~/.bashrc: executed by bash(1) for non-login shells.

                  see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)

                  for examples

                  If not running interactively, don't do anything

                  case $- in
                  i) ;;
                  *) return;;
                  esac

                  don't put duplicate lines or lines starting with space in the history.

                  See bash(1) for more options

                  HISTCONTROL=ignoreboth

                  append to the history file, don't overwrite it

                  shopt -s histappend

                  for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

                  HISTSIZE=1000
                  HISTFILESIZE=2000

                  check the window size after each command and, if necessary,

                  update the values of LINES and COLUMNS.

                  shopt -s checkwinsize

                  If set, the pattern "**" used in a pathname expansion context will

                  match all files and zero or more directories and subdirectories.

                  #shopt -s globstar

                  make less more friendly for non-text input files, see lesspipe(1)

                  [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

                  set variable identifying the chroot you work in (used in the prompt below)

                  if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
                  debian_chroot=$(cat /etc/debian_chroot)
                  fi

                  set a fancy prompt (non-color, unless we know we "want" color)

                  case "$TERM" in
                  xterm-color|*-256color) color_prompt=yes;;
                  esac

                  uncomment for a colored prompt, if the terminal has the capability; turned

                  off by default to not distract the user: the focus in a terminal window

                  should be on the output of commands, not on the prompt

                  #force_color_prompt=yes

                  if [ -n "$force_color_prompt" ]; then
                  if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
                  # We have color support; assume it's compliant with Ecma-48
                  # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
                  # a case would tend to support setf rather than setaf.)
                  color_prompt=yes
                  else
                  color_prompt=
                  fi
                  fi

                  if [ "$color_prompt" = yes ]; then
                  PS1='${debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]$ '
                  else
                  PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$ '
                  fi
                  unset color_prompt force_color_prompt

                  If this is an xterm set the title to user@host:dir

                  case "$TERM" in
                  xterm*|rxvt*)
                  PS1="[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a]$PS1"
                  ;;
                  *)
                  ;;
                  esac

                  enable color support of ls and also add handy aliases

                  if [ -x /usr/bin/dircolors ]; then
                  test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
                  alias ls='ls --color=auto'
                  #alias dir='dir --color=auto'
                  #alias vdir='vdir --color=auto'

                  alias grep='grep --color=auto'
                  alias fgrep='fgrep --color=auto'
                  alias egrep='egrep --color=auto'
                  

                  fi

                  colored GCC warnings and errors

                  #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

                  some more ls aliases

                  alias ll='ls -alF'
                  alias la='ls -A'
                  alias l='ls -CF'

                  Add an "alert" alias for long running commands. Use like so:

                  sleep 10; alert

                  alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '''s/^\s*[0-9]+\s*//;s/[;&|]\s*alert$//''')"'

                  Alias definitions.

                  You may want to put all your additions into a separate file like

                  ~/.bash_aliases, instead of adding them here directly.

                  See /usr/share/doc/bash-doc/examples in the bash-doc package.

                  if [ -f ~/.bash_aliases ]; then
                  . ~/.bash_aliases
                  fi

                  enable programmable completion features (you don't need to enable

                  this, if it's already enabled in /etc/bash.bashrc and /etc/profile

                  sources /etc/bash.bashrc).

                  if ! shopt -oq posix; then
                  if [ -f /usr/share/bash-completion/bash_completion ]; then
                  . /usr/share/bash-completion/bash_completion
                  elif [ -f /etc/bash_completion ]; then
                  . /etc/bash_completion
                  fi
                  fi

                  >>> fishros initialize >>>

                  source /opt/ros/humble/setup.bash

                  <<< fishros initialize <<<

                  1 条回复 最后回复 回复 引用 0
                  • 3
                    3533056191 @1035207328
                    最后由 编辑

                    @1035207328具体怎么解决啊,我也遇到这个问题了

                    1 1 条回复 最后回复 回复 引用 0
                    • 1
                      梦里青草香 年度VIP @3533056191
                      最后由 编辑

                      @3533056191 我也遇到这种问题,解决思路如下:
                      问题描述:已在~/.bashrc中删除“source xxx/test_ws/install/setup.bash”,但每次打开终端总是提示“not found: xxx/test_ws/install/local_setup.bash”。
                      原因:虽然在.bashrc中已删除指定的工作空间source,但在其他工作空间的install/setup.bash中可能仍包含如下内容:
                      # setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
                      COLCON_CURRENT_PREFIX="xxx/test_ws/install"
                      _colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash"

                      解决办法:逐一检查.bashrc中涉及的所有工作空间的setup.bash文件,若发现如上所示的语句,直接删除并保存。最后再重新打开终端则不会再提示“not found: xxx/test_ws/install/local_setup.bash”。

                      1 条回复 最后回复 回复 引用 0
                      • 第一个帖子
                        最后一个帖子
                      皖ICP备16016415号-7
                      Powered by NodeBB | 鱼香ROS