ros2 humble 安装 ros2 run rplidar_ros rplidar_composition
时间: 2023-12-22 14:27:55 浏览: 179
ROS2 C#库 win10+Humble环境编译 可适用于Unity
以下是ros2 humble安装和rplidar_ros的演示:
1. 安装ROS2 humble系统
```
# 一键安装ROS2 humble系统
选择==> 一键安装:ROS(支持ROS和ROS2,树莓派Jetson)
选择==> 更换系统源再继续安装
选择==> humble系统
选择==> humble系统桌面版
```
2. 克隆cartographer和cartographer_ros源码
```
# 创建工作空间
mkdir -p carto_ws/src && cd carto_ws/src
# 克隆代码
git clone https://ghproxy.com/https://github.com/ros2/cartographer.git -b ros2
git clone https://ghproxy.com/https://github.com/ros2/cartographer_ros.git -b ros2
```
3. 安装依赖并编译
```
# 安装依赖
cd ~/carto_ws
rosdep install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
# 编译
colcon build --packages-up-to cartographer_ros
```
4. 验证是否成功
```
source install/setup.bash
ros2 pkg list | grep cartographer
```
5. 运行rplidar_ros
```
ros2 run rplidar_ros rplidar_composition
```
阅读全文