Get body name from getBodyInfo.
This commit is contained in:
@@ -50,7 +50,7 @@ trailDuration = 15
|
||||
logId = p.startStateLogging(p.STATE_LOGGING_GENERIC_ROBOT,"LOG0001.txt",[0,1,2])
|
||||
|
||||
for i in xrange(5):
|
||||
print "Body %d's name is %s." % (i, p.getBodyName(i)[0])
|
||||
print "Body %d's name is %s." % (i, p.getBodyInfo(i)[1])
|
||||
|
||||
while 1:
|
||||
if (useRealTimeSimulation):
|
||||
|
||||
@@ -1711,8 +1711,9 @@ static PyObject* pybullet_getBodyInfo(PyObject* self, PyObject* args, PyObject*
|
||||
struct b3BodyInfo info;
|
||||
if (b3GetBodyInfo(sm, bodyUniqueId, &info))
|
||||
{
|
||||
PyObject* pyListJointInfo = PyTuple_New(1);
|
||||
PyObject* pyListJointInfo = PyTuple_New(2);
|
||||
PyTuple_SetItem(pyListJointInfo, 0, PyString_FromString(info.m_baseName));
|
||||
PyTuple_SetItem(pyListJointInfo, 1, PyString_FromString(info.m_bodyName));
|
||||
return pyListJointInfo;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user