Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Bodies Dynamically #366

Open
tomalner18 opened this issue Jun 2, 2023 · 1 comment
Open

Fixing Bodies Dynamically #366

tomalner18 opened this issue Jun 2, 2023 · 1 comment

Comments

@tomalner18
Copy link

Hi, I'm looking for a way to fix/lock a body in its current position. Is it possible, for example, to set the joint ranges - in this case of a body with a 'free' joint - to the object's current q during a rollout. If you have any kind of example that would be amazing, thanks!

@btaba
Copy link
Collaborator

btaba commented Jun 9, 2023

Hi @tomalner18 , thanks for using brax!
You'd want to edit the dof limits

limit: Tuple[jp.ndarray, jp.ndarray]

here's an example

@jax.jit
def do_stuff(sys, state):
  state = pipeline.step(sys, state, jp.zeros(sys.act_size()))
  sys = sys.replace(dof=sys.dof.replace(limit=(sys.dof.limit[0].at[0].set(0), sys.dof.limit[1].at[0].set(0))))
  state = pipeline.step(sys, state, jp.zeros(sys.act_size()))
  return state

let us know if that works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants