eleramp / pybullet-object-models

Collection of object models compatible with pybullet simulator https://github.com/bulletphysics/bullet3/tree/master/examples/pybullet
GNU Lesser General Public License v2.1
91 stars 26 forks source link

TypeError: generate_surface_mesh() got an unexpected keyword argument 'angle_bound' #5

Open Pengfeicc opened 2 years ago

Pengfeicc commented 2 years ago

When I was running generate_superquadric_mesh.py, and got a error:

(syntheticGen) chu@U2G:~/pybullet-object-models/pybullet_object_models/superquadric_objects$ python generate_superquadric_mesh.py Traceback (most recent call last): File "generate_superquadric_mesh.py", line 36, in distance_bound=0.005 TypeError: generate_surface_mesh() got an unexpected keyword argument 'angle_bound'

my conda python enviroment is py37 and i have installed all pip packages. The test_load_object_pybullet.py could run sucessfully

bibbygoodwin commented 1 year ago

I think this is down to the version of pygalmesh that you are using. I had to go to <0.8 in order to get to a version where pygalmesh.generate_surface_mesh takes angle_bound as an argument. I don't think this repo has been updated, so isn't compatible with the newer versions.

I'm still unable to get generate_superquadric_mesh.py to run, though, because of a trimesh issue on L43.

Also, having run generate_urdf_model.py using the .obj included in the repo, I find that test_load_object_pybullet.py doesn't work properly for me - I get a PyBullet error relating to being unable to load the mesh from the .obj file:

b3Printf: /Users/me/Code/pybullet-object-models/pybullet_object_models/superquadric_objects/sq_0.1_0.02_0.1_0.9_0.9/: cannot extract anything useful from mesh '/Users/me/Code/pybullet-object-models/pybullet_object_models/superquadric_objects/sq_0.12_0.12_0.12_0.9_0.9/model.obj'

b3Printf: b3Warning[examples/SharedMemory/plugins/tinyRendererPlugin/TinyRendererVisualShapeConverter.cpp,558]:

b3Printf: issue extracting mesh from COLLADA/STL file /Users/me/Code/pybullet-object-models/pybullet_object_models/superquadric_objects/sq_0.12_0.12_0.12_0.9_0.9/model.obj
bibbygoodwin commented 1 year ago

^ For anyone else facing the above error, I hadn't realised that the .obj files currently in the repo are just placeholders/git SHA references.

In the end, the fix for generating .obj with generate_superquadric_mesh.py was to change https://github.com/eleramp/pybullet-object-models/blob/57cc4007607f6bcbb0a5364ccab7636faf7a91e4/pybullet_object_models/superquadric_objects/generate_superquadric_mesh.py#L39 to save into the file format "obj" rather than "stl". This removed the trimesh error I was previously getting. The resulting .obj files (both before and after trimesh filtering) are opened successfully by Pybullet in the context of their URDFs.

Pengfeicc commented 1 year ago

Sorry bro I did not use pybullet and cannot help you, I changed to use blenderproc with my project

从 Windows 版邮件https://go.microsoft.com/fwlink/?LinkId=550986发送

发件人: Walter @.> 发送时间: 2022年9月19日 20:26 收件人: @.> 抄送: Pengfei @.>; @.> 主题: Re: [eleramp/pybullet-object-models] TypeError: generate_surface_mesh() got an unexpected keyword argument 'angle_bound' (Issue #5)

@pengfeichu1992https://github.com/pengfeichu1992, did you not get this error with loading the .obj files into Pybullet?

― Reply to this email directly, view it on GitHubhttps://github.com/eleramp/pybullet-object-models/issues/5#issuecomment-1251388217, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AU6BWOXUTGLQWLPFP76UFRDV7CV6PANCNFSM5XLZEX6A. You are receiving this because you were mentioned.Message ID: @.***>

wukongwong commented 1 year ago

I think this is down to the version of pygalmesh that you are using. I had to go to <0.8 in order to get to a version where pygalmesh.generate_surface_mesh takes angle_bound as an argument. I don't think this repo has been updated, so isn't compatible with the newer versions.

I'm still unable to get generate_superquadric_mesh.py to run, though, because of a trimesh issue on L43.

Also, having run generate_urdf_model.py using the .obj included in the repo, I find that test_load_object_pybullet.py doesn't work properly for me - I get a PyBullet error relating to being unable to load the mesh from the .obj file:

b3Printf: /Users/me/Code/pybullet-object-models/pybullet_object_models/superquadric_objects/sq_0.1_0.02_0.1_0.9_0.9/: cannot extract anything useful from mesh '/Users/me/Code/pybullet-object-models/pybullet_object_models/superquadric_objects/sq_0.12_0.12_0.12_0.9_0.9/model.obj'

b3Printf: b3Warning[examples/SharedMemory/plugins/tinyRendererPlugin/TinyRendererVisualShapeConverter.cpp,558]:

b3Printf: issue extracting mesh from COLLADA/STL file /Users/me/Code/pybullet-object-models/pybullet_object_models/superquadric_objects/sq_0.12_0.12_0.12_0.9_0.9/model.obj

how to install pygalmesh of version lower than 0.8?

bibbygoodwin commented 1 year ago

I think just pip install "pygalmesh<0.8" IIRC