Skip to content

RuntimeError: Handle Panda does not exist. #24

@Ethan-Chen-plus

Description

@Ethan-Chen-plus
import os
import openai
from arguments import get_config
from interfaces import setup_LMP
from visualizers import ValueMapVisualizer
from envs.rlbench_env import VoxPoserRLBench
from utils import set_lmp_objects
import numpy as np
from rlbench import tasks

config = get_config('rlbench')
# uncomment this if you'd like to change the language model (e.g., for faster speed or lower cost)
# for lmp_name, cfg in config['lmp_config']['lmps'].items():
#     cfg['model'] = 'gpt-3.5-turbo'

# initialize env and voxposer ui
visualizer = ValueMapVisualizer(config['visualizer'])
env = VoxPoserRLBench(visualizer=visualizer)
lmps, lmp_env = setup_LMP(env, config, debug=False)
voxposer_ui = lmps['plan_ui']

result:

Jupyter environment detected. Enabling Open3D WebVisualizer.
[Open3D INFO] WebRTC GUI backend enabled.
[Open3D INFO] WebRTCWindowSystem: HTTP handshake server disabled.


---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[2], line 20
     14 # uncomment this if you'd like to change the language model (e.g., for faster speed or lower cost)
     15 # for lmp_name, cfg in config['lmp_config']['lmps'].items():
     16 #     cfg['model'] = 'gpt-3.5-turbo'
     17 
     18 # initialize env and voxposer ui
     19 visualizer = ValueMapVisualizer(config['visualizer'])
---> 20 env = VoxPoserRLBench(visualizer=visualizer)
     21 lmps, lmp_env = setup_LMP(env, config, debug=False)
     22 voxposer_ui = lmps['plan_ui']

File /data1/ckw/00robo/01llm/VoxPoser/src/envs/rlbench_env.py:52, in VoxPoserRLBench.__init__(self, visualizer)
     49 action_mode = CustomMoveArmThenGripper(arm_action_mode=EndEffectorPoseViaPlanning(),
     50                                 gripper_action_mode=Discrete())
     51 self.rlbench_env = Environment(action_mode)
---> 52 self.rlbench_env.launch()
     53 self.task = None
     55 self.workspace_bounds_min = np.array([self.rlbench_env._scene._workspace_minx, self.rlbench_env._scene._workspace_miny, self.rlbench_env._scene._workspace_minz])

File /data1/ckw/micromamba/envs/voxposer-env/lib/python3.9/site-packages/rlbench/environment.py:112, in Environment.launch(self)
    110     arm.set_position(panda_pos)
    111 else:
--> 112     arm, gripper = arm_class(), gripper_class()
    114 self._robot = Robot(arm, gripper)
    115 if self._randomize_every is None:

File /data1/ckw/micromamba/envs/voxposer-env/lib/python3.9/site-packages/pyrep/robots/arms/panda.py:7, in Panda.__init__(self, count)
      6 def __init__(self, count: int = 0):
----> 7     super().__init__(count, 'Panda', 7)

File /data1/ckw/micromamba/envs/voxposer-env/lib/python3.9/site-packages/pyrep/robots/arms/arm.py:25, in Arm.__init__(self, count, name, num_joints, base_name, max_velocity, max_acceleration, max_jerk)
     23 """Count is used for when we have multiple copies of arms"""
     24 joint_names = ['%s_joint%d' % (name, i+1) for i in range(num_joints)]
---> 25 super().__init__(count, name, joint_names, base_name)
     27 # Used for motion planning
     28 self.max_velocity = max_velocity

File /data1/ckw/micromamba/envs/voxposer-env/lib/python3.9/site-packages/pyrep/robots/robot_component.py:19, in RobotComponent.__init__(self, count, name, joint_names, base_name)
     16 def __init__(self, count: int, name: str, joint_names: List[str],
     17              base_name: str = None):
     18     suffix = '' if count == 0 else '#%d' % (count - 1)
---> 19     super().__init__(
     20         name + suffix if base_name is None else base_name + suffix)
     21     self._num_joints = len(joint_names)
     23     # Joint handles

File /data1/ckw/micromamba/envs/voxposer-env/lib/python3.9/site-packages/pyrep/objects/object.py:24, in Object.__init__(self, name_or_handle)
     22     self._handle = name_or_handle
     23 else:
---> 24     self._handle = sim.simGetObjectHandle(name_or_handle)
     25 assert_type = self._get_requested_type()
     26 actual = ObjectType(sim.simGetObjectType(self._handle))

File /data1/ckw/micromamba/envs/voxposer-env/lib/python3.9/site-packages/pyrep/backend/sim.py:94, in simGetObjectHandle(objectName)
     92 handle = lib.simGetObjectHandle(objectName.encode('ascii'))
     93 if handle < 0:
---> 94     raise RuntimeError('Handle %s does not exist.' % objectName)
     95 return handle

RuntimeError: Handle Panda does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions