环境

Windows 11安装的wsl-ubuntu

Error: jammy Release 404 Not Found

Err:10 http://packages.ros.org/ros/ubuntu jammy Release 404 Not Found [IP: 140.211.166.134 80] Reading package lists... Done 
W: https://dl.yarnpkg.com/debian/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. 
E: The repository 'http://packages.ros.org/ros/ubuntu jammy Release' does not have a Release file. 
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.

解决方案

请确认ros版本和ubuntu版本是否匹配,我的问题在于ubuntu22.04只能安装ros2无法兼容ros1,因为ros1最高只支持到ubuntu20.04。于是在通过wsl下载了ubuntu20.04,步骤如下。

推荐powershell工具

蛮推荐微软官方的这个PowerShell美区链接

powershell_mstore

powershell_show

wsl安装ubuntu20.04

windows打开powershell,现在要检索可以直接安装的系统,输入:

wsl --list --online

wsllist

安装20.04版本ubuntu请输入:

wsl --install -d Ubuntu-20.04

然后可以跟随ros1官方教程安装了。中文官方教程

vscode启动wsl

若存在多个wsl安装的系统,在vscode中如何链接?
先安装ssh拓展
vscode_ssh

如图操作,然后选择需要的20.04的ubuntu系统
ros_install_vscode1

即可

Error: ‘TURTLEBOT3_MODEL’ is not set

安装完成后用roslaunch命令尝试启动turtlebot3 package启动报错如下:

$ roslaunch turtlebot3_gazebo turtlebot3_world.launch

RLException: Invalid <arg> tag: environment variable 'TURTLEBOT3_MODEL' is not set. 

Arg xml is <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
The traceback for the exception was written to the log file

解决方案

我的解决办法是设置成waffle,可按需修改

export TURTLEBOT3_MODEL=waffle

再次尝试
vscode_roslaunch