duckietown / gym-duckietown

Self-driving car simulator for the Duckietown universe
http://duckietown.org
Other
51 stars 19 forks source link

standalone.py #2

Closed paulaurel closed 6 years ago

paulaurel commented 6 years ago

When running the standalone.py script I get an error message, related to env = gym.make(args.env_name).

maximecb commented 6 years ago

Please paste the complete error message you got.

paulaurel commented 6 years ago

This is the error I received: Traceback (most recent call last): File "./standalone.py", line 18, in env = gym.make(args.env_name) File "/home/daurel/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 163, in make return registry.make(id) File "/home/daurel/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 119, in make env = spec.make() File "/home/daurel/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 86, in make env = cls(**self._kwargs) File "/home/daurel/Documents/Bachelorarbeit/DuckieSim/gym-duckietown/gym_duckietown/envs/simplesim_env.py", line 281, in init self.multiFBO, self.finalFBO = createFrameBuffers() File "/home/daurel/Documents/Bachelorarbeit/DuckieSim/gym-duckietown/gym_duckietown/envs/simplesim_env.py", line 97, in createFrameBuffers True File "/home/daurel/.local/lib/python3.5/site-packages/pyglet/gl/lib.py", line 105, in errcheck raise GLException(msg) pyglet.gl.lib.GLException: b'invalid operation'

maximecb commented 6 years ago

Are you on a mac?

paulaurel commented 6 years ago

using a virtual machine on a mac

maximecb commented 6 years ago

So the issue is because the OpenGL drivers on the mac don't support some of the features that I'm using (supported by nvidia drivers). Specifically the use of anti-aliasing in frame buffer objects. I'll try to make it work. I have a macbook at home that I can use to test it.

paulaurel commented 6 years ago

That would be perfect thank you.

paulaurel commented 6 years ago

I just ran the standalone.py code on a pc running linux and encountered the following problem

./standalone.py Traceback (most recent call last): File "./standalone.py", line 18, in env = gym.make(args.env_name) File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 163, in make return registry.make(id) File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 119, in make env = spec.make() File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 85, in make cls = load(self._entry_point) File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 14, in load result = entry_point.load(False) File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 2431, in load return self.resolve() File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 2437, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/home/daurel_duckietown/Documents/Bachelorarbeit/duckiesim/gym-duckietown/gym_duckietown/envs/init.py", line 3, in from gym_duckietown.envs.duckiebot_env import DuckiebotEnv File "/home/daurel_duckietown/Documents/Bachelorarbeit/duckiesim/gym-duckietown/gym_duckietown/envs/duckiebot_env.py", line 10, in import cv2 ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type

fgolemo commented 6 years ago

@paulaurel: could you try this please: https://stackoverflow.com/questions/43019951/after-install-ros-kinetic-cannot-import-opencv

fgolemo commented 6 years ago

... because from what I see in the traceback you are starting your script in Python 3 but then it tries to import OpenCV for PY 2.7 and that obviously won't work.

paulaurel commented 6 years ago

Thank you. I am now able to import OpenCV in python 3. Yet I still cannot run the standalone.py code. I now encounter the following error

Traceback (most recent call last): File "./standalone.py", line 18, in env = gym.make(args.env_name) File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 163, in make return registry.make(id) File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 119, in make env = spec.make() File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 86, in make env = cls(**self._kwargs) File "/home/daurel_duckietown/Documents/Bachelorarbeit/duckiesim/gym-duckietown/gym_duckietown/envs/simplesim_env.py", line 281, in init self.multiFBO, self.finalFBO = createFrameBuffers() File "/home/daurel_duckietown/Documents/Bachelorarbeit/duckiesim/gym-duckietown/gym_duckietown/envs/simplesim_env.py", line 97, in createFrameBuffers True File "/home/daurel_duckietown/.local/lib/python3.5/site-packages/pyglet/gl/lib.py", line 105, in errcheck raise GLException(msg) pyglet.gl.lib.GLException: b'invalid operation'

The error is identical to the one I encountered on my virtual machine.

fgolemo commented 6 years ago

@paulaurel That's the same issue as before: a problem with GL caused by the code using some platform-specific GL instructions that aren't supported by your virtual machine.

As Maxime mentioned here https://github.com/duckietown/gym-duckietown/issues/2#comment-373571330 there is no easy fix but she is working on a solution.

paulaurel commented 6 years ago

@fgolemo Now I am running it on a PC running ubuntu lts 16.04 not via a virtual machine.

fgolemo commented 6 years ago

I see. I think the issue is still related to some platform- or driver-specific OpenGL code. Could you run the command glxgears from the Ubuntu package mesa-utils and tell us which output you get and if you see any errors? Same for glxinfo > glxinfo.log and then please attach (not paste) that text file (glxinfo.log).

paulaurel commented 6 years ago

Here you go. Thanks for your efforts. I am really grateful. glxgears.log glxinfo.log (obtained on the PC)

maximecb commented 6 years ago

@paulaurel So, I pushed a tentative fix on the master branch.

Can someone with a macbook do a git pull and let me know if they can run ./standalone.py? If not, please paste the complete error message.

paulaurel commented 6 years ago

It works! Thank you!