参考链接:
docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html
使用WSL2效果不错,测试版功能包就超过了1k+。
2022-05-04:1040 个功能包。
安装:sudo apt install ros-humble-desktop
测试:
ros2 run turtlesim turtlesim_node
键盘遥控ok:
rviz2:
附录:
全过程如下
https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html
zhangrelay@LAPTOP-5REQ7K1L:~$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo apt update && sudo apt install locales
[sudo] password for zhangrelay:
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [109 kB]
Get:4 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [57.2 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [16.1 kB]
Get:6 http://security.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [928 B]
Get:7 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [13.6 kB]
Get:8 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [6,840 B]
Get:9 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [480 B]
Hit:10 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [67.7 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [20.0 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [1,636 B]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [25.5 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [10.9 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [860 B]
Fetched 441 kB in 4s (111 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
8 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
locales is already the newest version (2.35-0ubuntu3).
locales set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo locale-gen en_US en_US.UTF-8
Generating locales (this might take a while)...
en_US.ISO-8859-1... done
en_US.UTF-8... done
Generation complete.
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
zhangrelay@LAPTOP-5REQ7K1L:~$ export LANG=en_US.UTF-8
zhangrelay@LAPTOP-5REQ7K1L:~$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
zhangrelay@LAPTOP-5REQ7K1L:~$ apt-cache policy | grep universe
ttp://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy,n=jammy,l=Ubuntu,c=universe,b=amd64 500 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=universe,b=amd64
500 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy-updates,n=jammy,l=Ubuntu,c=universe,b=amd64
500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy,n=jammy,l=Ubuntu,c=universe,b=amd64
zhangrelay@LAPTOP-5REQ7K1L:~$ 500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
500: command not found
zhangrelay@LAPTOP-5REQ7K1L:~$ release v=22.04,o=Ubuntu,a=jammy,n=jammy,l=Ubuntu,c=universe,b=amd64^C
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo apt install software-properties-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
software-properties-common is already the newest version (0.99.22).
software-properties-common set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo add-apt-repository universe
Adding component(s) 'universe' to all repositories.
Press [ENTER] to continue or Ctrl-c to cancel.
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
zhangrelay@LAPTOP-5REQ7K1L:~$ apt-cache policy | grep universe
500 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=universe,b=amd64
500 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy-updates,n=jammy,l=Ubuntu,c=universe,b=amd64
500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy,n=jammy,l=Ubuntu,c=universe,b=amd64
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo apt install software-properties-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
software-properties-common is already the newest version (0.99.22).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo add-apt-repository universe
Adding component(s) 'universe' to all repositories.
Press [ENTER] to continue or Ctrl-c to cancel.
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
zhangrelay@LAPTOP-5REQ7K1L:~$ apt-cache policy | grep universe
500 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=universe,b=amd64
500 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy-updates,n=jammy,l=Ubuntu,c=universe,b=amd64
500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
release v=22.04,o=Ubuntu,a=jammy,n=jammy,l=Ubuntu,c=universe,b=amd64
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo apt update && sudo apt install curl gnupg lsb-release
Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
8 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gnupg is already the newest version (2.2.27-3ubuntu2).
gnupg set to manually installed.
lsb-release is already the newest version (11.1.0ubuntu4).
lsb-release set to manually installed.
curl is already the newest version (7.81.0-1ubuntu1.1).
curl set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 65 ms: Connection refused
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 1 ms: Connection refused
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 1 ms: Connection refused
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 1 ms: Connection refused
zhangrelay@LAPTOP-5REQ7K1L:~$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2-testing/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Get:2 http://packages.ros.org/ros2-testing/ubuntu jammy InRelease [4,670 B]
Hit:3 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:2 http://packages.ros.org/ros2-testing/ubuntu jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
Reading package lists... Done
W: GPG error: http://packages.ros.org/ros2-testing/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
E: The repository 'http://packages.ros.org/ros2-testing/ubuntu jammy InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 11 ms: Connection refused
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo gedit /etc/hosts
hosts hosts.allow hosts.deny
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo gedit /etc/hosts
** (gedit:1661): WARNING **: 20:00:44.388: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported
** (gedit:1661): WARNING **: 20:00:44.388: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported
** (gedit:1661): WARNING **: 20:00:45.529: Set document metadata failed: Setting attribute metadata::gedit-position not supported
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Get:4 http://packages.ros.org/ros2-testing/ubuntu jammy InRelease [4,670 B]
Get:5 http://packages.ros.org/ros2-testing/ubuntu jammy/main amd64 Packages [536 kB]
Hit:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 541 kB in 5s (107 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
8 packages can be upgraded. Run 'apt list --upgradable' to see them.
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo apt install ros-humble-
Display all 1040 possibilities? (y or n)
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo apt install ros-humble-desktop
Display all 68889 possibilities? (y or n)
zhangrelay@LAPTOP-5REQ7K1L:~$ sudo apt install ros-humble-desktop
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
本文摘自 :https://blog.51cto.com/u