Skip to content

Commit

Permalink
Quaternion to Euler correction
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorTingley committed Feb 27, 2024
1 parent 6bb8d11 commit 2c79184
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/SharedMemory/PhysicsServerCommandProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12360,9 +12360,10 @@ bool PhysicsServerCommandProcessor::processInverseDynamicsCommand(const struct S
q[4] = pos[1];
q[5] = pos[2];
}
int quatToEulerCorrection = baseDofQ ? -1 : 0; // The conversion to Euler angles drops the DOF by one
for (int i = 0; i < num_dofs; i++)
{
q[i + baseDofQ] = clientCmd.m_calculateInverseDynamicsArguments.m_jointPositionsQ[i + baseDofQ];
q[i + baseDofQ + quatToEulerCorrection] = clientCmd.m_calculateInverseDynamicsArguments.m_jointPositionsQ[i + baseDofQ];
}
for (int i = 0; i < num_dofs + baseDofQdot; i++)
{
Expand Down

0 comments on commit 2c79184

Please sign in to comment.