MCPcopy Create free account
hub / github.com/InternRobotics/OpenHomie / pd_control

Function pd_control

MujocoDeploy/mujoco_deploy_g1.py:27–29  ·  view source on GitHub ↗

Calculates torques from position commands

(target_q, q, kp, target_dq, dq, kd)

Source from the content-addressed store, hash-verified

25 return config
26
27def pd_control(target_q, q, kp, target_dq, dq, kd):
28 """Calculates torques from position commands"""
29 return (target_q - q) * kp + (target_dq - dq) * kd
30
31def quat_rotate_inverse(q, v):
32 """Rotate vector v by the inverse of quaternion q"""

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected