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

How do I apply force to the actuator? #45

Open
smwscth opened this issue Feb 20, 2024 · 1 comment
Open

How do I apply force to the actuator? #45

smwscth opened this issue Feb 20, 2024 · 1 comment

Comments

@smwscth
Copy link

smwscth commented Feb 20, 2024

Hello,
I want to apply force to ur5 model but I don't found the function.
I use 'sim.data.ctrl' when I use mujoco-python, anyone can tell me which function can I use ?
Thank you for your answer very much.

@nsk126
Copy link

nsk126 commented Mar 5, 2024

Simplest working model. Need more details for a better answer.

m = mujoco.MjModel.from_xml_path(<xml>)
d =  mujoco.MjData(m)

while <simloop>:
  mujoco.mj_step(m, d)
  d.ctrl[<act_id>] = <your_control_value>

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