expose the local inertial frame for each link in the shared memory API
struct b3LinkState
{
double m_worldPosition[3];//this is the inertial frame
double m_worldOrientation[4];
double m_localInertialPosition[3];//this is the local frame from inertial to link frame
double m_localInertialOrientation[4];
};
const btTransform link_frame_world =
inertial_frame_world * m_local_inertial_frame->inverse();
This commit is contained in:
@@ -233,10 +233,12 @@ void b3GetLinkState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
state->m_worldPosition[i] = status->m_sendActualStateArgs.m_linkState[7 * linkIndex + i];
|
||||
state->m_localInertialPosition[i] = status->m_sendActualStateArgs.m_linkLocalInertialFrames[7 * linkIndex + i];
|
||||
}
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
state->m_worldOrientation[i] = status->m_sendActualStateArgs.m_linkState[7 * linkIndex + 3 + i];
|
||||
state->m_localInertialOrientation[i] = status->m_sendActualStateArgs.m_linkLocalInertialFrames[7 * linkIndex + 3 + i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user