Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A tutorial for creating new in env in RoboHive #84

Open
vikashplus opened this issue Apr 14, 2023 · 5 comments
Open

A tutorial for creating new in env in RoboHive #84

vikashplus opened this issue Apr 14, 2023 · 5 comments
Labels
docs Question/improve docs enhancement New feature or request

Comments

@vikashplus
Copy link
Owner

No description provided.

@vikashplus vikashplus added enhancement New feature or request docs Question/improve docs labels Apr 14, 2023
@tattrongvu
Copy link

Hi, I would like to ask where can i find 'obj_goal' key list for franka_kitchen_v2:FrankaKitchen environments? I tried 'microwave' but it keep saying keyerror! Thanks in advance!

@vikashplus
Copy link
Owner Author

@tattrongvu -- The latest version of FrankaKitchen environments is v4.

  • Please see here for the latest version of these environments.
  • you can also follow the change log to understand the differences

@tattrongvu
Copy link

Dear @vikashplus , thanks for your instruction. So i'm trying to get the render image from envs with this code bellow but not working. Since this environments base on mujoco_py so i tried to use MjViewer as in your tutorial https://github.com/vikashplus/robohive/blob/main/robohive/tutorials/render_cams.py
but it show error as described bellow:

env = gym.make('FK1_MicroOpenRandom-v4')
for i in range(50):
env.reset()
step=0
while True:
a = env.action_space.sample() # Sample an action
obs, reward, done, info = env.step(a)
img=env.sim.render(camera_name='topview', width=512, height=512, depth=False,mode='offscreen')
#above line raise: 'MjPySimScene' object has no attribute 'render'
#env.render() #this also not work, raise NotImplementedError
step+=1
print(step)
if done or step==200:
break

Could you point me how could i do it. Thank you very much!

@tattrongvu
Copy link

tattrongvu commented Apr 16, 2023

Hi, after digging to your code i found two ways:
1, img= env.sim.sim.render(camera_name='left_cam', width=512, height=512, depth=False,mode='offscreen')
2, img= env.sim.renderer.render_offscreen(camera_id='left_cam', width=512, height=512)
But I noticed that it has very low FPS. Is this the correct way to get an RGB image from your environment (FrankaKitchen)?

@vikashplus
Copy link
Owner Author

  1. You can render camera views from an env and random policy with
python utils/examine_env.py --env_name FK1_MicroOpenRandom-v4 --num_episodes 1 --camera_name top_cam --render offscreen
  1. Rending speed depends on the hardware that you have access to. You can use following to check if mujoco_py is compiled with hardware support
python -c "import mujoco_py as mj; print(mj.cymj)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Question/improve docs enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants