From 8f21e2bca967f8e1b5bb31c0419370fdfaf26830 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 17 Aug 2016 20:01:45 -0700 Subject: [PATCH] fix compile issue --- examples/pybullet/pybullet.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index dfe4f292d..becc7436e 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -532,7 +532,7 @@ pybullet_setTimeStep(PyObject* self, PyObject* args) // Internal function used to get the base position and orientation // Orientation is returned in quaternions -static void pybullet_internalGetBasePositionAndOrientation(int bodyIndex, double basePosition[3],double baseOrientation[3]) +static int pybullet_internalGetBasePositionAndOrientation(int bodyIndex, double basePosition[3],double baseOrientation[3]) { basePosition[0] = 0.; basePosition[1] = 0.; @@ -555,7 +555,7 @@ static void pybullet_internalGetBasePositionAndOrientation(int bodyIndex, double if (status_type != CMD_ACTUAL_STATE_UPDATE_COMPLETED) { PyErr_SetString(SpamError, "getBasePositionAndOrientation failed."); - return NULL; + return 0; } const double* actualStateQ; // const double* jointReactionForces[]; @@ -583,6 +583,7 @@ static void pybullet_internalGetBasePositionAndOrientation(int bodyIndex, double } } + return 1; } // Get the positions (x,y,z) and orientation (x,y,z,w) in quaternion @@ -610,7 +611,11 @@ pybullet_getBasePositionAndOrientation(PyObject* self, PyObject* args) return NULL; } - pybullet_internalGetBasePositionAndOrientation(bodyIndex,basePosition,baseOrientation); + if (0==pybullet_internalGetBasePositionAndOrientation(bodyIndex, basePosition, baseOrientation)) + { + PyErr_SetString(SpamError, "GetBasePositionAndOrientation failed (#joints/links exceeds maximum?)."); + return NULL; + } {