question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to test/run OpenGL visualization?

See original GitHub issue

Hi,

I installed dm_control yesterday on an Ubuntu 16.04LTS system with NVIDIA graphics card. I have already installed --and work with-- mjpro150 and 131 (both mujoco-py and custom C++ interface) so I know those work fine.

I created the following “quickstart” script, using the provided one in the README:

import numpy as np
from dm_control import suite
# Load one task:
env = suite.load(domain_name="humanoid", task_name="stand", visualize_reward=True)
# Iterate over a task set:
for domain_name, task_name in suite.BENCHMARKING:
    env = suite.load(domain_name, task_name)
# Reset data
action_spec = env.action_spec()
time_step = env.reset()
# Step through an episode and print out reward, discount and observation.
while not time_step.last():
    action = np.random.uniform(action_spec.minimum,
                             action_spec.maximum,
                             size=action_spec.shape)
    time_step = env.step(action)
    pixels = env.physics.render()
    print(time_step.reward, time_step.discount, time_step.observation)

It “seems” to run since the print() call in the loop does indeed output such as:

0.9902381173079999 1.0 OrderedDict([('orientations', array([ 0.92190494, -0.38741616,  0.75086908, -0.66045108,  0.34782824,
        0.93755827,  0.01050299,  0.99994484, -0.34440243, -0.93882211,
       -0.02782136, -0.99961291,  0.52972116, -0.84817185])), ('height', 1.2930647420729058), ('velocity', array([ -0.49068857,   0.54707421,   2.52160751,   4.02860209,
        -1.37774209,  -4.43418408,   9.91898924, -14.24762728,
         0.23987449]))])

However, the MuJoCo OpenGL visualization never starts.

To get set-up, I created a virtualenv environment from scratch with python 3.5.2 as default (via PyCharm).

Also, I have to report that there is no Ubuntu package for libglew2.0 via apt-get on 16.04LTS. I had to download it from here and I not sure if this was the proper solution. I would appreciate it if someone who got it to work on Ubuntu 16.04 can report their steps.

Cheers,

Vassilios

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
saran-tcommented, Jan 10, 2018

Apparently libglew2.0 doesn’t exist until zesty (i.e. Ubuntu 17). For xenial (i.e. 16.04LTS) you can use libglew1.13 instead, see https://packages.ubuntu.com/search?keywords=libglew

The libglfw3 package should work in all recent versions of Ubuntu. Alternatively, as @efagerho suggested you can also install the -dev packages which will also pull in headers too, but this shouldn’t be necessary.

1reaction
NPC-Wangcommented, Apr 12, 2018

import matplotlib.pyplot as plt … plt.imshow(env.physics.render(height, width, camera_id=0)) plt.show(block=False) plt.pause(.01)

any news?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Depth testing - LearnOpenGL
Depth buffer visualized in OpenGL and GLSL. This clearly shows the non-linearity of the depth value. Objects close by have a much larger...
Read more >
An OpenGL-based Eclipse Plug-in for Visual Debugging
tential, we present an OpenGL-based Eclipse plug-in that explores two visualization techniques - viz. treemap and sunburst - aimed at aiding the developer ......
Read more >
OpenCL/OpenGL aproach for studying active Brownian motion
PDF | This work presents a methodology for studying active Brownian dynamics on ratchet potentials using interoperating OpenCL and OpenGL.
Read more >
About Test Visualizer | TestComplete Documentation
The frames that were captured during a test run contain only images by default. To make Test Visualizer collect test object data along...
Read more >
How can an OpenGL visualization run for weeks?
To make an application, OpenGL or not, run for extended time safety-critical applications are mostly built to restart on error, be it a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found