使用 Windows 的子系统 WSL 安装 Ubuntu 22.04
博客地址:https://www.cnblogs.com/zylyehuo/第一步、安装 WSL
以管理员身份打开 PowerShell
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228151135586-556834978.png
PS C:\WINDOWS\system32> wsl --install第二步、重启电脑
第三步、安装 Ubuntu 22.04
PS C:\WINDOWS\system32> wsl --set-default-version 2PS C:\WINDOWS\system32> wsl --install -d ubuntu-22.04第四步、输入用户名
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228151515967-198811545.png
第五步、输入密码
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228151832941-1378934734.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228151912082-154463914.png
第六步、安装 ROS2
zylyehuo@LAPTOP-4FQQUA1G:~$ wget http://fishros.com/install -O fishros && bash fishros选择 1
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228152457116-1624019790.png
选择 1
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228152548757-411920282.png
选择 2
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228152741865-2003679490.png
选择 1
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228152930642-211249033.png
选择 1
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228152951648-1807954132.png
选择 1
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228153022822-745995525.png
选择 1
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228153450247-2136560009.png
第七步、更新环境目录
zylyehuo@LAPTOP-4FQQUA1G:~$ source~/.bashrc第八步、测试是否安装成功
zylyehuo@LAPTOP-4FQQUA1G:~$ ros2https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228154947900-545475586.png
第九步、运行小海龟例程
zylyehuo@LAPTOP-4FQQUA1G:~$ ros2 run turtlesim turtlesim_nodehttps://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228155204536-1938066410.png
# 新开一个终端(PowerShell)zylyehuo@LAPTOP-4FQQUA1G:~$ wslzylyehuo@LAPTOP-4FQQUA1G:~$ ros2 run turtlesim turtle_teleop_keyhttps://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228155543284-1898599353.png
第十步、在 VSCode 中安装 WSL 插件
VSCode 仅作为编辑器
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228160002658-1542378198.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228160112143-1493550871.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228160216768-1421352796.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228160342274-978432910.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228160410910-2143975139.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228160438089-1121131457.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228160503783-1442136753.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228160603131-1607708971.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228160702905-1177725000.png
第十一步、编程 Python 文件进行测试
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228161001198-1248198745.png
(1)不指定使用 python3
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228161047308-606684856.png
(2)指定使用 python3
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228170521978-713952471.png
第十二步、编程 C++ 文件进行测试
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228170014753-61562854.png
(1)直接在终端使用 g++ 进行编译
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228171421247-372096724.png
(2)利用 CMakeLists.txt 进行编译
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228172529975-1530745772.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228172742552-1814142982.png
https://img2024.cnblogs.com/blog/3071480/202512/3071480-20251228172934437-1560249481.png
来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! 感谢发布原创作品,程序园因你更精彩 这个好,看起来很实用 这个好,看起来很实用 感谢分享 不错,里面软件多更新就更好了 yyds。多谢分享 感谢分享 收藏一下 不知道什么时候能用到 过来提前占个楼 用心讨论,共获提升! 感谢发布原创作品,程序园因你更精彩 感谢,下载保存了 新版吗?好像是停更了吧。 过来提前占个楼 喜欢鼓捣这些软件,现在用得少,谢谢分享! 很好很强大我过来先占个楼 待编辑 感谢分享,下载保存了,貌似很强大 新版吗?好像是停更了吧。 过来提前占个楼
页:
[1]
2