品牌商城网站建设公司,自己的网站怎么做模板,洛阳网络运营公司,盘锦门户网站制作文章目录前言下载编译过程创建开发环境拉取源代码更新rosdep下载安装moveit 2依赖包编译源码输出结果总结前言
本文用来记录moveit 2从源码编译的全流程。 本机环境#xff1a; 系统#xff1a;debian 11 ros版本#xff1a;ros2 humble 处理器#xff1a;intel i7 内存 系统debian 11 ros版本ros2 humble 处理器intel i7 内存16g
下载编译过程
创建开发环境
$ cd ~
$ mkdir workspace拉取源代码
方法1博主导入了本地源会快一些
$ cd ~/workspace
$ git clone https://gitee.com/lilinxin75/moveit2.git -b humble --depth1
$ mkdir deps
$ cd deps
$ git clone https://gitee.com/lilinxin75/moveit_msgs.git -b humble --depth1
$ git clone https://gitee.com/lilinxin75/moveit_resources.git -b humble --depth1
$ git clone https://gitee.com/lilinxin75/ros2_control.git -b humble --depth1
$ git clone https://gitee.com/lilinxin75/control_msgs.git -b humble --depth1
$ git clone https://gitee.com/lilinxin75/realtime_tools.git --depth1
$ git clone https://gitee.com/lilinxin75/object_recognition_msgs.git -b ros2 --depth1方法二使用官方源
$ cd ~/workspace
$ git clone https://github.com/ros-planning/moveit2.git -b $ROS_DISTRO --depth1
$ mkdir deps
$ cd deps
$ git clone https://github.com/ros-planning/moveit_msgs.git -b humble --depth1
$ git clone https://github.com/ros-planning/moveit_resources.git -b humble --depth1
$ git clone https://github.com/ros-controls/ros2_control.git -b humble --depth1
$ git clone https://github.com/ros-controls/control_msgs.git -b humble --depth1
$ git clone https://github.com/ros-controls/realtime_tools.git --depth1
$ git clone https://github.com/wg-perception/object_recognition_msgs.git -b ros2 --depth1更新rosdep
$ rosdep init
$ rosdep updaterosdep 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_TYPERelease --parallel-workers 2关于colcon构建参数可以参照下边的链接 ROS2构建工具colcon介绍
输出结果
$ colcon build --cmake-args -DCMAKE_BUILD_TYPERelease --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做一些特定功能的开发。