Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The collision shape problem of concave object #25

Open
TFLQW opened this issue Dec 9, 2019 · 4 comments
Open

The collision shape problem of concave object #25

TFLQW opened this issue Dec 9, 2019 · 4 comments

Comments

@TFLQW
Copy link
Contributor

TFLQW commented Dec 9, 2019

I have got the urdf model of a hole from solidworks, and also a mesh file of the hole. But when i try to assemble the peg into the hole. I found the collision shape of the hole is cylinder which is solid not contain the hole of the cylinder.
Could you tell me how to confige this stl model or use which of software to config this property

this is that model stl
hole_f.STL.tar.gz

@bdelhaisse
Copy link
Collaborator

bdelhaisse commented Dec 10, 2019

Hi,

This is a problem with the underlying simulator pybullet. When you load a mesh through the World or Simulator class, you have a flag that you can set. Here is the documentation:

if flag = `sim.GEOM_FORCE_CONCAVE_TRIMESH` (=1), this will create a concave static triangle mesh. This should not be used with dynamic/moving objects, only for static (mass=0) terrain.

If you set the flag to 1, it should solve your problem but you will not be able to rotate it in the simulator (check in the simulator using your mouse by dragging the object when setting the flag to 0 or 1, you will have a different behavior). If you want it to be dynamic however you will have to create a URDF file. I wanted to implement it in the code but I didn't have the time to do it yet. But it should not be too difficult to implement it using the functions that are in the utils folder, specifically:

For creating the URDF, there are two ways:

  1. do it manually.
  2. use the data structures given in https://github.com/robotlearn/pyrobolearn/blob/master/pyrobolearn/utils/parsers/robots/data_structures.py, and use the URDFParser class (in https://github.com/robotlearn/pyrobolearn/blob/master/pyrobolearn/utils/parsers/robots/urdf_parser.py) to generate a URDF file from the Tree data structure.

FYI, I was also interested to implement the peg-in-hole problem but at the moment, I don't have so much time. Let me know how it goes.

Best,
Brian

@TFLQW
Copy link
Contributor Author

TFLQW commented Dec 10, 2019

@bdelhaisse
Thanks for your answer, I try to use blender with a plugin could construc the model collision model (.obj), but it cannot perform the shape of the hole precisely. I also ask the same question on bullet3 package https://github.com/bulletphysics/bullet3/issues/2531, but i couldn't found those parameters in your load_urdf() function, just in load_mesh() that sim.GEOM_FORCE_CONCAVE_TRIMESH is ok.

@TFLQW
Copy link
Contributor Author

TFLQW commented Dec 10, 2019

@bdelhaisse
And I have another question on the coliision problem.
When the robot (i used UR5) collide with the hole or something else. I will be in chaos, it is out of control. Is that maybe something wrong with the arm joint damping parameters is too small. Sould I change some parameters of the joint or something else?

@jackson-liugang
Copy link

@bdelhaisse Thanks for your answer, I try to use blender with a plugin could construc the model collision model (.obj), but it cannot perform the shape of the hole precisely. I also ask the same question on bullet3 package https://github.com/bulletphysics/bullet3/issues/2531, but i couldn't found those parameters in your load_urdf() function, just in load_mesh() that sim.GEOM_FORCE_CONCAVE_TRIMESH is ok.
I have the same question,can you solve the question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants