fix quadruped, allow user to pick the maximum number of dofs to log
This commit is contained in:
@@ -16,8 +16,8 @@ def readLogFile(filename, verbose = True):
|
||||
print('Opened'),
|
||||
print(filename)
|
||||
|
||||
keys = f.readline().rstrip('\n').split(',')
|
||||
fmt = f.readline().rstrip('\n')
|
||||
keys = f.readline().decode('utf8').rstrip('\n').split(',')
|
||||
fmt = f.readline().decode('utf8').rstrip('\n')
|
||||
|
||||
# The byte number of one record
|
||||
sz = struct.calcsize(fmt)
|
||||
@@ -37,7 +37,7 @@ def readLogFile(filename, verbose = True):
|
||||
# Read data
|
||||
wholeFile = f.read()
|
||||
# split by alignment word
|
||||
chunks = wholeFile.split('\xaa\xbb')
|
||||
chunks = wholeFile.split(b'\xaa\xbb')
|
||||
log = list()
|
||||
for chunk in chunks:
|
||||
if len(chunk) == sz:
|
||||
|
||||
@@ -2625,12 +2625,13 @@ static PyObject* pybullet_startStateLogging(PyObject* self, PyObject* args, PyOb
|
||||
int loggingType = -1;
|
||||
char* fileName = 0;
|
||||
PyObject* objectUniqueIdsObj = 0;
|
||||
int maxLogDof=-1;
|
||||
|
||||
static char *kwlist[] = { "loggingType", "fileName", "objectUniqueIds", "physicsClientId", NULL };
|
||||
static char *kwlist[] = { "loggingType", "fileName", "objectUniqueIds", "maxLogDof", "physicsClientId", NULL };
|
||||
int physicsClientId = 0;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "is|Oi", kwlist,
|
||||
&loggingType, &fileName, &objectUniqueIdsObj,&physicsClientId))
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "is|Oii", kwlist,
|
||||
&loggingType, &fileName, &objectUniqueIdsObj,&maxLogDof, &physicsClientId))
|
||||
return NULL;
|
||||
|
||||
sm = getPhysicsClient(physicsClientId);
|
||||
@@ -2661,6 +2662,10 @@ static PyObject* pybullet_startStateLogging(PyObject* self, PyObject* args, PyOb
|
||||
}
|
||||
}
|
||||
|
||||
if (maxLogDof>0)
|
||||
{
|
||||
b3StateLoggingSetMaxLogDof(commandHandle, maxLogDof);
|
||||
}
|
||||
|
||||
statusHandle = b3SubmitClientCommandAndWaitStatus(sm, commandHandle);
|
||||
statusType = b3GetStatusType(statusHandle);
|
||||
|
||||
Reference in New Issue
Block a user