jackyliang42 commited on
Commit
5046e86
1 Parent(s): a2fa930

more informed err msg when obj not found

Browse files
Files changed (1) hide show
  1. sim.py +2 -3
sim.py CHANGED
@@ -523,10 +523,9 @@ class PickPlaceEnv():
523
  else:
524
  obj_name = obj_name.replace('circle', 'bowl').replace('square', 'block').replace('small', '').strip()
525
  obj_id = self.obj_name_to_id[obj_name]
 
526
  except:
527
- print(f'requested_name="{obj_name}"')
528
- print(f'available_objects_and_id="{self.obj_name_to_id}')
529
- return obj_id
530
 
531
  def get_obj_pos(self, obj_name):
532
  obj_name = obj_name.replace('the', '').replace('_', ' ').strip()
 
523
  else:
524
  obj_name = obj_name.replace('circle', 'bowl').replace('square', 'block').replace('small', '').strip()
525
  obj_id = self.obj_name_to_id[obj_name]
526
+ return obj_id
527
  except:
528
+ raise Exception('Object name "{}" not found'.format(obj_name))
 
 
529
 
530
  def get_obj_pos(self, obj_name):
531
  obj_name = obj_name.replace('the', '').replace('_', ' ').strip()