diff --git a/alr_envs/classic_control/simple_reacher.py b/alr_envs/classic_control/simple_reacher.py index 37319bb..42fe93a 100644 --- a/alr_envs/classic_control/simple_reacher.py +++ b/alr_envs/classic_control/simple_reacher.py @@ -1,3 +1,5 @@ +import os + import gym import numpy as np from gym import spaces, utils @@ -6,7 +8,8 @@ from gym.utils import seeding import matplotlib as mpl import matplotlib.pyplot as plt -mpl.use('Qt5Agg') # or can use 'TkAgg', whatever you have/prefer +if not os.environ.get("DISPLAY", None): + mpl.use('Qt5Agg') class SimpleReacherEnv(gym.Env, utils.EzPickle): @@ -80,7 +83,7 @@ class SimpleReacherEnv(gym.Env, utils.EzPickle): return np.clip(action, lb, ub) def _get_obs(self): - return [self._joint_angle, self._angle_velocity, self.end_effector - self._goal_pos, self._steps] + return np.hstack([self._joint_angle, self._angle_velocity, self.end_effector - self._goal_pos, self._steps]) def _update_joints(self): """ diff --git a/setup.py b/setup.py index 9f6b4f1..81f949d 100644 --- a/setup.py +++ b/setup.py @@ -2,5 +2,5 @@ from setuptools import setup setup(name='alr_envs', version='0.0.1', - install_requires=['gym'] # And any other dependencies foo needs -) \ No newline at end of file + install_requires=['gym', 'PyQt5'] # And any other dependencies foo needs + )