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

collision detection: btConeShape behaves like cylinder shape. #1375

Closed
eastskykang opened this issue Oct 9, 2017 · 8 comments
Closed

collision detection: btConeShape behaves like cylinder shape. #1375

eastskykang opened this issue Oct 9, 2017 · 8 comments

Comments

@eastskykang
Copy link
Contributor

I am using bullet collision for collision detection.

As I define cone object as follows:

btCollisionShape* coneCollisionShape = new btConeShapeZ(radius, height);
btCollisionObject* coneCollisionObject = new btCollisionObject();
coneCollisionObject->setCollisionShape(coneCollisionShape);

object occupies cylindrical space, not cone shape. Am I missing something here?

@erwincoumans
Copy link
Member

The RollingFrictionDemo uses cone shapes and they work fine.
https://github.com/bulletphysics/bullet3/blob/master/examples/RollingFrictionDemo/RollingFrictionDemo.cpp
Can you create a btRigidBody instead of btCollisionObject?

@erwincoumans
Copy link
Member

How do you determine what space is occupied?

@eastskykang
Copy link
Contributor Author

eastskykang commented Oct 9, 2017

Thank you so much for your response.

As I put an unit sphere to certain position (which is not supposed to be occupied), collision was detected. (and for sphere, cylinder or box, it never happened.) I also tried to use btConeShape or btConeShapeY but it seems they also fully occupy the cylindrical space.

By the way, I only want to use collision detection feature, since I have my own dynamics engine. Is using btRigidBody proper way to do it?

@erwincoumans
Copy link
Member

erwincoumans commented Oct 9, 2017

Why using your own dynamics engine, since it obviously works well with btRigidBody, LOL?

Now seriously, it should work just fine using btCollisionObject as well. How do you perform the query? You should be able to create a minimal self-contained program to perform the check, in less than 100 lines (only using Bullet libraries). If so, please share the test program that compiles with a recent compiler on either Linux, Mac OSX or Linux.

Do you set the world transforms for the query properly? What is the contact point information (closest distance, contact normal etc)? Note that a positive distance means no collision.

In addition, you may also experiment a bit with pybullet, there is a lot of interesting stuff in there to experiment with, including collision detection between shapes. Ah, I just realize that cones are not exposed in that API, I can add it easily and it lets you do some tests/comparisons/queries.

@eastskykang
Copy link
Contributor Author

@erwincoumans Thank you for comment. I am actually building a dynamics simulator for robotics (for some special purposes). That's why I am using bullet for just for collision detection.

And I realized I was detecting collision by using collision between manifolds. As I changed my implementation it seems works fine.

Anyway, thank you so much for your quick and kind response. I will close the issue.

@erwincoumans
Copy link
Member

Robotics is the main focus of Bullet nowadays, please check http://pybullet.org There is URDF and SDF loading, Inverse Dynamics, Inverse Kinematics, motor control etc. We simulate KUKA arm grasping, quadruped/biped robot locomotion etc.

@erwincoumans
Copy link
Member

See some new paper using pybullet:https://stanfordvl.github.io/ntp/?utm_content=buffer8b1fc
Also our researchers at Google Brain and X use this simulator in both C++ and Python.

@eastskykang
Copy link
Contributor Author

@erwincoumans Great! thank you so much for your suggestion. I will take a look and consider use bullet dynamics engines.

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

2 participants