1.安装Vmware 16
Vmvare官方下载链接:VMware Workstation Player - My VMware
2.安装Ubuntu22.04+ros2humble
下载地址:Index of /ubuntu-releases/22.04/ (ustc.edu.cn),点开上面的网址
ubuntu-22.04-desktop-amd64.iso
下载
参考:2.在虚拟机中安装Ubuntu (fishros.com)
3.安装Vmware tool
虚拟机界面 点击重新安装vmware tool
,会出现安装包,解压压缩包,进入文件夹
su
sudo ./vmware-install.pl
一路看到yes就改成yes,后面一个No
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop
参考:Ubuntu虚拟机实现与主机之间复制粘贴_一只小学鸡s的博客-CSDN博客_ubuntu虚拟机复制粘贴
安装好之后重启ubuntu系统,可以看到界面匹配,可以与主机之间复制粘贴
4.安装moveit2
首先明确之前的安装环境:ubuntu22.04+ros2humble
参考:https://mp.weixin.qq.com/s/NwovrOzSm5Cj778baPYfdg
下载源码
sudo apt-get install git
git clone https://github.com/ros-planning/moveit2.git moveit2_ws/src/moveit2
连不上github,换个
git clone https://ghproxy.com/https://github.com/ros-planning/moveit2.git moveit2_ws/src/moveit2
下载完成后你应该可以在moveit2_ws/src/moveit2文件夹下看到很多个功能包,代表下载成功
安装依赖
还是上面小鱼那个,拿来就用
。选3
cd moveit2_ws/
rosdepc install --from-path src --ignore-src -r -y
编译源码
cd moveit2_ws/
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Source
在moveit2_ws下
source install/setup.bash
为了不用每次打开终端都source,可以修改.bashrc
echo 'source ~/moveit2_ws/install/setup.bash' >> ~/.bashrc
5.安装MoveIt2_tutorial
参考:https://zhuanlan.zhihu.com/p/403674530
参考:https://zhuanlan.zhihu.com/p/537323197
参考:https://moveit.ros.org/install-moveit2/source/
参考:MoveIt Quickstart in RViz — MoveIt Documentation: Humble documentation
参考:https://mp.weixin.qq.com/s/NwovrOzSm5Cj778baPYfdg
安装
sudo apt install python3-vcstool
#建立项目
mkdir -p ~/ws_moveit2/src
cd ~/ws_moveit2/src
#下载教程源码
git clone https://github.com/ros-planning/moveit2_tutorials -b main --depth 1
连不上,加代理
git clone https://gitclone.com/github.com/ros-planning/moveit2_tutorials -b main --depth 1
#下载教程源码的其他相关文件,这里还下载了moveit2源码,所以这里还编译了一遍
vcs import < moveit2_tutorials/moveit2_tutorials.repos
#给上面下载的包安装依赖文件,用的小鱼的rosdepc
cd ~/ws_moveit2
rosdepc install --from-path src --ignore-src -r -y
#把setuptools回退到58.2.0版本 ,不然会出警告
pip install setuptools==58.2.0
#编译
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
#source一下
source install/setup.bash
#编译完了。一共63个包,没变的话
#启动一个例程
ros2 launch moveit2_tutorials demo.launch.py rviz_tutorial:=true
中间git clone失败
gedit moveit2_tutorials/moveit2_tutorials.repos
#修改链接地址
#也可以自己一个包一个包想办法下下来
#比如
git clone https://github.com/ros-planning/moveit2 -b main
#连不上就
git clone https://gitclone.com/github.com/ros-planning/moveit2 -b main
#再连不上就
git clone https://ghproxy.com/https://github.com/ros-planning/moveit2 -b main
#总之换代理
#在连不上,先git一个错误的,比如
git clone https://github.com/asfhdkshdhz
#asfhdkshdhz是随便打的,这样会报错,然后git正确的,应该可以连上
git clone https://github.com/ros-planning/moveit2 -b main