Locomotion Tracking Reward
~10 mincode completion
Implement locomotion_reward(v, v_cmd, sigma, tau, c_tau, a, a_prev, c_a) returning rt as a float.
Python
import numpy as np
def locomotion_reward(v, v_cmd, sigma, tau, c_tau, a, a_prev, c_a):
"""
Velocity-tracking reward with torque and action-rate penalties.
Args:
v, v_cmd: measured and commanded body velocity, shape (d,)
sigma: tracking tolerance
tau: joint torques this step, shape (n,)
c_tau: torque penalty weight
a, a_prev: this step's and last step's actions, shape (n,)
c_a: action-rate penalty weight
Returns:
float: the reward r_t
"""
# YOUR CODE HERE
pass