Rename body index to body unique id.

This commit is contained in:
yunfeibai
2017-04-04 10:38:25 -07:00
parent 1e91e78469
commit b168f53ed9
6 changed files with 35 additions and 35 deletions

View File

@@ -48,7 +48,7 @@ p.setRealTimeSimulation(useRealTimeSimulation)
trailDuration = 15
logId1 = p.startStateLogging(p.STATE_LOGGING_GENERIC_ROBOT,"LOG0001.txt",[0,1,2])
logId2 = p.startStateLogging(p.STATE_LOGGING_CONTACT_POINTS,"LOG0002.txt",bodyIndexA=1)
logId2 = p.startStateLogging(p.STATE_LOGGING_CONTACT_POINTS,"LOG0002.txt",bodyUniqueIdA=2)
for i in xrange(5):
print "Body %d's name is %s." % (i, p.getBodyInfo(i)[1])

View File

@@ -2678,16 +2678,16 @@ static PyObject* pybullet_startStateLogging(PyObject* self, PyObject* args, PyOb
char* fileName = 0;
PyObject* objectUniqueIdsObj = 0;
int maxLogDof = -1;
int bodyIndexA = -1;
int bodyIndexB = -1;
int bodyUniqueIdA = -1;
int bodyUniqueIdB = -1;
int linkIndexA = -2;
int linkIndexB = -2;
static char* kwlist[] = {"loggingType", "fileName", "objectUniqueIds", "maxLogDof", "bodyIndexA", "bodyIndexB", "linkIndexA", "linkIndexB", "physicsClientId", NULL};
static char* kwlist[] = {"loggingType", "fileName", "objectUniqueIds", "maxLogDof", "bodyUniqueIdA", "bodyUniqueIdB", "linkIndexA", "linkIndexB", "physicsClientId", NULL};
int physicsClientId = 0;
if (!PyArg_ParseTupleAndKeywords(args, keywds, "is|Oiiiiii", kwlist,
&loggingType, &fileName, &objectUniqueIdsObj, &maxLogDof, &bodyIndexA, &bodyIndexB, &linkIndexA, &linkIndexB, &physicsClientId))
&loggingType, &fileName, &objectUniqueIdsObj, &maxLogDof, &bodyUniqueIdA, &bodyUniqueIdB, &linkIndexA, &linkIndexB, &physicsClientId))
return NULL;
sm = getPhysicsClient(physicsClientId);
@@ -2723,13 +2723,13 @@ static PyObject* pybullet_startStateLogging(PyObject* self, PyObject* args, PyOb
b3StateLoggingSetMaxLogDof(commandHandle, maxLogDof);
}
if (bodyIndexA > -1)
if (bodyUniqueIdA > -1)
{
b3StateLoggingSetLinkIndexA(commandHandle, bodyIndexA);
b3StateLoggingSetBodyAUniqueId(commandHandle, bodyUniqueIdA);
}
if (bodyIndexB > -1)
if (bodyUniqueIdB > -1)
{
b3StateLoggingSetBodyIndexB(commandHandle, bodyIndexB);
b3StateLoggingSetBodyBUniqueId(commandHandle, bodyUniqueIdB);
}
if (linkIndexA > -2)
{