Merge remote-tracking branch 'bp/master'

This commit is contained in:
Erwin Coumans
2016-06-21 11:28:54 -07:00
2 changed files with 10 additions and 23 deletions

View File

@@ -5,10 +5,14 @@ os:
compiler: compiler:
- gcc - gcc
- clang - clang
addons:
apt:
packages:
- python3
script: script:
- echo "CXX="$CXX - echo "CXX="$CXX
- echo "CC="$CC - echo "CC="$CC
- cmake . -G "Unix Makefiles" #-DCMAKE_CXX_FLAGS=-Werror - cmake . -DBUILD_PYBULLET=ON -G"Unix Makefiles" #-DCMAKE_CXX_FLAGS=-Werror
- make -j8 - make -j8
- ctest -j8 --output-on-failure - ctest -j8 --output-on-failure
# Build again with double precision # Build again with double precision

View File

@@ -276,7 +276,7 @@ pybullet_resetSimulation(PyObject* self, PyObject* args)
return Py_None; 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 //todo(erwincoumans): set max forces, kp, kd
@@ -302,6 +302,7 @@ static int pybullet_setJointControl(PyObject* self, PyObject* args)
len = PySequence_Size(targetValues); len = PySequence_Size(targetValues);
numJoints = b3GetNumJoints(sm,bodyIndex); numJoints = b3GetNumJoints(sm,bodyIndex);
b3SharedMemoryCommandHandle commandHandle; b3SharedMemoryCommandHandle commandHandle;
int qIndex;
if (len!=numJoints) if (len!=numJoints)
{ {
@@ -321,7 +322,7 @@ static int pybullet_setJointControl(PyObject* self, PyObject* args)
commandHandle = b3JointControlCommandInit(sm, bodyIndex,controlMode); commandHandle = b3JointControlCommandInit(sm, bodyIndex,controlMode);
for (int qIndex=0;qIndex<numJoints;qIndex++) for (qIndex=0;qIndex<numJoints;qIndex++)
{ {
float value = pybullet_internalGetFloatFromSequence(seq,qIndex); float value = pybullet_internalGetFloatFromSequence(seq,qIndex);
@@ -360,24 +361,6 @@ static int pybullet_setJointControl(PyObject* self, PyObject* args)
return NULL; return NULL;
} }
/*
///Set joint control variables such as desired position/angle, desired velocity,
///applied joint forces, dependent on the control mode (CONTROL_MODE_VELOCITY or CONTROL_MODE_TORQUE)
b3SharedMemoryCommandHandle b3JointControlCommandInit(b3PhysicsClientHandle physClient, int controlMode);
///Only use when controlMode is CONTROL_MODE_POSITION_VELOCITY_PD
int b3JointControlSetDesiredPosition(b3SharedMemoryCommandHandle commandHandle, int qIndex, double value);
int b3JointControlSetKp(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
int b3JointControlSetKd(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
//Only use when controlMode is CONTROL_MODE_VELOCITY
int b3JointControlSetDesiredVelocity(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
// find a better name for dof/q/u indices, point to b3JointInfo
int b3JointControlSetMaximumForce(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
///Only use if when controlMode is CONTROL_MODE_TORQUE,
int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
*/
// Set the gravity of the world with (x, y, z) arguments // Set the gravity of the world with (x, y, z) arguments
static PyObject * static PyObject *
@@ -707,7 +690,7 @@ pybullet_getJointPositions(PyObject* self, PyObject* args)
int i; int i;
int numJoints = b3GetNumJoints(sm,bodyIndex); int numJoints = b3GetNumJoints(sm,bodyIndex);
double jointPositions[numJoints]; double* jointPositions = malloc(numJoints*sizeof(double));
pyListJointPos = PyTuple_New(numJoints); pyListJointPos = PyTuple_New(numJoints);
@@ -718,7 +701,7 @@ pybullet_getJointPositions(PyObject* self, PyObject* args)
item = PyFloat_FromDouble(jointPositions[i]); item = PyFloat_FromDouble(jointPositions[i]);
PyTuple_SetItem(pyListJointPos, i, item); PyTuple_SetItem(pyListJointPos, i, item);
} }
free(jointPositions);
return pyListJointPos; return pyListJointPos;
} }