Comments (5)
the code:
import numpy as np
import robosuite as suite
import cv2
if __name__ == "__main__":
# get the list of all environments
a = suite.environments
b = suite.environments.ALL_ENVS
envs = sorted(suite.environments.ALL_ENVS)
# print info and select an environment
print("Welcome to Surreal Robotics Suite v{}!".format(suite.__version__))
print(suite.__logo__)
print("Here is a list of environments in the suite:\n")
for k, env in enumerate(envs):
print("[{}] {}".format(k, env))
print()
try:
s = input(
"Choose an environment to run "
+ "(enter a number from 0 to {}): ".format(len(envs) - 1)
)
# parse input into a number within range
k = min(max(int(s), 0), len(envs))
except:
print("Input is not valid. Use 0 by default.")
k = 0
# initialize the task
env = suite.make(
envs[k],
has_renderer=True,
ignore_done=True,
use_camera_obs=True,
render_visual_mesh=True,
control_freq=10,
)
env.reset()
env.viewer.set_camera(camera_id=0)
# do visualization
for i in range(100):
action = np.random.randn(env.dof)
obs, reward, done, _ = env.step(action)
image = obs['image']
image = cv2.flip(image, 0)
fileName = 'image_'+str(i)+'.jpg'
cv2.imwrite(fileName, image)
env.render()
from robosuite.
I just tried running your script on my Macbook, and it seems to work just fine. Can you give further details of what machine you're running on and how I might reproduce the error?
from robosuite.
I just tried running your script on my Macbook, and it seems to work just fine. Can you give further details of what machine you're running on and how I might reproduce the error?
thanks.
I run this script in ubuntu16.04.
when I remove the
env.render()
I will work fine.
if I add it after env.step(action), and save the image from obs["image"] can be randomly dark.
Now, when I found a way to avoid it just remove env.render(), so it may be not necessary rush to deal with it~
from robosuite.
Ah I see - we've also seen similar problems on Ubuntu when trying to render on screen and off screen simultaneously. This could be a problem with mujoco-py
, we're not positive.
from robosuite.
may be a problem with mujoco-py and existed in ubuntu~
just remove env.render() may work well~
from robosuite.
Related Issues (20)
- Wipe task
- `flush_freq` in `data_collect_wrapper.py` affecting deterministic episode playback
- Robot is not subjected to gravity and friction
- Confusion about linear_interpolator and control frequency
- How add an impedance controller in teleoperation HOT 1
- Issue importing deformable cloth object
- OpenGL.raw.EGL._errors.EGLError HOT 4
- Add custom env to robosuite.make HOT 1
- AttributeError: 'MjRenderContextOffscreen' object has no attribute 'con' on local Ubuntu machine HOT 4
- Floating object
- `get_state` and `set_state` do not involve the pos and quat of the mocap body HOT 5
- Confusion about the action space of the controller HOT 1
- test grippers import bug
- grippers model bug (robotiq_gripper_85.xml)
- Specific type of Position controller for robosuite/robomimic
- ValueError: Error: resource not found via provider or OS filesystem HOT 3
- Clipping issue
- Image based RL for Robosuite
- Issue about install robosuite
- Add an object for visual only
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robosuite.