Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run with example configuration files #3

Open
kate-holdener opened this issue Feb 24, 2023 · 1 comment
Open

Unable to run with example configuration files #3

kate-holdener opened this issue Feb 24, 2023 · 1 comment

Comments

@kate-holdener
Copy link

I installed all the dependencies and trying to run Pylot with one of the example config files:
python -m pylot examples/LinearizedModel/keyboard_trimmed_input.json

Getting the following output:

pygame 2.1.3 (SDL 2.0.22, Python 3.11.2)
Hello from the pygame community. https://www.pygame.org/contribute.html

-----------------------------------------------------
|                                                   |
|                    Pylot 1.3.4                    |
|                                                   |
|               (c) USU AeroLab 2020                |
|                                                   |
|             This software comes with              |
|    ABSOLUTELY NO WARRANTY EXPRESSED OR IMPLIED    |
|                                                   |
|           Submit bug reports on Github.           |
|                                                   |
-----------------------------------------------------
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/holdenerea/repos/Pylot/pylot/__main__.py", line 25, in <module>
    simulate(input_filename)
  File "/Users/holdenerea/repos/Pylot/pylot/__main__.py", line 13, in simulate
    sim = Simulator(input_dict, verbose=True)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/holdenerea/repos/Pylot/pylot/simulator.py", line 95, in __init__
    self._initialize_graphics()
  File "/Users/holdenerea/repos/Pylot/pylot/simulator.py", line 131, in _initialize_graphics
    self._ground_quad.append(self._create_mesh("field.obj", "field.vs", "field.fs", "field_texture.jpg", self._ground_positions[i], ground_orientations[i]))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/holdenerea/repos/Pylot/pylot/simulator.py", line 192, in _create_mesh
    mesh = Mesh(os.path.join(self._objects_path, obj),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/holdenerea/repos/Pylot/pylot/graphics.py", line 173, in __init__
    self.shader = compile_shader(vertexshadername, fragmentshadername)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/holdenerea/repos/Pylot/pylot/graphics.py", line 28, in compile_shader
    shader = OpenGL.GL.shaders.compileProgram(OpenGL.GL.shaders.compileShader(vert_shader, GL_VERTEX_SHADER),
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/holdenerea/repos/Pylot/venv/lib/python3.11/site-packages/OpenGL/GL/shaders.py", line 235, in compileShader
    raise ShaderCompilationError(
OpenGL.GL.shaders.ShaderCompilationError: ('Shader compile failure (0): b"ERROR: 0:1: \'\' :  version \'330\' is not supported\\nERROR: 0:2: \'layout\' : syntax error: syntax error\\n"', [b'#version 330\nlayout(location = 0) in vec3 position;\nlayout(location = 1) in vec2 textureCoords;\nlayout(location = 2) in vec3 vertNormal;\n\nuniform mat4 model;\nuniform mat4 view;\nuniform mat4 proj;\nuniform mat4 orientation;\n\nout vec2 newTexture;\nout vec3 fragNormal;\n\nvoid main()\n{\n\tfragNormal = vec4(vertNormal, 0.0f).xyz;\n    gl_Position = proj * view * model *orientation* vec4(position, 1.0f);\n    newTexture = vec2(textureCoords.x, 1 - textureCoords.y);\n}\n'], GL_VERTEX_SHADER)

Really would appreciate some help on this issue, this software simulation is exactly what I need for my current project.

@corygoates
Copy link
Member

OpenGL is rather finicky. Unfortunately, I really have no advice other than what's already described in the documentation. If anyone else knows how to fix this, please reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants