Skip to content

Commit

Permalink
small updates and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
contactrika committed Sep 30, 2021
1 parent d7bdbcd commit 401bb64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 5 additions & 2 deletions dedo/envs/deform_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,11 @@ def load_objects(self, sim, args, debug):
#
# Load deformable object.
#
texture_path = os.path.join(
data_path, self.get_texture_path(args.deform_texture_file))
texture_path = args.deform_texture_file
if not self.args.env.startswith('FoodPacking'):
# Randomize textures for deformables (except YCB food objects).
texture_path = os.path.join(
data_path, self.get_texture_path(args.deform_texture_file))
deform_id = load_deform_object(
sim, deform_obj, texture_path, args.deform_scale,
args.deform_init_pos, args.deform_init_ori,
Expand Down
11 changes: 9 additions & 2 deletions dedo/utils/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,15 @@ def args_postprocess(args):
"""Post processing for args. Separates --env into --task and --version
and does basic sanity checks."""
env_parts = args.env.split('-v')
assert (len(env_parts) == 2 and env_parts[1].isdigit()), \
'--env=[Task]-v[Version] (e.g. HangGarment-v1)'
if len(env_parts) != 2 or not env_parts[1].isdigit():
print('Please set --env=[Task]-v[Version] (e.g. HangGarment-v1)')
exit(1)
if args.robot == 'franka' and args.env != 'HangGarment-v1':
print('Please select robot=anchor for tasks other than HangGarment-v1')
exit(1)
if args.robot == 'franka1' and not args.env.startswith('FoodPacking'):
print('--robot=franka1 should be used with the FoodPacking task')
exit(1)
args.task = env_parts[0]
args.version = int(env_parts[1])
if args.task not in TASK_INFO.keys():
Expand Down

0 comments on commit 401bb64

Please sign in to comment.