开源项目:https://gitee.com/chaomingsanhua/manipulator_grasp
复现使用的配置:linux系统ubuntu20.04
项目配置记录:
git clone 对应的code后:
需要在graspnet-baseline文件夹中继续拉取文件,指令记录:
cd manipulator_grasp
下面需要继续配置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 mujoco
pip 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'
修复步骤
python
# 原代码(旧版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博客