Calling env.render() always renders a windows filling the whole screen.
env = gym.make('FetchPickAndPlace-v1')
env.reset()
for i in range(1000):
env.render()
Calling env.render() always renders a windows filling the whole screen.
env = gym.make('FetchPickAndPlace-v1')
env.reset()
for i in range(1000):
env.render()
After a number of failed attempts think I finally figured this out for:
mujoco==2.3.0
gym==0.25.2
Have tested it works on Ant-v4 env.
Import glfw and put this line after the first time you call env.render():
env.render()
width = 100
height = 100
glfw.set_window_size(env.viewer.window, width, height)
You can give this a try:
import matplotlib
is_ipython = 'inline' in matplotlib.get_backend()
if is_ipython: from IPython import display
env = gym.make('FetchPickAndPlace-v1')
a = env.render(mode='rgb_array')
plt.figure()
plt.imshow(a)
plt.show()
if is_ipython: display.clear_output(wait=True)