Skip to content

Commit

Permalink
Fix ABA for viscous friction
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Nov 8, 2023
1 parent c0b5d44 commit a32b505
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/jaxsim/physics/algos/aba.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def aba(
def loop_body_pass1(carry: Pass1Carry, i: jtp.Int) -> Tuple[Pass1Carry, None]:
ii = i - 1
i_X_λi, v, c, m_v, m_c, MA, pA, pR, i_X_0 = carry
has_motors = (Γ[i] != 1).any()

# Compute parent-to-child transform
i_X_λi_i = i_X_pre[i] @ pre_X_λi[i]
Expand Down Expand Up @@ -136,7 +137,7 @@ def loop_body_pass1(carry: Pass1Carry, i: jtp.Int) -> Tuple[Pass1Carry, None]:
pA_i = Cross.vx_star(v[i]) @ M[i] @ v[i] - i_Xf_W @ jnp.vstack(f_ext[i])
pA = pA.at[i].set(pA_i)

pR_i = Cross.vx_star(m_v[i]) @ IM[i] @ m_v[i] + K̅ᵥ[i] * m_v[i]
pR_i = Cross.vx_star(m_v[i]) @ IM[i] @ m_v[i] + K̅ᵥ[i] * m_v[i] * has_motors
pR = pR.at[i].set(pR_i)

return (i_X_λi, v, c, m_v, m_c, MA, pA, pR, i_X_0), None
Expand Down

0 comments on commit a32b505

Please sign in to comment.