From b58978184c8a0394641977035c5c23fe73322606 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Mon, 20 Jun 2016 14:58:56 -0700 Subject: [PATCH 1/6] fix C99 issue, use malloc, not variable sized array. . --- examples/pybullet/pybullet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index fbd070ff9..eb1e88f6d 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -707,7 +707,7 @@ pybullet_getJointPositions(PyObject* self, PyObject* args) int i; int numJoints = b3GetNumJoints(sm,bodyIndex); - double jointPositions[numJoints]; + double* jointPositions = malloc(numJoints*sizeof(double)); pyListJointPos = PyTuple_New(numJoints); @@ -718,7 +718,7 @@ pybullet_getJointPositions(PyObject* self, PyObject* args) item = PyFloat_FromDouble(jointPositions[i]); PyTuple_SetItem(pyListJointPos, i, item); } - + free(jointPositions); return pyListJointPos; } From 01cad7c2a5e5a3a14e78bede0e8108b50cd6c99b Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Mon, 20 Jun 2016 15:00:35 -0700 Subject: [PATCH 2/6] fix return type in pybullet . --- examples/pybullet/pybullet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index eb1e88f6d..3731f4c4d 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -276,7 +276,7 @@ pybullet_resetSimulation(PyObject* self, PyObject* args) return Py_None; } -static int pybullet_setJointControl(PyObject* self, PyObject* args) +static PyObject* pybullet_setJointControl(PyObject* self, PyObject* args) { //todo(erwincoumans): set max forces, kp, kd From 51da3863452f6bfe967ab9a24afe3104f2e8fffe Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Mon, 20 Jun 2016 15:05:14 -0700 Subject: [PATCH 3/6] also compile pybullet in one of the tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bb6dcde2e..8d309af7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ compiler: script: - echo "CXX="$CXX - echo "CC="$CC - - cmake . -G "Unix Makefiles" #-DCMAKE_CXX_FLAGS=-Werror + - cmake . -G -DBUILD_PYBULLET=ON "Unix Makefiles" #-DCMAKE_CXX_FLAGS=-Werror - make -j8 - ctest -j8 --output-on-failure # Build again with double precision From 07ee9673efe9886d87c6b39131af355d39795de1 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Tue, 21 Jun 2016 08:43:04 -0700 Subject: [PATCH 4/6] try to get python dependency in travis (pybullet) --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8d309af7d..df480e393 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,9 @@ os: compiler: - gcc - clang +python: + - "2.7" + - "3.4" script: - echo "CXX="$CXX - echo "CC="$CC From 08b88c445a2c03dcd1db5e7f547488cfafa93d07 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Tue, 21 Jun 2016 08:51:43 -0700 Subject: [PATCH 5/6] more travis/python testing fun --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index df480e393..25053a90d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,13 +5,14 @@ os: compiler: - gcc - clang -python: - - "2.7" - - "3.4" +addons: + apt: + packages: + - python3 script: - echo "CXX="$CXX - echo "CC="$CC - - cmake . -G -DBUILD_PYBULLET=ON "Unix Makefiles" #-DCMAKE_CXX_FLAGS=-Werror + - cmake . -DBUILD_PYBULLET=ON -G"Unix Makefiles" #-DCMAKE_CXX_FLAGS=-Werror - make -j8 - ctest -j8 --output-on-failure # Build again with double precision From 0b249361c243e27430838ee188dd08d9ff0e4cf4 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Tue, 21 Jun 2016 09:01:27 -0700 Subject: [PATCH 6/6] fix a c99 issue in pybullet --- examples/pybullet/pybullet.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 3731f4c4d..9235f3e5a 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -302,6 +302,7 @@ static PyObject* pybullet_setJointControl(PyObject* self, PyObject* args) len = PySequence_Size(targetValues); numJoints = b3GetNumJoints(sm,bodyIndex); b3SharedMemoryCommandHandle commandHandle; + int qIndex; if (len!=numJoints) { @@ -321,7 +322,7 @@ static PyObject* pybullet_setJointControl(PyObject* self, PyObject* args) commandHandle = b3JointControlCommandInit(sm, bodyIndex,controlMode); - for (int qIndex=0;qIndex