MCPcopy Create free account
hub / github.com/TeleHuman/PBHC / pd_control

Method pd_control

humanoidverse/deploy/mujoco.py:332–337  ·  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

330
331 @staticmethod
332 def pd_control(target_q, q, kp, target_dq, dq, kd):
333 '''Calculates torques from position commands
334 '''
335 if MujocoRobot.RAND_NOISE:
336 kp,kd = MujocoRobot.mk_rand_noise(np.array([kp, kd]), MujocoRobot.noise_ratio)
337 return (target_q - q) * kp + (target_dq - dq) * kd
338
339 def _get_state(self):
340 '''Extracts physical states from the mujoco data structure

Callers 1

_apply_actionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected