Skip to content

Commit 20796d6

Browse files
committed
resolved crash due to contact is None
1 parent 5abd21a commit 20796d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

urdfenvs/urdf_common/urdf_env.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ def step(self, action: np.ndarray):
217217

218218
pybullet.stepSimulation(self._cid)
219219
for robot_id, robot in enumerate(self._robots):
220-
contacts = pybullet.getContactPoints(robot._robot)
220+
contacts = pybullet.getContactPoints(
221+
bodyA=robot._robot,
222+
physicsClientId=self._cid
223+
) or []
221224
for contact_info in contacts:
222225
body_b = contact_info[2]
223226
if body_b in self._obsts:

0 commit comments

Comments
 (0)