From f9719e2405dc0ac8ff9baacb13071fceab68123e Mon Sep 17 00:00:00 2001 From: yunfeibai Date: Tue, 19 Apr 2016 10:44:59 -0700 Subject: [PATCH] Add measured joint motor force to joint sensor state. --- examples/SharedMemory/PhysicsClientC_API.cpp | 1 + examples/SharedMemory/SharedMemoryPublic.h | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 0ffa0d6d1..a11305ccf 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -218,6 +218,7 @@ void b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandl for (int ii(0); ii < 6; ++ii) { state->m_jointForceTorque[ii] = status->m_sendActualStateArgs.m_jointReactionForces[6 * jointIndex + ii]; } + state->m_jointTorque = status->m_sendActualStateArgs.m_jointMotorForce[jointIndex]; } } diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h index 412b26da0..786efed1e 100644 --- a/examples/SharedMemory/SharedMemoryPublic.h +++ b/examples/SharedMemory/SharedMemoryPublic.h @@ -94,6 +94,7 @@ struct b3JointSensorState double m_jointPosition; double m_jointVelocity; double m_jointForceTorque[6]; /* note to roboticists: this is NOT the motor torque/force, but the spatial reaction force vector at joint */ + double m_jointTorque; }; struct b3DebugLines