Page 1 of 1

How to disable collisions?

Posted: Fri Jul 20, 2018 11:04 am
by Senpid Sinclair
I know that collision detection/avoidance is what bullet is all about but I really just want to use it as a visualizer for robot stuff (like rviz but without ros) because it is very easy to setup.

So far for testing I am just loading robots via the URDF loader and they are going crazy when spawned into each other.

Now my question is: How can I either:
a) globally disable collisions or
b) disable collisions per object?

In another thread I found someone recommending setting a flag `CF_NO_CONTACT_RESPONSE` in the C++ code, but I haven't found that one in the pybullet lib and wouldn't know how to apply this. I was hoping that the URDF loader has this somehow as an optional flag, but not from what I saw.

Thanks so much in advance.

Re: How to disable collisions?

Posted: Mon Sep 03, 2018 11:35 am
by ardabbour
You can use visual shapes without collision shapes. For example, your URDF code can be:

Code: Select all

<?xml version="1.0"?>
<robot name="cube">
  <link name="base_link">

    <collision>
      <geometry>
        <box size="0 0 0"/>
      </geometry>
    </collision>

    <inertial>
      <mass value="0"/>
    	<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
  	</inertial>

    <visual>
      <geometry>
        <box size="1 1 1"/>
      </geometry>
    </visual>

  </link>
</robot>

Re: How to disable collisions?

Posted: Thu Sep 13, 2018 3:32 am
by Erwin Coumans
I just implemented a few ways to do it:

Disable collisions per object pair / link:

Code: Select all

enableCollision= 0
pybullet.setCollisionFilterPair(objectUniqueIdA, objectUniqueIdB, linkIndexA, linkIndexB, enableCollision)
or disable collisions per group of objects:

Code: Select all

group = 0#other objects don't collide with me
mask=0 # don't collide with any other object
pybullet. setCollisionFilterGroupMask(objectUniqueId, linkIndex, group, mask)

Re: How to disable collisions?

Posted: Wed Sep 26, 2018 12:16 pm
by Senpid Sinclair
Thank you so much guys I will try it out immediately.
I am so glad this was answered after all.

Re: How to disable collisions?

Posted: Fri Oct 16, 2020 3:19 pm
by abk
Hi Erwin,
If an object is fully masked (like you proposed), will it still have any affect on the physical simulation?
thanks