Skip to content

Commit

Permalink
Fix bug where not passing physicsClientId as keyword arg to bullet
Browse files Browse the repository at this point in the history
causes unexpected behaviour.
  • Loading branch information
adamheins committed Aug 4, 2023
1 parent e9e466e commit 381d2f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 20 additions & 4 deletions pyb_utils/named_tuples.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,23 @@

def getDynamicsInfo(bodyUniqueId, linkIndex, physicsClientId=0):
return DynamicsInfo(
*pyb.getDynamicsInfo(bodyUniqueId, linkIndex, physicsClientId)
*pyb.getDynamicsInfo(
bodyUniqueId=bodyUniqueId,
linkIndex=linkIndex,
physicsClientId=physicsClientId,
)
)


def getContactPoints(
bodyA=-1, bodyB=-1, linkIndexA=-2, linkIndexB=-2, physicsClientId=0
):
points_raw = pyb.getContactPoints(
bodyA, bodyB, linkIndexA, linkIndexB, physicsClientId
bodyA=bodyA,
bodyB=bodyB,
linkIndexA=linkIndexA,
linkIndexB=linkIndexB,
physicsClientId=physicsClientId,
)
return [ContactPoint(*point) for point in points_raw]

Expand All @@ -88,12 +96,20 @@ def getClosestPoints(
bodyA, bodyB, distance, linkIndexA=-2, linkIndexB=-2, physicsClientId=0
):
points_raw = pyb.getClosestPoints(
bodyA, bodyB, distance, linkIndexA, linkIndexB, physicsClientId
bodyA=bodyA,
bodyB=bodyB,
distance=distance,
linkIndexA=linkIndexA,
linkIndexB=linkIndexB,
physicsClientId=physicsClientId,
)
return [ContactPoint(*point) for point in points_raw]


def getConstraintInfo(constraintUniqueId, physicsClientId=0):
return ConstraintInfo(
*pyb.getConstraintInfo(constraintUniqueId, physicsClientId)
*pyb.getConstraintInfo(
constraintUniqueId=constraintUniqueId,
physicsClientId=physicsClientId,
)
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ line-length = 80

[tool.poetry]
name = "pyb_utils"
version = "0.3.0"
version = "0.3.1"
description = "Basic utilities for PyBullet, including collision detection, ghost (i.e. visual-only) objects, and cameras."
authors = ["Adam Heins <mail@adamheins.com>"]
license = "MIT"
Expand Down

0 comments on commit 381d2f3

Please sign in to comment.