Skip to content

Commit

Permalink
devel/py-bullet3: Update 3.09 -> 3.17
Browse files Browse the repository at this point in the history
Also:
* Add missing dependencies
* Add the test target based on the example from the documentation

Reported by:	portscout
  • Loading branch information
yurivict committed May 16, 2021
1 parent 52f0766 commit 8f7ccf0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
10 changes: 8 additions & 2 deletions devel/py-bullet3/Makefile
@@ -1,5 +1,5 @@
PORTNAME= bullet3
DISTVERSION= 3.09
DISTVERSION= 3.17
CATEGORIES= devel
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

Expand All @@ -9,8 +9,11 @@ COMMENT= Python version of 3D collision detection library Bullet
LICENSE= ZLIB
LICENSE_FILE= ${WRKSRC}/LICENSE.txt

RUN_DEPENDS= ${PYNUMPY} \
${PYTHON_PKGNAMEPREFIX}gym>0:math/py-gym@${PY_FLAVOR}

USES= compiler:c++11-lang gl localbase python:3.6+
USE_PYTHON= autoplist distutils
USE_PYTHON= distutils autoplist
USE_GL= gl glew

USE_GITHUB= yes
Expand All @@ -19,4 +22,7 @@ GH_ACCOUNT= bulletphysics
post-install:
@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/pybullet*.so

do-test: install # test require graphical environment
@${PYTHON_CMD} ${FILESDIR}/test.py

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions devel/py-bullet3/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1614982042
SHA256 (bulletphysics-bullet3-3.09_GH0.tar.gz) = f2feef9322329c0571d9066fede2db0ede92b19f7f7fdf54def3b4651f02af03
SIZE (bulletphysics-bullet3-3.09_GH0.tar.gz) = 129274815
TIMESTAMP = 1621185390
SHA256 (bulletphysics-bullet3-3.17_GH0.tar.gz) = baa642c906576d4d98d041d0acb80d85dd6eff6e3c16a009b1abf1ccd2bc0a61
SIZE (bulletphysics-bullet3-3.17_GH0.tar.gz) = 131995187
17 changes: 17 additions & 0 deletions devel/py-bullet3/files/test.py
@@ -0,0 +1,17 @@
import pybullet as p
import time
import pybullet_data

physicsClient = p.connect(p.GUI)#or p.DIRECT for non-graphical version
p.setAdditionalSearchPath(pybullet_data.getDataPath()) #optionally
p.setGravity(0,0,-10)
planeId = p.loadURDF("plane.urdf")
cubeStartPos = [0,0,1]
cubeStartOrientation = p.getQuaternionFromEuler([0,0,0])
boxId = p.loadURDF("r2d2.urdf",cubeStartPos, cubeStartOrientation)
for i in range (10000):
p.stepSimulation()
time.sleep(1./240.)
cubePos, cubeOrn = p.getBasePositionAndOrientation(boxId)
print(cubePos,cubeOrn)
p.disconnect()

0 comments on commit 8f7ccf0

Please sign in to comment.