Search code examples
drake

Unresolved error while executing Drake Shoe Tie example


I'm getting following error while running the example as mentioned in this link:

from gym.envs.robot_locomotion_group.drake.shoe.open_loop import (
ModuleNotFoundError: No module named 'gym.envs.robot_locomotion_group'

Can someone please tell why so, when this file exists.

Also, after installation of drake, I couldn't locate any file under /opt to run Drake-visulaizer as /opt/drake/bin/drake-visualizer


Solution

  • First, you should check if gym is inside your PYTHONPATH. If you're not running an IDE / virtual environment, you should append the git folder to PYTHONPATH. For example, add the following lines to your ~/.bashrc file,

    export PYTHONPATH=/home/{USERNAME}/gym:${PYTHONPATH}

    and afterwards, don't forget to source ~/.bashrc.

    The more serious problem is that this package is very out-of-date and not maintained anymore. A lot has happened since it was written:

    • Drake has deprecated drake-visualizer, and now solely supports meshcat.
    • A variety of syntax within Drake has changed, so running this code with the current version of Drake will produce many errors.
    • I think the RL folks are moving gym to gymnasium, so the version of gym that RobotLocomotion/gym uses should be deprecated as well.

    I managed to fix the second issue for you and just pushed a hotfix to main that makes the code compatible with the current version of Drake. If you pull from main again and run

    python3 gym/envs/robot_locomotion_group/drake/shoe/test_gym.py

    it should be running. You'll see a text like

    INFO:drake:Meshcat listening for connections at http://localhost:7001 where you can click on the link to open the meshcat visualizer.

    But going forwards, I would take the environments within gym/envs/robot_locomotion_group/drake and use it separately outside of gym for your project.