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

RethinkGripper: invalid value for init_qpos? #383

Open
Sh0cktr4p opened this issue Mar 20, 2023 · 0 comments
Open

RethinkGripper: invalid value for init_qpos? #383

Sh0cktr4p opened this issue Mar 20, 2023 · 0 comments
Assignees

Comments

@Sh0cktr4p
Copy link
Contributor

It seems like the init_qpos value for the RethinkGripper is out of the bounds of the reachable qpos values.

Is there currently a method to obtain the gripper qpos bounds?

By experiment (I created an instance of the reach environment with a panda robot and a rethink gripper) it seems like the reachable gripper qpos values range from ca. [-0.01, 0.01] to ca. [0.01, -0.01], while init_qpos is set to be [ 0.020833, -0.020833].

Script to reproduce:

import robosuite

if __name__ == "__main__":
    rsenv = robosuite.make(
        "Lift",
        robots="Panda",
        gripper_types="RethinkGripper",
        has_renderer=True,
        has_offscreen_renderer=False,
        render_camera="frontview",
        control_freq=20,
        use_camera_obs=False,
        use_object_obs=False,
        horizon=200,
    )

    # Switch between episodes between opening and closing gripper
    # to show both bounds
    gripper_actuation = 1
    init_qpos = rsenv.robots[0].gripper.init_qpos
    print(f"init_qpos: {init_qpos}")
    obs = rsenv.reset()
    print(obs["robot0_gripper_qpos"])

    while True:
        rsenv.render()
        act = rsenv.action_spec[0] * 0
        act[-1] = gripper_actuation
        obs, _, done, _ = rsenv.step(act)
        gqps = obs["robot0_gripper_qpos"]
        print(f"obs: {gqps}")
        if done:
            gripper_actuation *= -1
            rsenv.reset()

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

2 participants