Skip to content

Commit

Permalink
Remove unnecessary VelRepr switch in forward_dynamics_aba
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Jan 21, 2025
1 parent 21f8ee3 commit d840ace
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/jaxsim/api/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,22 +973,17 @@ def forward_dynamics_aba(
velocity_representation=data.velocity_representation,
)

# Extract the link and joint serializations.
link_names = model.link_names()
joint_names = model.joint_names()

# Extract the state in inertial-fixed representation.
with data.switch_velocity_representation(VelRepr.Inertial):
W_p_B = data.base_position()
W_v_WB = data.base_velocity()
W_Q_B = data.base_orientation(dcm=False)
s = data.joint_positions(model=model, joint_names=joint_names)
= data.joint_velocities(model=model, joint_names=joint_names)
s = data.joint_positions(model=model)
= data.joint_velocities(model=model)

# Extract the inputs in inertial-fixed representation.
with references.switch_velocity_representation(VelRepr.Inertial):
W_f_L = references.link_forces(model=model, data=data, link_names=link_names)
τ = references.joint_force_references(model=model, joint_names=joint_names)
W_f_L = references._link_forces
τ = references._joint_force_references

# ========================
# Compute forward dynamics
Expand Down

0 comments on commit d840ace

Please sign in to comment.