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

Revision history [back]

Below, I am quoting the error from logs posted in the question:

AssertionError: The environment must specify an observation space. https://www.gymlibrary.dev/content/environment_creation/

The above error is unrelated to ROS. It is coming from OpenAI Gym.

There are certain rules that must be followed when designing a new environment in OpenAI Gym. For example, every environment must have observation space. The observation space is defined by the observation_space attribute. However, it is not specified in your case, i.e., env.observation_space in None. Thus you are getting the error.

Please change line number 29 of the start_training.py file, where you are creating an environment, with the following:

env = gym.make('CartPole-v0')

Notice that I am using an existing environment in OpenAI Gym.