奉贤做网站建设淘宝怎么设置关键词搜索
文章目录
- 前言
- 下载编译过程
- 创建开发环境
- 拉取源代码
- 更新rosdep
- 下载安装moveit 2依赖包
- 编译源码
- 输出结果
- 总结
前言
本文用来记录moveit 2从源码编译的全流程。
本机环境:
系统:debian 11
ros版本:ros2 humble
处理器:intel i7
内存:16g
下载编译过程
创建开发环境
$ cd ~
$ mkdir workspace
拉取源代码
方法1:博主导入了本地源会快一些
$ cd ~/workspace
$ git clone https://gitee.com/lilinxin75/moveit2.git -b humble --depth=1
$ mkdir deps
$ cd deps
$ git clone https://gitee.com/lilinxin75/moveit_msgs.git -b humble --depth=1
$ git clone https://gitee.com/lilinxin75/moveit_resources.git -b humble --depth=1
$ git clone https://gitee.com/lilinxin75/ros2_control.git -b humble --depth=1
$ git clone https://gitee.com/lilinxin75/control_msgs.git -b humble --depth=1
$ git clone https://gitee.com/lilinxin75/realtime_tools.git --depth=1
$ git clone https://gitee.com/lilinxin75/object_recognition_msgs.git -b ros2 --depth=1
方法二:使用官方源
$ cd ~/workspace
$ git clone https://github.com/ros-planning/moveit2.git -b $ROS_DISTRO --depth=1
$ mkdir deps
$ cd deps
$ git clone https://github.com/ros-planning/moveit_msgs.git -b humble --depth=1
$ git clone https://github.com/ros-planning/moveit_resources.git -b humble --depth=1
$ git clone https://github.com/ros-controls/ros2_control.git -b humble --depth=1
$ git clone https://github.com/ros-controls/control_msgs.git -b humble --depth=1
$ git clone https://github.com/ros-controls/realtime_tools.git --depth=1
$ git clone https://github.com/wg-perception/object_recognition_msgs.git -b ros2 --depth=1
更新rosdep
$ rosdep init
$ rosdep update
rosdep update出错解决办法,下载文件替换法——No such file or directory: ‘/etc/ros/rosdistro/master/index-v4.yaml
下载安装moveit 2依赖包
$ rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y# result
# $ rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y# All required rosdeps installed successfully
编译源码
# --parallel-workers 2 意思是限制同时编译项目为2个,默认值为cpu核数,不设置该值会占用大量内存
$ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --parallel-workers 2
关于colcon
构建参数可以参照下边的链接:
ROS2构建工具colcon介绍
输出结果
$ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --parallel-workers 2
Starting >>> object_recognition_msgs
Starting >>> moveit_common...Starting >>> moveit_setup_core_plugins
Starting >>> moveit_setup_srdf_plugins
Finished <<< moveit_runtime [0.30s]
Finished <<< moveit_setup_core_plugins [0.57s]
Finished <<< moveit_setup_app_plugins [0.65s]
Finished <<< moveit_setup_controllers [0.80s]
Finished <<< moveit_setup_srdf_plugins [0.79s]
Starting >>> moveit_setup_assistant
Finished <<< moveit_setup_assistant [0.35s]
Starting >>> moveit
Finished <<< moveit [0.19s] Summary: 58 packages finished [13.6s] 4 packages had stderr output: controller_manager moveit_configs_utils ros2controlcli rqt_controller_manager
总结
在整体编译过程中也遇到了不少的坑,在本文做简单记录。
后续会逐步整理如何调用Moveit2
做一些特定功能的开发。