在Ubuntu 20.04中找不到ROS包

  • 本文关键字:找不到 ROS Ubuntu ros
  • 更新时间 :
  • 英文 :


我想在我的Ubuntu 20.04机器上试用ROS,我按照ROS网站上的说明安装了ROS包,但成功安装后,roscd失败,找不到命令:

joesan@joesan-InfinityBook-S-14-v5:/opt/ros/noetic$ roscd
bash: roscd: command not found
joesan@joesan-InfinityBook-S-14-v5:/opt/ros/noetic$ 

以下是noetic文件夹中的内容:

joesan@joesan-InfinityBook-S-14-v5:~$ cd /opt/ros/noetic/
drwxr-xr-x joesan joesan   4 KB Sat Aug 29 08:46:37 2020  .
drwxr-xr-x joesan joesan   4 KB Fri Aug 28 21:18:54 2020  ..
.rw-r--r-- joesan joesan   0 B  Fri Jul 24 18:47:51 2020  .catkin
.rw-r--r-- joesan joesan  55 B  Fri Jul 24 18:47:51 2020  .rosinstall
.rwxr-xr-x joesan joesan  13 KB Fri Jul 24 18:47:51 2020  _setup_util.py
drwxr-xr-x joesan joesan   4 KB Fri Aug 28 21:19:38 2020  bin
.rwxr-xr-x joesan joesan 506 B  Fri Jul 24 18:47:51 2020  env.sh
drwxr-xr-x joesan joesan   4 KB Fri Aug 28 21:18:54 2020  etc
drwxr-xr-x joesan joesan   4 KB Fri Aug 28 21:19:39 2020  include
drwxr-xr-x joesan joesan  12 KB Fri Aug 28 21:19:39 2020  lib
.rw-r--r-- joesan joesan 283 B  Fri Jul 24 18:47:51 2020  local_setup.bash
.rw-r--r-- joesan joesan 346 B  Fri Jul 24 18:47:51 2020  local_setup.sh
.rw-r--r-- joesan joesan 293 B  Fri Jul 24 18:47:51 2020  local_setup.zsh
.rw-r--r-- joesan joesan 260 B  Fri Jul 24 18:47:51 2020  setup.bash
.rw-r--r-- joesan joesan 2.7 KB Fri Jul 24 18:47:51 2020  setup.sh
.rw-r--r-- joesan joesan 270 B  Fri Jul 24 18:47:51 2020  setup.zsh
drwxr-xr-x joesan joesan  12 KB Fri Aug 28 21:19:40 2020  share
joesan@joesan-InfinityBook-S-14-v5:/opt/ros/noetic$ 

正如你所看到的,我的.bashrc中也有这行:

# Source the ROS setup profile
source /opt/ros/noetic/setup.bash

有什么想法为什么我不能让roscd命令工作吗?我安装了完整版本:

sudo apt install ros-noetic-desktop-full

我缺少什么吗?

所以我终于解决了这个问题!我有一个.bash_profile,其中包含所有特定于用户的命令和快捷方式。在这个文件中,我还找到了其他的安装文件。所以我现在所做的是从.bashrc中删除ROS的source命令,并将其放在.bash_profile文件中,然后从.bashrc中获取整个.bash_profile文件,如下所示:

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

在.bash_profile中,我有这样的源命令:

# Source the ROS setup profile
source /opt/ros/noetic/setup.bash

这有助于我修复错误!

最新更新