系统ubuntu20.04
ros noetic + humble(源码安装失败,放弃源码安装了)
1. ubuntu安装vcs
拉取autoware源码的时候需要用到命令
vcs import src < autoware.ai.repos
但是ubuntu默认没有安装vcs工具(zsh: command not found: vcs)
应使用以下命令安装:
sudo apt-get install python3-vcstool
不是apt-get install vcs(笑)
原文链接:[tip] ubuntu安装vcs命令 (autoware)
2. ros2:未找到命令
或者:
E: 无法定位软件包 ros-humble-desktop
ros2命令用不了,用source命令运行bash文件还是不行,讲道理source了之后在当前终端下是可以运行ros2命令的,在其他没有source的终端才会出现“ros2:未找到命令”的情况。为什么source了也不行呢??
ps. rosversion -d
是可以查看ros安装版本的,输出了noetic,如下:
在不同ROS版本采用的Python里看到了这句:
1、noetic是ROS1的终极版本,建议后续使用ROS2版本,需要注意:noetic之前的版本默认使用的是Python2,noetic之后的ROS则使用Python3
啊?!所以noetic是ros1的版本啊,怪不得用不了ros2的命令呢 -_-||
目前humble是ros的长期支持版本(LTS)版,打算安装humble了,不知道noetic和humble两个版本共存会不会出问题
安装教程参照【古月居】古月·ROS2入门21讲
↑↑↑
× 错!古月居的这个教程是从ubuntu22.04版本安装的humble,安装过程较为简单,但是对于我现在用的ubuntu20.04系统,humble仅支持源码编译,这种安装过程参照大佬的教程:ros2humble源码编译 ubuntu系统。
前面都没有问题,直到第六步、在工作空间中编译源码的colcon build --symlink-install
这一步,必须要用***,所以我又装了一个***的linux版本,安装过程参照另一大佬教程linux ***最速安装使用,注意装完***、重启后再次运行colcon build --symlink-install
才有效!!
2.0 放弃ubuntu20.04+ros2 humble源码安装了!!
源码编译一共有346个包,我装到大概第140多个就实在是装不了了,报错例子如下。这样一个包一个包的装下去也不是办法,所以我决定,在一个干净的环境里开始我的ros之路:重装系统ubuntu22.04 + ros2(humble版本),参见 ubuntu+ros新手笔记(二)。
---
Failed <<< python_orocos_kdl_vendor [2.23s, exited with code 1]
Aborted <<< qt_gui_app [0.02s]
Aborted <<< rviz_rendering_tests [0.36s]
Aborted <<< launch_testing [1.31s]
Aborted <<< rosidl_cmake [0.72s]
Summary: 123 packages finished [27.3s]
1 package failed: python_orocos_kdl_vendor
4 packages aborted: launch_testing qt_gui_app rosidl_cmake rviz_rendering_tests
1 package had stderr output: python_orocos_kdl_vendor
218 packages not processed
一个报错:
--- stderr: rosidl_generator_c
Traceback (most recent call last):
File "/home/xj/ros2_humble/src/ros2/rosidl/rosidl_generator_c/bin/rosidl_generator_c", line 8, in <module>
from rosidl_generator_c import generate_c
ModuleNotFoundError: No module named 'rosidl_generator_c'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/xj/ros2_humble/src/ros2/rosidl/rosidl_generator_c/bin/rosidl_generator_c", line 20, in <module>
rosidl_generator_c = loader.load_module()
File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 962, in load_module
File "<frozen importlib._bootstrap_external>", line 787, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/xj/ros2_humble/src/ros2/rosidl/rosidl_generator_c/rosidl_generator_c/__init__.py", line 15, in <module>
from rosidl_cmake import convert_camel_case_to_lower_case_underscore
File "/home/xj/ros2_humble/install/rosidl_cmake/lib/python3.8/site-packages/rosidl_cmake/__init__.py", line 24, in <module>
from rosidl_parser.parser import parse_idl_file
File "/home/xj/ros2_humble/install/rosidl_parser/lib/python3.8/site-packages/rosidl_parser/parser.py", line 20, in <module>
from lark import Lark
ModuleNotFoundError: No module named 'lark'
make[2]: *** [CMakeFiles/rosidl_generator_c_interfaces__rosidl_generator_c.dir/build.make:86:rosidl_generator_c/rosidl_generator_c/msg/arrays.h] 错误 1
make[1]: *** [CMakeFiles/Makefile2:225:CMakeFiles/rosidl_generator_c_interfaces__rosidl_generator_c.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2
---
Failed <<< rosidl_generator_c [4.88s, exited with code 2]
3. Ubuntu 截屏(或截图)的方式
如下: