Skip to content

Commit

Permalink
[wip]
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Nov 30, 2023
1 parent b9e7b70 commit 854aa68
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/jaxsim/high_level/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,15 @@ def com_position(self) -> jtp.Vector:
# Algorithms
# ==========

def coriolis_matrix(self) -> jtp.Matrix:
H, H_dot, C = jaxsim.physics.algos.coriolis.coriolis(
model=self.physics_model,
q=self.data.model_state.joint_positions,
qd=self.data.model_state.joint_velocities,
)

return H, H_dot, C

@functools.partial(oop.jax_tf.method_ro)
def forward_kinematics(self) -> jtp.Array:
""""""
Expand Down
16 changes: 16 additions & 0 deletions src/jaxsim/physics/algos/coriolis.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,19 @@ def inner_loop_body(
)

return Ic, Bc


# if __name__ == "__main__":
# import jax.numpy as jnp
# import jaxsim
# from jaxsim.high_level.model import Model
# from pathlib import Path

# urdf_path = Path(
# "/home/flferretti/git/element_rl-for-codesign/assets/model/Hopper.sdf"
# )

# model = Model.build_from_model_description(model_description=urdf_path)

# with jax.disable_jit():
# H, H_dot, C = model.coriolis_matrix()

0 comments on commit 854aa68

Please sign in to comment.