[Python] Position of robotic arm base in gymnasium-robotics' fetch environments off center

Discussão em 'Python' iniciado por Stack, Abril 16, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to solve the Farama gymnasium-robotic fetch environments, specifically the "FetchReachDense-v3" problem. When running the simulation, the base of the robotic arm seems to be misplaced:

    [​IMG]

    This, firstly, looks weird, is not like that in the gymnasium-robotics documentation or other example solutions of this problem, and I think it messes up the problem as I'm not even sure if the arm is even able to reach some of the goal positions like this.

    Running this code shows the occurring problem (at least for me):

    import gymnasium as gym
    import gymnasium_robotics
    import numpy as np

    # Creating environment
    gym.register_envs(gymnasium_robotics)
    env = gym.make("FetchReachDense-v3", render_mode="human")
    observation, info = env.reset(seed=42)

    print("Simulating with completely random actions")

    # loop
    summed_reward = 0
    for _ in range(2000):
    action = np.random.uniform(-1, 1,4) # random action

    observation, reward, terminated, truncated, info = env.step(action) # Calculate next step of simulation.

    summed_reward += reward # sum rewards

    if terminated or truncated:
    print("summed reward =", summed_reward)
    summed_reward = 0
    observation, info = env.reset()

    env.close()


    There also seems to be something else wrong. When I instead run 'FetchPickAndPlaceDense-v3' (where the base is also misplaced) there is no object generated which is supposed to be picked up. That makes the whole environment quite useless.

    I run python==3.11 with gymnasium==1.0.0, gymnasium-robotics=1.3.1, mujoco==3.2.7, and numpy==2.2.1. The problem also occurred with numpy=2.1.3 and with an older version mujoco (not sure about the exact version anymore).

    Do you have ideas what I'm doing wrong here? Or is this actually an issue with gymnasium-robotics?

    Thanks in advance and if you need any other info, let me know.

    Continue reading...

Compartilhe esta Página