Skip to content

Instantly share code, notes, and snippets.

@rfdickerson
Last active February 27, 2021 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfdickerson/30a1c11673fd71049bb80fc8842266c9 to your computer and use it in GitHub Desktop.
Save rfdickerson/30a1c11673fd71049bb80fc8842266c9 to your computer and use it in GitHub Desktop.
ik-forward
@jit
def forward_ik(angles, lengths):
x = jnp.cos(angles)
y = jnp.sin(angles)
d = jnp.stack([x,y], axis=0)
return jnp.dot(d, lengths)
@jit
def forward(state):
return forward_ik(state["angles"], state["lengths"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment