Locomotion Tracking Reward

~10 mincode completion

Implement locomotion_reward(v, v_cmd, sigma, tau, c_tau, a, a_prev, c_a) returning 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

Run your code to see results

⌘↵ runs against the visible tests

Loading docs…

The AI Mentor needs an account

It reads your code and the failing tests and nudges you toward the fix without handing you the answer. Free accounts get it on every problem you're working on today.