我在通过本教程安装ROS软件包时遇到了问题https://nxp.gitbook.io/nxp-aim/installation-of-nxp-gazebo
$ ./foxy_install_aim.sh
给出以下错误
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (7.81.0-1ubuntu1.2).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Hit:1 http://in.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:5 http://packages.ros.org/ros2/ubuntu jammy InRelease
Fetched 110 kB in 2s (52.0 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: http://packages.ros.org/ros2/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'xorg' instead of 'x-window-system'
E: Unable to locate package gazebo11
E: Unable to locate package libgazebo11-dev
E: Unable to locate package ros-foxy-ros-base
E: Unable to locate package ros-foxy-desktop
E: Unable to locate package ros-foxy-cv-bridge
E: Unable to locate package ros-foxy-image-tools
E: Unable to locate package ros-foxy-image-transport
E: Unable to locate package ros-foxy-image-transport-plugins
E: Unable to locate package ros-foxy-image-pipeline
E: Unable to locate package ros-foxy-camera-calibration-parsers
E: Unable to locate package ros-foxy-camera-info-manager
E: Unable to locate package ros-foxy-launch-testing-ament-cmake
E: Unable to locate package ros-foxy-cv-bridge
E: Unable to locate package ros-foxy-vision-opencv
E: Unable to locate package ros-foxy-gazebo-dev
E: Unable to locate package ros-foxy-gazebo-msgs
E: Unable to locate package ros-foxy-gazebo-msgs-dbgsym
E: Unable to locate package ros-foxy-gazebo-plugins
E: Unable to locate package ros-foxy-gazebo-plugins-dbgsym
E: Unable to locate package ros-foxy-gazebo-ros
E: Unable to locate package ros-foxy-gazebo-ros2-control
E: Unable to locate package ros-foxy-gazebo-ros2-control-dbgsym
E: Unable to locate package ros-foxy-gazebo-ros2-control-demos
E: Unable to locate package ros-foxy-gazebo-ros2-control-demos-dbgsym
E: Unable to locate package ros-foxy-gazebo-ros-dbgsym
E: Unable to locate package ros-foxy-gazebo-ros-pkgs
E: Unable to locate package ros-foxy-vision-msgs
E: Unable to locate package ros-foxy-vision-msgs-dbgsym
sudo: geographiclib-get-geoids: command not found
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
./foxy_install_aim.sh: line 41: /opt/ros/foxy/setup.bash: No such file or directory
带有"E:"似乎是错误,但我不确定我应该如何修复这些
可能您在apt配置中缺少了一些资源。
来自ros官方文档- https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html
<设置来源/strong>
您需要将ROS 2 apt存储库添加到系统中。首先,确保Ubuntu Universe存储库是由查看命令输出
apt-cache policy | grep universe
应该输出如下所示的行:
500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
release v=20.04,o=Ubuntu,a=jammy,n=jammy,l=Ubuntu,c=universe,b=amd64
如果您没有看到像上面那样的输出行,那么使用以下指令启用Universe存储库:
sudo apt install software-properties-common
sudo add-apt-repository universe
现在将ROS 2 apt存储库添加到系统中。
sudo apt update && sudo apt install curl gnupg2 lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
然后将存储库添加到您的源代码列表中。
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
设置存储库后更新apt存储库缓存。
sudo apt update
你用的是哪个版本的ubuntu ?我在22.04中遇到了同样的问题,它不受支持。我安装了20.04,然后它工作了。
我在Raspberry Pi上安装ros2 humble时遇到了完全相同的问题,并找到了解决方案:问题是我的时钟没有同步,操作系统认为它是昨天。我必须进入设置,做两件事:在"日期"下面;time ",手动设置日期和时间。然后,在"隐私"下,打开"位置服务"。然后按照ros文档(https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)中的步骤操作,就可以了。所以我想,如果你的时钟落后了,curl命令可能会不起作用。