Giter Site home page Giter Site logo

Comments (6)

qgallouedec avatar qgallouedec commented on August 16, 2024

I can't reproduce the issue. Here is the screen recording of OpenGL GUI (with the correct fps):

Screen.Recording.2023-10-12.at.12.10.43.mov

And the gif generated (also with the correct fps):

panda

from panda-gym.

Qingliang-Li avatar Qingliang-Li commented on August 16, 2024

I can't reproduce the issue. Here is the screen recording of OpenGL GUI (with the correct fps):

Screen.Recording.2023-10-12.at.12.10.43.mov
And the gif generated (also with the correct fps):

panda panda

If you add a few more frames to the GIF, you will notice that the robot arm stops moving in the later frames. In this video, you can observe that the robotic arm remains stationary during the second, third, and fourth seconds, although it should be in motion.

from panda-gym.

Qingliang-Li avatar Qingliang-Li commented on August 16, 2024

If you add a few more frames to the GIF, you will notice that the robot arm stops moving in the later frames. In this video, you can observe that the robotic arm remains stationary during the second, third, and fourth seconds, although it should be in motion.

from panda-gym.

qgallouedec avatar qgallouedec commented on August 16, 2024

It moves slowly (because the desired position you've defined evolves slowly), but it's not stationary.

from panda-gym.

qgallouedec avatar qgallouedec commented on August 16, 2024

If you change a bit your desired positions, here is what you get:

import gymnasium as gym
import panda_gym
import matplotlib.pyplot as plt
from matplotlib import animation
import numpy as np


def display_frames_as_gif(frames):
    patch = plt.imshow(frames[0])
    plt.axis("off")

    def animate(i):
        patch.set_data(frames[i])

    anim = animation.FuncAnimation(plt.gcf(), animate, frames=len(frames), interval=5)
    anim.save("panda.gif", writer="pillow", fps=25)


env = gym.make("PandaReach-v3", render_mode="rgb_array", renderer="OpenGL")
observation, info = env.reset()

z = observation["observation"][2]

theta = np.linspace(0, 20 * np.pi, 1000)
r = 0.1
desired_positions = np.stack([r * np.cos(theta), r * np.sin(theta), z * np.ones(1000)], axis=1)

frames = []
for i in range(200):
    frames.append(env.render())
    current_position = observation["observation"][0:3]
    desired_position = desired_positions[i]
    action = 5.0 * (desired_position - current_position)
    observation, reward, terminated, truncated, info = env.step(action)

env.close()
display_frames_as_gif(frames)

panda

from panda-gym.

Qingliang-Li avatar Qingliang-Li commented on August 16, 2024

I get it. Thank you very much,Gallouedec.

from panda-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.