mveres01 / multi-contact-grasping

This project implements a simulated grasp-and-lift process in V-REP using the Barrett Hand, with an interface through a python remote API.
BSD 2-Clause "Simplified" License
54 stars 21 forks source link

Problems about Running the Scripts #5

Closed vanusy closed 6 years ago

vanusy commented 6 years ago

My system is ubuntu 16.04 and V-REP version is 3.5 EDU. First, I open "grasp_scene.ttt". But when I run the simulation, I see the barretthand disappeared. Then I run the script "collect_grasps.py", but it comes out that an error occurs. Here is the traceback: Traceback (most recent call last):

File "", line 1, in runfile('/media/xiaoqing/Project/Git Grasp/multi-contact-grasping/src/collect_grasps.py', wdir='/media/xiaoqing/Project/Git Grasp/multi-contact-grasping/src')

File "/home/xiaoqing/anaconda2/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile execfile(filename, namespace)

File "/home/xiaoqing/anaconda2/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile builtins.execfile(filename, *where)

File "/media/xiaoqing/Project/Git Grasp/multi-contact-grasping/src/collect_grasps.py", line 274, in collect_grasps(mesh_path, sim)

File "/media/xiaoqing/Project/Git Grasp/multi-contact-grasping/src/collect_grasps.py", line 165, in collect_grasps gripper_offset=candidate_offset)

File "/media/xiaoqing/Project/Git Grasp/multi-contact-grasping/src/collect_grasps.py", line 107, in generate_candidates h=(p - triangles)**2

ValueError: operands could not be broadcast together with shapes (95,3) (12,3)

Could you help me about this problem? Many thanks.

mveres01 commented 6 years ago

It looks like this came from a newer version of Trimesh; The command for installing the library should have been: pip install trimesh==2.20.21

I've just pushed to the dev branch for the newest Trimesh (pip install trimesh==2.29.10) . Can you do a git checkout dev and see if that works?

Incidentally, this also helped track down a bug with generating candidates.

vanusy commented 6 years ago

Thanks a lot. I update Trimesh version to 2.29.10. However the same problems exit. When I run the simulation, I see the barretthand disappeared. I run the script "collect_grasps.py", error still comes out. Does that related to the V_REP version? since I use the newest V-REP 3.5 EDU.

mveres01 commented 6 years ago

The hand disappearing is normal - it'll come back once it tries grasping. I think 3.5 should be OK, but we'll find out once the script gets running.

The changes aren't on the main branch yet - can you try pulling from dev? You can either clone /download the branch directly https://github.com/mveres01/multi-contact-grasping/tree/dev or do a git checkout from the command line:

cd multi-contact-grasping
git checkout dev

You should see the following change:

(old) points = trimesh.sample.sample_surface_even(mesh, num_samples) (new) points, face_idx = trimesh.sample.sample_surface_even(mesh, num_samples)

vanusy commented 6 years ago

Many thanks! According to your suggestion, I try it and find it works out. Here is what I do to solve this problem: Open the shell commend, and input: git clone https://github.com/mveres01/multi-contact-grasping cd multi-contact-grasping git checkout dev

Then I run the script src/collect_grasps.py. it works out correctly.

Thanks a lot. I will do grasp research based on it and make some progression in the future.

mveres01 commented 6 years ago

Great :) Glad it worked out.