版本平台
- 系统版本:ubuntu22.04
- ROS2 版本:humble
- Moveit 版本:moveit2-humble
1. 安装 MoveIt2
1.1 安装 Ubuntu 操作系统和 ROS2
不再赘述,教程很多,注意我们使用的 ubuntu 版本和 ros 版本如上。
1.2 安装 MoveIt2
目前 MoveIt2 官方已经支持二进制安装,这里直接使用下面命令即可:
sudo apt-get install ros-humble-moveit

2. 编译 moveit2 测试程序
2.1 创建工作空间
mkdir -p ~/moveit2/src/
2.2 下载代码
cd ~/moveit2/src/
git clone https://github.com/ros-planning/moveit2_tutorials.git
2.3 安装依赖包
安装依赖使用 rosdepc (或 rosdep):
vcs import < moveit2_tutorials-main/moveit2_tutorials.repos
rosdepc install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y

2.4 编译代码
安装好依赖包后,将刚才的代码编译:
cd ../
colcon build --event-handlers desktop_notification- status- --cmake-args -DCMAKE_BUILD_TYPE=Release
3. 运行程序
终端 source 执行 install 下的 bash,避免任意路径找不到程序:
source install/setup.bash
sudo sed -i "source install/setup.bash" ~/.bashrc
ros2 launch moveit2_tutorials demo.launch.py rviz_tutorial:=true




