Closed Dzhange closed 3 years ago
this looks like a timing issue, and I see you had my same impression (as you tried to edit the simulation timestep timing. However that block won't be executed if render = False
, did you tried removing that if statement as well?
Yeah I tried to remove that if statement, actually the videos are recorded with this block executed.
I'm wondering if this problem is related to the parameters updated here? https://github.com/nicrusso7/rex-gym/blob/26663048bd3c3da307714da4458b1a2a9dc81824/rex_gym/envs/gym/walk_env.py#L262-L275
I may be wrong but, nope, don't think so.. in both cases, the values we set are actually the same
Do you have the same behavior running the policy_player in render mode? just wondering if the pybullet update made some changes
HIii, just checked several things:
2) render only --> normal
3)record video only --> rapid frequency, yet slow
I guess the problem is mainly about timing, let me take a deeper look at that. Here is my implementation of recording if you are interested: https://github.com/Dzhange/rex-gym/blob/779470994e74259f5b29db62beb4f4aa05f8ddeb/rex_gym/playground/policy_player.py#L45-L84
I think I found the problem:
In render mode, fps is around 50
but when using capture_frame
to visualize, the fps drops to ~3
I'm wondering if there is any method to fix the time for each step in the pybullet world? or do you have any suggestions? Thanks!
Each env has its own metadata:
Have you tried editing video.frames_per_second
?
Hi,
thanks for your advice, this did make the video more nature! After some struglling I raised the fps to ~20 by adding this block
not sure if this would support batchified training but I think that has little to do with this issue, I'll close itHi,
thanks for your advice, this did make the video more nature! After some struglling I raised the fps to ~20 by adding this block
self._pybullet_client = bullet_client.BulletClient(connection_mode=pybullet.DIRECT)
import pkgutil
egl = pkgutil.get_loader('eglRenderer')
if egl:
pluginId = pybullet.loadPlugin(egl.get_filename(), "_eglRendererPlugin")
else:
pluginId = pybullet.loadPlugin("eglRendererPlugin")
print("pluginId=",pluginId)
not sure if this fps would support batchified training, but I think that has little to do with this issue, I'll close it
Hi
After I fixed the headless rendering issue I had another problem.
While running the
policy_player
in headless mode, I turnedrender
option to False when initializing the environment, and used agym.wrappers.monitoring.video_recorder
to record the scene. Here you can see the robot is walking smoothly backwards(walking environment, in mounts terrain).https://user-images.githubusercontent.com/35654021/118835855-f1504500-b8f5-11eb-9c61-a6f37d0bc16f.mp4
Another case(gallop, plane), but this time is turning around
https://user-images.githubusercontent.com/35654021/118837850-c6ff8700-b8f7-11eb-87f3-0b868ec910f4.mp4
I tried enabling the sleep control in https://github.com/nicrusso7/rex-gym/blob/26663048bd3c3da307714da4458b1a2a9dc81824/rex_gym/envs/rex_gym_env.py#L387-L398
but the problem still exists. Any ideas?
Thanks!