当前位置: 首页 > news >正文

moveit 2源码编译

文章目录

  • 前言
  • 下载编译过程
    • 创建开发环境
    • 拉取源代码
    • 更新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做一些特定功能的开发。

http://www.lryc.cn/news/14810.html

相关文章:

  • 2022年全国职业院校技能大赛(中职组)网络安全竞赛试题A模块(4)
  • 微服务保护之sentinel熔断器
  • 电动打气泵方案开发--鼎盛合PCBA方案
  • 第十三届蓝桥杯省赛 C++ A 组 F 题、Java A 组 G题、C组 H 题、Python C 组 I 题——青蛙过河(AC)
  • django项目实战四(django+bootstrap实现增删改查)进阶时间控件
  • Jetpack之ViewModel
  • 追梦之旅【数据结构篇】——详解C语言动态实现顺序表
  • xss基础
  • 移动WEB开发二、流式布局
  • 分享在线预约系统制作步骤_在线预约链接怎么做
  • 【每日一题Day125】LC1326灌溉花园的最少水龙头数目 | 动态规划 贪心
  • C# FFmpeg推流Vlc.DotNet拉流优化参数
  • pnpm v8版本升级变化关注点(前瞻速攻版)
  • Python基础-环境安装
  • 重载、重写、重构概念辨析
  • 第九章 - 多表查询(join,left join 等)与合并查询(union union all)
  • matplotlib学习笔记(持续更新中…)
  • STM32 SystemInit()函数学习总结
  • 【Spring Boot 原理分析】- 自动配置
  • 简明易懂的JVM理解
  • 新考纲下的PMP考试有多难?
  • 朗润国际期货:知名投行/大佬打Call记
  • 遗传算法及Python实现
  • 零基础 Ubuntu 20.04.01 下搭建51单片机开发环境[开源编译器SDCC]
  • 手摸手快速入门 正则表达式 (Vue源码中的使用)
  • TCP/IP网络协议族分成及其每层作用
  • 041、子序列类型问题(labuladong)
  • linux系统开机文段释义
  • 抽奖动画大转盘抽奖思路与做法
  • Java实现 - 华为2016研发工程师编程题