Expose Jacobian computation to RobotSimAPI.

This commit is contained in:
yunfeibai
2016-09-07 17:37:38 -07:00
parent c198029cb9
commit f635c64205
7 changed files with 28 additions and 15 deletions

View File

@@ -1279,21 +1279,13 @@ b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3PhysicsClientHandle
return (b3SharedMemoryCommandHandle)command;
}
int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, int* bodyIndex, int* linkIndex, double* linearJacobian, double* angularJacobian)
int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, double* linearJacobian, double* angularJacobian)
{
const SharedMemoryStatus* status = (const SharedMemoryStatus*)statusHandle;
btAssert(status->m_type == CMD_CALCULATED_JACOBIAN_COMPLETED);
if (status->m_type != CMD_CALCULATED_JACOBIAN_COMPLETED)
return false;
if (bodyIndex)
{
*bodyIndex = status->m_jacobianResultArgs.m_bodyUniqueId;
}
if (linkIndex)
{
*linkIndex = status->m_jacobianResultArgs.m_linkIndex;
}
if (linearJacobian)
{
for (int i = 0; i < status->m_jacobianResultArgs.m_dofCount*3; i++)