{"action":"opened","issue":{"url":"https://api.github.com/repos/openai/gym/issues/602","repository_url":"https://api.github.com/repos/openai/gym","labels_url":"https://api.github.com/repos/openai/gym/issues/602/labels{/name}","comments_url":"https://api.github.com/repos/openai/gym/issues/602/comments","events_url":"https://api.github.com/repos/openai/gym/issues/602/events","html_url":"https://github.com/openai/gym/issues/602","id":232308353,"number":602,"title":"IndexError when running \"Pendulum-v0\" env with matlab-http-api","user":{"login":"vBarbaros","id":13934756,"avatar_url":"https://avatars1.githubusercontent.com/u/13934756?v=3","gravatar_id":"","url":"https://api.github.com/users/vBarbaros","html_url":"https://github.com/vBarbaros","followers_url":"https://api.github.com/users/vBarbaros/followers","following_url":"https://api.github.com/users/vBarbaros/following{/other_user}","gists_url":"https://api.github.com/users/vBarbaros/gists{/gist_id}","starred_url":"https://api.github.com/users/vBarbaros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vBarbaros/subscriptions","organizations_url":"https://api.github.com/users/vBarbaros/orgs","repos_url":"https://api.github.com/users/vBarbaros/repos","events_url":"https://api.github.com/users/vBarbaros/events{/privacy}","received_events_url":"https://api.github.com/users/vBarbaros/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-30T16:22:50Z","updated_at":"2017-05-30T16:22:50Z","closed_at":null,"body":"Hey guys,\r\n\r\nI installed the 'gym' package inside a python-2.7 virtualenv, and was running the \"Pendulum-v0\" env using the 'binding-matlab/gym_http_client.m' from 'gym-http-api'.\r\n\r\nWhen starting the env, an error was constantly rising:\r\n'../path_to_my_virtualenv/virtual_gym_npreps/local/lib/python2.7/site-packages/gym/envs/classic_control/pendulum.py\", line 37, in _step\r\n    u = np.clip(u, -self.max_torque, self.max_torque)[0]\r\nIndexError: invalid index to scalar variable.'\r\n\r\nI took off the indexing part and now I can run it properly; apparently, the control 'u' is already a scalar for the pendulum.\r\n\r\nNot sure if I should pull a request for this change or the reason I got this error is somewhere in the intermediate steps and 'u' should not be a scalar after all (couldn't see any specs for the Pendulum, but it makes sense to expect a single number for the torque, right), or 'u' should be passed as array, i.e.,  'np.clip([u], ....)'\r\n\r\nLet me know how to handle this correctly, \r\nThanks"}}
{"actor":{"display_login":"vBarbaros"}}