Skip to content

Commit

Permalink
Merge pull request #4585 from ConnorTingley/Floating-Body-Inverse-Dyn…
Browse files Browse the repository at this point in the history
…amics

Fix calculateInverseDynamics losing one joint DOF for floating bodies
  • Loading branch information
erwincoumans committed Apr 9, 2024
2 parents 5e89410 + 2c79184 commit 43d336f
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 43d336f

Please sign in to comment.