erwincoumans / motion_imitation

Code accompanying the paper "Learning Agile Robotic Locomotion Skills by Imitating Animals"
Apache License 2.0
1.13k stars 284 forks source link

Env Issues #58

Closed ehHan closed 3 years ago

ehHan commented 3 years ago

Hi, Erwin. First of all, thank you for your codeshare. I followed the steps and it worked.

But I faced with an error; 'No registered env with id: A1GtmEnv-v1' in the process of 'Getting started with MPC and the environment' When I ran python code:

import gym env = gym.make('motion_imitation:A1GymEnv-v1', render=True)

Do you know how to fix it?

Thank you in advance. Euihyun Han

erwincoumans commented 3 years ago

The code was disabled, don't recall the issue. Can you add the snipped below to the motion_imitation/init.py file and see if that helps? Then uninstall motion_imitation and re-install using

python3 setup.py develop --user
"""Set up gym interface for locomotion environments."""
import gym
from gym.envs.registration import registry, make, spec

def register(env_id, *args, **kvargs):
  if env_id in registry.env_specs:
    return
  else:
    return gym.envs.registration.register(env_id, *args, **kvargs)

register(
    env_id='A1GymEnv-v1',
    entry_point='motion_imitation.envs.gym_envs:A1GymEnv',
    max_episode_steps=2000,
    reward_threshold=2000.0,
)
Dobid commented 3 years ago

Hello,

I faced the same issue than ehHan and the snippet added to motion_imitation/init.py made it work. If I can ask an other question, being fairly new to RL, I'm trying to play a bit with the code : changed the robot from A1 to Laikago, changed task from "simple forward task" to "imitation_task" (I explore and understand the code this way). I was wondering if I can do the same with the model and use an MLPPolicy directly from stable_baselines import instead of the custom PPO_imitation model ?

Thanks for sharing the codebase, Thank you in advance

erwincoumans commented 3 years ago

We used the modified version used here (PPO_imitation), it has some changes related to the curriculum used (don't have the details handy). So the MLPPolicy from stable_baselines likely doesn't work as well.