Inaccurate RayTest in Pybullet

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
adamsyammaszaki
Posts: 2
Joined: Sun Oct 20, 2019 2:17 pm

Inaccurate RayTest in Pybullet

Post by adamsyammaszaki » Tue Dec 10, 2019 11:10 am

Hello, I am new to pybullet. So, I am planning to perform several raytest on an object. For the sake of clarity, I would like you to see the image below.

Image
(if you cannot see the image, pls click the link as follow, https://imgur.com/k3qRtj0)

The purple lines are the visualization of the rays, I would like to know which ray hits the object. And the ray that hits the object is visualized as a white line. As you can see, the ray with white line is the ray that does not intersect with the object. Is there any accuracy problem with raytest in pybullet? Or does it have something to do with my laptop that does not have gpu?
Thank you for your help.

adamsyammaszaki
Posts: 2
Joined: Sun Oct 20, 2019 2:17 pm

Re: Inaccurate RayTest in Pybullet

Post by adamsyammaszaki » Thu Dec 12, 2019 7:05 am

Is it because the collision shape is convex hull? If that's the case then, it explains why I got such results.

User avatar
Erwin Coumans
Site Admin
Posts: 4198
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Inaccurate RayTest in Pybullet

Post by Erwin Coumans » Fri Dec 20, 2019 12:08 am

Yes, by default we use convex hulls. Best to create a convex decomposition for moving objects (using VHACD, there are utils from obj -> vhacd).
See this example:
https://github.com/bulletphysics/bullet ... vhacd.urdf


For concave static trangle meshes, you can mark them as 'concave'.
See samurai.urdf for an example https://github.com/bulletphysics/bullet ... ai.urdf#L3

Post Reply