brax icon indicating copy to clipboard operation
brax copied to clipboard

humanoid_run doesn't work in composer Colab

Open KarolisRam opened this issue 3 years ago • 1 comments
trafficstars

If you go to: https://colab.research.google.com/github/google/brax/blob/main/notebooks/composer/composer.ipynb and choose humanoid_run as the environment, the next cell throws the following error:

[/usr/local/lib/python3.7/dist-packages/brax/physics/system.py](https://localhost:8080/#) in default_angle(self, default_index)
     68       defaults = self.config.defaults[default_index]
     69       for ja in defaults.angles:
---> 70         arr = vec_to_arr(ja.angle)[:dofs[ja.name]] * jp.pi / 180
     71         angles[ja.name] = arr
     72 

KeyError: 'left_knee'

KarolisRam avatar Mar 17 '22 10:03 KarolisRam

We have a fix for this internally, will ship out externally shortly. In short, NAME_FIELDS in component_editory.py should be this:

NAME_FIELDS = {
    'bodies': ('name',),
    'joints': (
        'name',
        'parent',
        'child',
    ),
    'actuators': (
        'name',
        'joint',
    ),
    'collide_include': (
        'first',
        'second',
    ),
    'qps': ('name',),
    'angles': ('name',),
}

i.e., it's missing the qps and angles keys. h/t @frt03 for the fix

cdfreeman-google avatar Mar 18 '22 17:03 cdfreeman-google