ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

TurtleBot2 with openai_ros

asked 2019-04-11 05:55:17 -0500

Uls gravatar image

I am trying to set up the turtlebot2 with openai_ros on my local computer. I use Ubuntu 16.04, kinetic. I've downloaded all the packages I think I need, and used catkin build.

I am following the instructions at , but when I get to 2c and launch using roslaunch my_turtlebot2_training start_training.launch I get the error

AttributeError: 'module' object has no attribute 'task_envs.turtlebot2.turtlebot2_maze.TurtleBot2MazeEnv'

The traceback of the code is

Traceback (most recent call last):
  File "/home/myuser/catkin_ws/src/my_turtlebot2_training/src/", line 20, in <module>
    env = gym.make('TurtleBot2Maze-v0')
  File "/home/myuser/gym/gym/envs/", line 183, in make
    return registry.make(id, **kwargs)
  File "/home/myuser/gym/gym/envs/", line 125, in make
    env = spec.make(**kwargs)
  File "/home/myuser/gym/gym/envs/", line 88, in make
    cls = load(self._entry_point)
  File "/home/myuser/gym/gym/envs/", line 18, in load
    fn = getattr(mod, attr_name)
AttributeError: 'module' object has no attribute 'task_envs.turtlebot2.turtlebot2_maze.TurtleBot2MazeEnv'

I get the same error if I try to follow the instructions at .

edit retag flag offensive close merge delete


I also encounter that problem, could you pls tell me how you solve it at the end?

christy gravatar image christy  ( 2019-08-15 03:11:21 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2019-09-15 14:36:07 -0500

benwex93 gravatar image

In it should be 'openai_ros.task_envs.turtlebot2.turtlebot2_wall:TurtleBot2WallEnv' instead of 'openai_ros:task_envs.turtlebot2.turtlebot2_wall.TurtleBot2WallEnv' (notice the change of position of the colon and periods)

edit flag offensive delete link more


I have the same issue but this didn't help

rosmos gravatar image rosmos  ( 2019-09-16 05:17:02 -0500 )edit

you're getting the same exact error? Can you post it?

benwex93 gravatar image benwex93  ( 2019-09-16 05:32:41 -0500 )edit

Never mind! My bad I was apparently editing a different version that I seemed to have been a duplicated copy. Your solution worked!

rosmos gravatar image rosmos  ( 2019-09-16 09:28:53 -0500 )edit

Question Tools



Asked: 2019-04-11 05:55:17 -0500

Seen: 1,062 times

Last updated: Sep 15 '19