Git Product home page Git Product logo

Comments (8)

Dzhange avatar Dzhange commented on May 26, 2024 2

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

https://github.com/Dzhange/rex-gym/blob/3ffb674ade13ceac3352c3329f1804eb21a08403/rex_gym/envs/rex_gym_env.py#L234-L242

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

from rex-gym.

nicrusso7 avatar nicrusso7 commented on May 26, 2024

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?

from rex-gym.

Dzhange avatar Dzhange commented on May 26, 2024

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?

if self._is_render and self._is_debug:
position, orientation, step_length, step_rotation, step_angle, step_period = \
self._read_inputs(base_pos_coeff, gait_stage_coeff)
else:
position = np.array([base_x,
self._base_y * base_pos_coeff,
self._base_z * base_pos_coeff])
orientation = np.array([self._base_roll * base_pos_coeff,
self._base_pitch * base_pos_coeff,
self._base_yaw * base_pos_coeff])
step_length = (self.step_length if self.step_length is not None else step) * gait_stage_coeff
step_rotation = (self.step_rotation if self.step_rotation is not None else 0.0)
step_angle = self.step_angle if self.step_angle is not None else 0.0
step_period = (self.step_period if self.step_period is not None else period)

from rex-gym.

nicrusso7 avatar nicrusso7 commented on May 26, 2024

I may be wrong but, nope, don't think so.. in both cases, the values we set are actually the same

def setup_ui(self, base_x, step, period):

self._ranges = {

from rex-gym.

nicrusso7 avatar nicrusso7 commented on May 26, 2024

Do you have the same behavior running the policy_player in render mode? just wondering if the pybullet update made some changes

from rex-gym.

Dzhange avatar Dzhange commented on May 26, 2024

HIii, just checked several things:

  1. I found that walking backwards or forwards is randomly chosen, so I think the main problem is the gait/frequency etc
  2. sometimes the step_length parameter varies a bit(i.e. from -0.1 to -0.3), not sure if this is normal?
  3. I tried the newest pybullet with a monitor, and the robot walked well. I also tested the session with 3 settings:
  1. render and record video at same time --> moving slowly
out.mp4
  1. render only --> normal
out1.mp4

3)record video only --> rapid frequency, yet slow

cap_only.mp4

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

from rex-gym.

Dzhange avatar Dzhange commented on May 26, 2024

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!

from rex-gym.

nicrusso7 avatar nicrusso7 commented on May 26, 2024

Each env has its own metadata:

metadata = {"render.modes": ["human", "rgb_array"], "video.frames_per_second": 66}

Have you tried editing video.frames_per_second?

from rex-gym.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.