開源項目:https://gitee.com/chaomingsanhua/manipulator_grasp
復現使用的配置:linux系統ubuntu20.04
項目配置記錄:
git clone 對應的code后:
需要在graspnet-baseline文件夾中繼續拉取文件,指令記錄:
cd?manipulator_grasp
git clone?https://github.com/graspnet/graspnet-baseline.git
下面需要繼續配置graspnet-baseline項目的環境:
這里為了這個項目單獨創建了一個conda環境
conda create -n graspnet python=3.9
conda activate graspnet
pip install graspnetAPI
pip uninstall trimesh
pip install trimesh==3.9.0
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install spatialmath-python
pip install mujocopip install modern-robotics
pip install roboticstoolbox-python
pip install numpy==1.23.0
Compile and install pointnet2 operators (code adapted from?votenet).
cd pointnet2
python setup.py install
Compile and install knn operator (code adapted from?pytorch_knn_cuda).
cd knn
python setup.py install
下面需要下載該項目對應的 checkpoint-rs.tar 文件(在graspnet-baseline項目的Readme中):
將其存放在該路徑下:
下面開始運行main.py主程序代碼:
會遇到如下報錯:
Traceback (most recent call last): File "/home/song/hjx/manipulator_grasp/main.py", line 19, in <module> from graspnet_dataset import GraspNetDataset File "/home/song/hjx/manipulator_grasp/graspnet-baseline/dataset/graspnet_dataset.py", line 12, in <module> from torch._six import container_abcs # pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html ModuleNotFoundError: No module named 'torch._six'
修復步驟?
# 原代碼(舊版PyTorch)
from torch._six import container_abcs# 修改為(適配PyTorch 2.x)
import collections.abc as container_abcs
繼續運行main.py主程序代碼,會出現如下界面:
關閉這個圖片的畫面,機械臂開始抓取運動:
mujoco仿真的效果十分nice!!!
參考:
Ubuntu20.04復現GraspNet全記錄(含遇到的問題及解決方法_graspnet數據集下載-CSDN博客
https://github.com/graspnet/graspnet-baseline