tud-amr / localPlannerBench

Local Planner Bench
https://tud-amr.github.io/localPlannerBench/
GNU General Public License v3.0
49 stars 5 forks source link

Example Problem #9

Open maxspahn opened 2 years ago

maxspahn commented 2 years ago

When running the example in a fresh install some dependencies are missing: gnuplot Library GLU option

Also, some error in the documentation: pdbplanner must be replaced with pdplanner.

maxspahn commented 2 years ago

Set default to --no-open.

niketagrawal commented 2 years ago
(plannerbenchmark-nPaI4okZ-py3.8) nagrawal@TUD258754:~/DCC-assignments/localPlannerBench/experiments/example$ ../../plannerbenchmark/exec/runner -c setup/exp.yaml -p pdplanner setup/planner.yaml --render
start run
Composing the planner
Planner composed in 0.0 sec
Timestep : 0
Traceback (most recent call last):
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/gym/envs/classic_control/rendering.py", line 27, in <module>
    from pyglet.gl import *
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/pyglet/gl/__init__.py", line 95, in <module>
    from pyglet.gl.gl import *
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/pyglet/gl/gl.py", line 45, in <module>
    from pyglet.gl.lib import link_GL as _link_function
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/pyglet/gl/lib.py", line 149, in <module>
    from pyglet.gl.lib_glx import link_GL, link_GLU, link_GLX
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/pyglet/gl/lib_glx.py", line 46, in <module>
    glu_lib = pyglet.lib.load_library('GLU')
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/pyglet/lib.py", line 164, in load_library
    raise ImportError('Library "%s" not found.' % names[0])
ImportError: Library "GLU" not found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "../../plannerbenchmark/exec/runner", line 216, in <module>
    newmain()
  File "../../plannerbenchmark/exec/runner", line 212, in newmain
    myRunner.run()
  File "../../plannerbenchmark/exec/runner", line 202, in run
    ob, t_new = self.applyAction(action, t)
  File "../../plannerbenchmark/exec/runner", line 128, in applyAction
    ob, _, _, _ = self._env.step(action)
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/gym/wrappers/order_enforcing.py", line 11, in step
    observation, reward, done, info = self.env.step(action)
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/planarenvs/planarCommon/planarEnv.py", line 82, in step
    self.render()
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/planarenvs/pointRobot/envs/pointRobotEnv.py", line 57, in render
    self.renderCommon(self._limits)
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/planarenvs/planarCommon/planarEnv.py", line 118, in renderCommon
    from gym.envs.classic_control import rendering
  File "/home/nagrawal/.cache/pypoetry/virtualenvs/plannerbenchmark-nPaI4okZ-py3.8/lib/python3.8/site-packages/gym/envs/classic_control/rendering.py", line 29, in <module>
    raise ImportError(
ImportError:
    Error occurred while running `from pyglet.gl import *`
    HINT: make sure you have OpenGL installed. On Ubuntu, you can run 'apt-get install python-opengl'.
    If you're running on a server, you may need a virtual frame buffer; something like this should work:
    'xvfb-run -s "-screen 0 1400x900x24" python <your_script.py>'
maxspahn commented 2 years ago

might be apt install freeglut3

niketagrawal commented 2 years ago

This example could be added as part of build test in CI.

maxspahn commented 2 years ago

Consider using docker image here. This might simplify making it work. Consider using the manual flag for github actions.

maxspahn commented 2 years ago

The error: Library 'GLU' not found is not related to this repository. An issue has been created in the corresponding repository, see https://github.com/maxspahn/gym_envs_planar/issues/34

maxspahn commented 2 years ago

If you run into that problem, you can run without the --render flag.

maxspahn commented 2 years ago

I have tried to reproduce the error in a docker container. However, i was not able to open the GUI for the rendering. I'll post the dockerfile here shortly.

maxspahn commented 2 years ago

FROM python:3.7

RUN apt-get update
RUN apt-get install -y git 
RUN apt-get install -y vim
RUN apt-get install -y freeglut3
RUN apt-get install -y dbus-x11
RUN apt-get install -y gedit
RUN apt-get install -y supervisor xinetd x11vnc xvfb openbox xdotool wmctrl x11-utils xterm
RUN apt-get install -y freeglut3-dev freeglut3 libgl1-mesa-dev libglu1-mesa-dev libxext-dev libxt-dev
RUN apt-get install -y python3-opengl libgl1-mesa-glx libglu1-mesa

ENV PYTHONPATH=${PYTHONPATH}:${PWD}

RUN pip3 install poetry

RUN git clone https://github.com/maxspahn/gym_envs_urdf

RUN cd gym_envs_urdf && poetry install -E scenes

# CMD /usr/bin/gedit
# CMD cd gym_envs_planar && poetry run python examples/point_robot.py
CMD cd gym_envs_urdf && poetry run python examples/boxer.py
maxspahn commented 2 years ago
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=nointeractive

RUN apt-get update -q && \
  apt-get install -y git python3-pip python3 python3-dev vim python3-opengl xvfb gedit

ENV PYTHONPATH=${PYTHONPATH}:${PWD}

RUN pip3 install poetry

RUN git clone https://github.com/maxspahn/gym_envs_planar

RUN cd gym_envs_planar && poetry install -E scenes

ADD run_example.sh /run_example.sh

RUN chmod a+x /run_example.sh

CMD ./run_example.sh
maxspahn commented 2 years ago

This last example works very nice!

The run_example.sh script contains the following lines:

cd gym_envs_planar
poetry run python examples/point_robot.py
maxspahn commented 2 years ago

https://github.com/maxspahn/gym_envs_planar/pull/37 The docker is added to the corresponding repository. The Dockerfile suggests that the only library you need to install is python3-opengl.

niketagrawal commented 2 years ago

Thanks for the update.

I am currently unable to get this working on a Linux PC (Ubuntu 20.04) as per the steps mentioned in the README in the PR. It could be because of some internal settings or permissions.

Upon running the container, the GUI window appears momentarily and closes down immediately; I see the following error.

libGL  error: MESA-LOADER: failed to retrieve the device information
Segmentation fault (core dumped)

I tried to look up about the error on the internet but couldn't fix it.