广西南宁市住房和城乡建设局网站网站企业优化
ROS2的humble安装
1、系统配置ubuntu 22.04
- 假如长期使用ros2,建议是ubuntu系统或者双系统下安装操作,不要在虚拟机中进行。
 - ubuntu系统能用最新的大系统就用最新的,比如22.04。等明年24.04出来可以用24.04
 
2、humble安装
- ros版本选择humble版本,比较稳定,各公司用的多一点。
 
2.1、一键安装
- 利用鱼香ROS的安装指令一键安装即可
 
wget http://fishros.com/install -O fishros && . fishros
 
(1) 选择===> 一键安装:ROS(支持ROS和ROS2,树莓派Jetson)
 (2) 选择===> 更换系统源再继续安装
 (3) 选择===> humble系统
 (4) 选择===> humble系统桌面版
接着等待安装即可
ROS2的rosdepc安装
鱼香ros中可以安装另外版本的rosdepc
wget http://fishros.com/install -O fishros && . fishros
 
选择3,一键配置rosdepc。安装完成后运行rosdepc update
ROS2的cartographer安装
- Cartographer是Google开源的一个跨平台、实时定位与建图系统(SLAM)。它采用的激光传感器可以是2D或3D形式。
 - cartographer的github地址
 - cartographer_ros的github地址
 - cartographer的参考文档地址
 - cartographer_ros的参考文档地址
 
cartographer的安装方式有两种:apt安装和源码安装。推荐源码安装,便于查看和修改源码。
1、源码安装
- 创建工作空间
 
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
 
- 安装依赖
 
cd ~/carto_ws
rosdepc install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y 
- 编译
 
colcon build --packages-up-to cartographer_ros 
- 验证是否成功
 
source install/setup.bash
ros2 pkg list | grep cartographer
 
显示内容如下
cartographer_ros
cartographer_ros_msgs
