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

Simulation #23

Open
anjugopinath opened this issue Nov 23, 2021 · 2 comments
Open

Simulation #23

anjugopinath opened this issue Nov 23, 2021 · 2 comments

Comments

@anjugopinath
Copy link

Hi,

Is it possible to run a simulator to view the gripper in action?

@ZhouYFeng
Copy link

Hi,

Have you solved your problem? @anjugopinath

I am trying the training and testing process by SSH via VScode as well, so there is no GUI. If there some ways I can get the dynamic view of the simulation?

Thanks.

@SantiDiazC
Copy link

Hi,

I'm not sure you are still interested in it or you solved it already. In case you still interested you can just see the demos.py file.
when you set the flag --disp=True when running the python script and instantiate the environment, there it start the pybullet client. in that case if disp==True then the client uses the GUI interface. Then they use the debugVisualizerCamera and they set the configuration so the camera is located appropriately looking to the scene (ravens/environments/environment.py):

  if disp:
    target = p.getDebugVisualizerCamera()[11]
    p.resetDebugVisualizerCamera(
        cameraDistance=1.1,
        cameraYaw=90,
        cameraPitch=-25,
        cameraTargetPosition=target)

Now the visualizer is set every time you call "env.step()" the image in the debugger is updated.
There is an implementation of env.render() as well, but it returns the color image (numpy array) of the same camera as the debugger visualizer, so you may see it using opencv (cv2.imshow()) for example. The only problem is the render method only return the last frame of the step method, so I think its more useful and easier to use the debugger visualizer the way it is implemented.

I hope it may be useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants